cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

User: Nathan M Epstein

Nathan M Epstein's wiki page.

Nathan M Epstein has authored 7 sequences.

A349958 a(n) is the index of the first row in Pascal's triangle that contains a multiple of n.

Original entry on oeis.org

0, 2, 3, 4, 5, 4, 7, 8, 9, 5, 11, 9, 13, 8, 6, 16, 17, 9, 19, 6, 7, 11, 23, 10, 25, 13, 27, 8, 29, 10, 31, 32, 11, 17, 7, 9, 37, 19, 13, 10, 41, 9, 43, 12, 10, 23, 47, 16, 49, 25, 18, 13, 53, 27, 11, 8, 19, 29, 59, 10, 61, 32, 9, 64, 13, 11, 67, 17, 23, 8, 71, 12, 73, 37, 25
Offset: 1

Author

Nathan M Epstein, Dec 06 2021

Keywords

Comments

a(n) is the minimum j such that binomial(j,k) is divisible by n for some k in 0..j.
a(n) is at most equal to A058084(n), the least m such that binomial(m,k) = n for some k.

Examples

			In the table below, the k value shown is the minimum k such that n divides binomial(a(n), k).
.
   n  a(n)  k  C(a(n), k)
  --  ----  -  ----------
   1    0   0       1
   2    2   1       2
   3    3   1       3
   4    4   1       4
   5    5   1       5
   6    4   2       6
   7    7   1       7
   8    8   1       8
   9    9   1       9
  10    5   2      10
  11   11   1      11
  12    9   2      36
.
The table below shows the left half (and middle column) of rows j = 0..12 of Pascal's triangle; each number in parentheses there is the first term encountered in Pascal's triangle (read by rows from left to right) that is a multiple of some number n in 1..12, and the corresponding term of {a(n)} whose value is j appears in the column at the right.
E.g., the first multiple of 12 encountered in Pascal's triangle is binomial(9,2) = 36; it appears in row 9, so a(12) = 9, and the column at the right includes a(12) in row 9.
                                               | terms in a(1)..a(12)
   j | left half of row j of Pascal's triangle | that are equal to j
  ---+-----------------------------------------+---------------------
   0 |                                    (1)  |        a(1)  =  0
   1 |                                  1      |
   2 |                               1    (2)  |        a(2)  =  2
   3 |                            1    (3)     |        a(3)  =  3
   4 |                         1    (4)   (6)  |  a(4), a(6)  =  4
   5 |                      1    (5)  (10)     |  a(5), a(10) =  5
   6 |                   1     6    15    20   |
   7 |                1    (7)   21    35      |        a(7)  =  7
   8 |             1    (8)   28    56    70   |        a(8)  =  8
   9 |          1    (9)  (36)   84   126      |  a(9), a(12) =  9
  10 |       1    10    45   120   210   252   |
  11 |    1   (11)   55   165   330   462      |        a(11) = 11
  12 | 1    12    66   210   496   792   924   |
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{k = 0}, While[!AnyTrue[Binomial[k, Range[0, Floor[k/2]]], Divisible[#, n] &], k++]; k]; Array[a, 75] (* Amiram Eldar, Dec 07 2021 *)
  • PARI
    a(n) = my(k=0); while (!#select(x->(x==1), apply(denominator, vector((k+2)\2, i, binomial(k, i-1))/n)), k++); k; \\ Michel Marcus, Dec 07 2021
    
  • PARI
    a(n) = { my (r = [1 % n]); for (i = 0, oo, if (vecmin(r)==0, return (i), r = (concat(0, r) + concat(r, 0)) % n;);); }
  • Python
    import numpy as np
    def pascals(n):
      a = np.ones(1)
      f = np.ones(2)
      triangle = [a]
      for i in range(n):
        a = np.convolve(a,f)
        triangle.append(a)
      return triangle
    def test(n,tri):
      for i, element in enumerate(tri):
        for sub_e in element:
          if sub_e % n == 0:
            return i
    tri = pascals(500)
    for i in range(1,50):
      print(test(i,tri),end=',')
    
  • Python
    from math import comb
    def A349958(n):
        for j in range(n+1):
            for k in range(j+1):
                if comb(j,k) % n == 0: return j # Chai Wah Wu, Dec 10 2021
    

Extensions

More terms from Michel Marcus, Dec 07 2021

A323180 Row sums of A323179.

Original entry on oeis.org

1, 3, 4, 9, 9, 22, 17, 44, 36, 80, 73, 138, 149, 279, 264, 467, 575, 771, 980, 1570, 1868, 2184, 3493, 4288, 6512, 7156, 11766, 13609, 21452, 21526, 38880, 44374, 53328, 77009, 90383, 175886, 126597, 222489, 323328, 416581, 622641, 570846
Offset: 0

Author

Nathan M Epstein, Jan 10 2019

Keywords

Comments

Sums of triangle rows of the rule 30 automaton, in which the execution of the rule has been modified as such:
In the rule 30 CA, local cell neighborhoods are converted into a number 0-7, which is then used to determine if the central cell will be active in the next generation of the CA.
For this version, when determining this local neighborhood number, any positive nonzero value is treated as a Boolean TRUE. 0 values operate the same way as the conventional version of rule 30.
For example: [0],[0],[14] becomes [False],[False],[True] for the purposes of determining the local state.
Second, instead of writing a 1 when instructed by the 8 sub-rules, instead write the sum of the three local cells.

Examples

			Triangle begins:             sum
.             1               1
.          1, 1, 1            3
.       1, 2, 0, 0, 1         4
.    1, 3, 0, 2, 1, 1, 1      9
. 1, 4, 0, 0, 3, 0, 0, 0, 1   9
		

Crossrefs

Cf. A323179.

A323179 Triangle read by rows giving successive states of cellular automaton generated by "Rule 30", with accumulating cell values.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 0, 0, 1, 1, 3, 0, 2, 1, 1, 1, 1, 4, 0, 0, 3, 0, 0, 0, 1, 1, 5, 0, 4, 3, 3, 3, 0, 1, 1, 1, 1, 6, 0, 0, 7, 0, 0, 0, 0, 2, 0, 0, 1, 1, 7, 0, 6, 7, 7, 7, 0, 0, 2, 2, 2, 1, 1, 1, 1, 8, 0, 0, 13, 0, 0, 0, 7, 2, 4, 0, 0, 0, 0, 0
Offset: 0

Author

Nathan M Epstein, Jan 10 2019

Keywords

Comments

First take the sum of the values of the left neighbor, the cell itself, and the right neighbor. The next value of the cell will equal this sum if the value of the left neighbor is zero, or if the cell and its right neighbor are both zero.
In other cases the next value of the cell will be zero.
The pattern of nonzero cells is the same as the rule 30 CA (A070950), but the cell values grow as the CA progresses.

Examples

			Triangle begins:
              1
           1, 1, 1
        1, 2, 0, 0, 1
     1, 3, 0, 2, 1, 1, 1
  1, 4, 0, 0, 3, 0, 0, 0, 1
		

Crossrefs

Min(a(n), 1) = A070950(n).

A323110 Aggregate values of n-th stage of growth for two-dimensional cellular automaton defined by "Rule 614", based on the 5-celled von Neumann neighborhood, calculated via even-zeroing instead of mod 2.

Original entry on oeis.org

1, 5, 9, 21, 9, 45, 57, 213, 129, 645, 1161, 2709, 657, 3285, 5841, 13869, 3129, 15645, 28161, 65709, 28161, 140805, 178353, 666477, 391137, 1955685, 3520233, 8213877, 3518721, 17593605, 22290273, 83271357, 48828129, 244140645, 439453161, 1025390709, 439453161, 2197265805, 2783203353, 10400391477
Offset: 0

Author

Nathan M Epstein, Jan 04 2019

Keywords

Comments

It's helpful to define A072272 first: Consider only the four nearest (N,S,E,W) neighbors of a cell together with the cell itself. In the next state, the state of a cell will change if an odd number of these five cells is ON. This is equivalent to taking the sum of all 4 neighbor cells, together with the cell itself, mod 2. A072272 is the total number of active cells per generation. This sequence differs from A072272 because the state of the next cell can be any odd number instead of 1. Instead of applying mod 2 to the sum of the 5 local cells, this variation takes the sum of the 5 local cells, and then sets the value to zero if that value is even.
The generations of A072272 are congruent mod 2 to the generations of this automaton. A consequence of this is that the pattern of active cells is the same between both implementations of the CA. However, the values of the cells in this automaton differ from those in A072272. In this variation the values of cell are not constrained to the range [0,1]. The terms in this sequence are the aggregate values of all cells for each generation, instead of the number of cells.

Crossrefs

Cf. A072272.

A320440 Row sums of A225043.

Original entry on oeis.org

0, 2, 4, 8, 11, 20, 22, 32, 31, 52, 56, 80, 79, 100, 94, 128, 137, 176, 172, 208, 193, 244, 254, 320, 266, 340, 283, 400, 407, 332, 466, 512, 499, 580, 569, 680, 667, 724, 745, 848, 821, 872, 904, 976, 1021, 1060, 1082, 1280, 1093, 1312, 1330, 1360, 1379, 1472, 1479, 1584, 1543
Offset: 0

Author

Nathan M Epstein, Jan 09 2019

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_]:=Sum[Mod[Binomial[n, k],n+1], {k,0, n}]; Array[a, 100, 0] (* Stefano Spezia, Jan 09 2019 *)
  • PARI
    a(n) = sum(k=0, n, binomial(n,k) % (n+1)); \\ Michel Marcus, Jan 09 2019

Formula

a(A000040(n)) = A072205(n) for n > 0.

A320100 Automata sum similar to A102376 but using mod 5.

Original entry on oeis.org

4, 16, 44, 61, 4, 16, 64, 176, 244, 16, 64, 201, 324, 556, 44, 176, 324, 736, 1004, 61, 244, 556, 1004, 1561, 4, 16, 64, 176, 244, 16, 64, 256, 704, 976, 64, 256, 804, 1296, 2224, 176, 704, 1296, 2944, 4016, 244, 976, 2224, 4016, 6244, 16, 64, 201, 324, 556
Offset: 1

Author

Nathan M Epstein, Dec 10 2018

Keywords

Comments

The automata that generates this sequence operates on a grid of cells c(i,j). The cells in the automata have five possible values, [0-4]. The next generation in the CA is calculated by applying the following rule to each cell: c(i,j) = ( c(i+1,j-1) + c(i+1,j+1) + c(i-1,j-1) + c(i-1,j+1) ) mod 5.
Start with a single cell with a value of 1, with all other cells set to 0. For each generation, the term in this sequence c(n) is the aggregate values of all cells in the grid for each discrete generation of the automaton (i.e., not cumulative over multiple generations).
The cellular automaton that generates this sequence has been empirically observed to repeat the number of active cells (4 in this case) if the iteration number N is a power of the modulus + 1. The modulus in this case is 5.
This has been observed to occur with any prime mod and any starting pattern of cells. I'm picking this particular implementation because it's the same as the one used in A102376.
Counting the active (nonzero) cells instead of taking the sum also creates a different but related sequence. This sequence is the sum of each iteration, and cells in this automaton have values 0, 1, 2, 3 or 4. Only for mod 2 are both the sum and active cell counts the same.

Crossrefs

Cf. A102376 (mod 2), A320030 (mod 3).

Programs

  • Python
    # requires scipy library (try pip install scipy)
    # more info: https://scipy.org/install/
    import numpy as np
    from scipy import signal
    frameSize = 301
    filter = [[0, 1, 0], [1, 0, 1], [0, 1, 0]] # this defines the CA neighborhood
    frame  = np.zeros((frameSize, frameSize))
    frame[int(frameSize/2), int(frameSize/2)] = 1
    mod = 5
    sequence = []
    for j in range(140):
        frame = signal.convolve2d(frame, filter, mode='same')
        frame = np.mod(frame, mod)
        # If you want to visualize the automaton you can use a tool
        # like opencv (pip install opencv-python) to save the frame
        # as an image each  iteration.
        # i:e:(with other imports) import cv2
        #     (inside loop)         cv2.imwrite('automatonFrame%s.png' % j, frame)
        sequence.append(int(np.sum(frame.reshape(1, -1))))
    print(sequence)

A320030 Automaton sum similar to A102376 but using mod 3 instead of mod 2.

Original entry on oeis.org

1, 4, 13, 4, 16, 52, 13, 52, 121, 4, 16, 52, 16, 64, 208, 52, 208, 484, 13, 52, 121, 52, 208, 484, 121, 484, 1093, 4, 16, 52, 16, 64, 208, 52, 208, 484, 16, 64, 208, 64, 256, 832, 208, 832, 1936, 52, 208, 484, 208, 832, 1936, 484, 1936, 4372, 13, 52, 121, 52
Offset: 1

Author

Nathan M Epstein, Dec 10 2018

Keywords

Comments

The automaton that generates this sequence operates on a grid of cells c(i,j). The cells have three possible values, 0, 1, and 2. The next generation in the CA is calculated by applying the following rule to each cell: c(i,j) = ( c(i+1,j-1) + c(i+1,j+1) + c(i-1,j-1) + c(i-1,j+1) ) mod 3.
Start with a single cell with a value of 1, with all other cells set to 0. For each generation, the term in this sequence c(n) is the aggregate values of all cells in the grid for each discrete generation of the automaton (i.e., not cumulative over multiple generations).
The cellular automaton that generates this sequence has been empirically observed to repeat the number of active cells (4 in this case) if the iteration number N is a power of the modulus + 1. The modulus in this case is 3.
This has been observed to occur with any prime modulus and any starting pattern of cells. I'm picking this particular implementation because it's the same as the one used in A102376.
Counting the active (nonzero) cells instead of taking the sum also creates a different but related sequence. This sequence is the sum of each iteration, and cells in this automaton have values 0, 1, or 2. Only for mod 2 are both the sum and active cell counts the same.

Crossrefs

Cf. A096053.
Cf. A102376 (mod 2), A320100 (mod 5).

Programs

  • Python
    import numpy as np
    from scipy import signal
    frameSize = 301
    filter = [[0,1,0],[1,0,1],[0,1,0]] # this defines the CA neighborhood
    frame  = np.zeros((frameSize,frameSize))
    frame[frameSize//2,frameSize//2] = 1
    mod = 3
    sequence = [1]
    for j in range(140):
        frame = signal.convolve2d(frame, filter, mode='same')
        frame = np.mod(frame, mod)
        sequence.append(int(np.sum(frame.reshape(1,-1))))

Formula

a(3^n) = A096053(n).