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.

Showing 1-8 of 8 results.

A151895 Number of ON cells after n generations of the cellular automaton on the square grid that is described in the Comments.

Original entry on oeis.org

0, 1, 5, 9, 13, 25, 29, 41, 53, 65, 85, 97, 117, 145, 149, 161, 173, 185, 213, 233, 261, 297, 333, 385, 429, 481, 533, 545, 573, 601, 629, 673, 717, 761, 837, 905, 989, 1033, 1085, 1145, 1197, 1257, 1309, 1337, 1397, 1457, 1525, 1625, 1669
Offset: 0

Views

Author

David Applegate and N. J. A. Sloane, Jul 30 2009

Keywords

Comments

The cells are the squares of the standard square grid.
Cells are either OFF or ON, once they are ON they stay ON, and we begin in generation 1 with 1 ON cell.
Each cell has 4 neighbors, those that it shares an edge with. Cells that are ON at generation n all try simultaneously to turn ON all their neighbors that are OFF. They can only do this at this point in time; afterwards they go to sleep (but stay ON).
A square Q is turned ON at generation n+1 if:
a) Q shares an edge with one and only one square P (say) that was turned ON at generation n (in which case the two squares which intersect Q only in a vertex not on that edge are called Q's "outer squares"), and
b) Q's outer squares were not considered (that is, satisfied a)) in any previous generation, and
c) Q's outer squares are not prospective squares of the (n+1)st generation satisfying a).
Originally constructed in an attempt to explain the Holladay-Ulam CA shown in Fig. 2 of the 1962 Ulam article. However, as explained on page 222 of that article, the actual rule for that CA (see A151906, A151907) is different from ours.
A170896 and A267190 are also closely related cellular automata.
A151895 and A267190 first differ at n=17, when A267190 turns (12,2) ON even though its outer square (11,1) was considered (not turned ON) in a previous generation. - David Applegate, Jan 30 2016

References

  • D. Applegate, Omar E. Pol and N. J. A. Sloane, The Toothpick Sequence and Other Sequences from Cellular Automata, Congressus Numerantium, Vol. 206 (2010), 157-191.

Crossrefs

See A170896, A170897 for the original Schrandt-Ulam version.
Cf. A151896 (the first differences), A139250, A151905, A151906, A151907, A267190, A267191.

Formula

We do not know of a recurrence or generating function.

Extensions

Entry (including definition) revised by David Applegate and N. J. A. Sloane, Jan 21 2016

A151906 a(0) = 0, a(1) = 1; for n>1, a(n) = 8*A151905(n) + 4.

Original entry on oeis.org

0, 1, 4, 4, 4, 12, 4, 4, 12, 12, 12, 36, 4, 4, 12, 12, 12, 36, 12, 12, 36, 36, 36, 108, 4, 4, 12, 12, 12, 36, 12, 12, 36, 36, 36, 108, 12, 12, 36, 36, 36, 108, 36, 36, 108, 108, 108, 324, 4, 4, 12, 12, 12, 36, 12, 12, 36, 36, 36, 108, 12, 12, 36, 36, 36, 108, 36, 36, 108, 108, 108
Offset: 0

Views

Author

David Applegate and N. J. A. Sloane, Jul 31 2009, Aug 03 2009

Keywords

Comments

Consider the Holladay-Ulam CA shown in Fig. 2 and Example 2 of the Ulam article. Then a(n) is the number of cells turned ON in generation n.

Examples

			From _Omar E. Pol_, Apr 02 2018: (Start)
Note that this sequence also can be written as an irregular triangle read by rows in which the row lengths are the terms of A011782 multiplied by 3, as shown below:
0,1, 4;
4,4,12;
4,4,12,12,12,36;
4,4,12,12,12,36,12,12,36,36,36,108;
4,4,12,12,12,36,12,12,36,36,36,108,12,12,36,36,36,108,36,36,108,108,108,324;
4,4,12,12,12,36,12,12,36,36,36,108,12,12,36,36,36,108,36,36,108,108,108,... (End)
		

References

  • S. Ulam, On some mathematical problems connected with patterns of growth of figures, pp. 215-224 of R. E. Bellman, ed., Mathematical Problems in the Biological Sciences, Proc. Sympos. Applied Math., Vol. 14, Amer. Math. Soc., 1962.

Crossrefs

Programs

  • Maple
    f := proc(n) local j; j:=n mod 6; if (j<=1) then 0 elif (j<=4) then 1 else 2; fi; end;
    wt := proc(n) local w,m,i; w := 0; m := n; while m > 0 do i := m mod 2; w := w+i; m := (m-i)/2; od; w; end;
    A151904 := proc(n) local k,j; k:=floor(n/6); j:=n-6*k; (3^(wt(k)+f(j))-1)/2; end;
    A151905 := proc (n) local k,j;
    if (n=0) then 0;
    elif (n=1) then 1;
    elif (n=2) then 0;
    else k:=floor( log(n/3)/log(2) ); j:=n-3*2^k; A151904(j); fi;
    end;
    A151906 := proc(n);
    if (n=0) then 0;
    elif (n=1) then 1;
    else 8*A151905(n) + 4;
    fi;
    end;
  • Mathematica
    wt[n_] := DigitCount[n, 2, 1];
    f[n_] := {0, 0, 1, 1, 1, 2}[[Mod[n, 6] + 1]];
    A151902[n_] := wt[Floor[n/6]] + f[n - 6 Floor[n/6]];
    A151904[n_] := (3^A151902[n] - 1)/2;
    A151905[n_] := Module[{k, j}, Switch[n, 0, 0, 1, 1, 2, 0, _, k = Floor[Log2[n/3]]; j = n - 3*2^k; A151904[j]]];
    a[n_] := Switch[n, 0, 0, 1, 1, _, 8 A151905[n] + 4];
    Table[a[n], {n, 0, 70}] (* Jean-François Alcover, Feb 16 2023, after Maple code *)

Formula

The three trisections are essentially A147582, A147582 and 3*A147582 respectively. More precisely, For t >= 1, a(3t) = a(3t+1) = A147582(t+1) = 4*3^(wt(t)-1), a(3t+2) = 4*A147582(t+1) = 4*3^wt(t). See A151907 for explanation.

A296510 Toothpick sequence on triangular grid (see Comments lines for definition).

Original entry on oeis.org

0, 1, 3, 7, 13, 19, 25, 31, 41, 57, 77, 93, 103, 109, 119, 135, 159, 187, 219, 247, 279, 319, 369, 409, 431, 439, 449, 465, 489, 517, 549, 581, 621, 677, 751, 827, 891, 933, 969, 1009, 1071, 1147, 1237, 1317, 1405, 1507, 1629, 1725, 1775, 1789, 1799, 1815, 1839, 1867, 1899, 1931, 1971, 2027, 2101, 2177, 2241
Offset: 0

Views

Author

Omar E. Pol, Dec 14 2017

Keywords

Comments

We use toothpicks of length 2, the same as the toothpick cellular automaton of A139250, but here we are on triangular grid, hence we have three axes, not two.
The Toothpicks are alternately arranged on the three axes in a rotating cycle.
a(n) gives the number of toothpicks in the structure after n-th stage.
A296511 (the first differences) gives the number of toothpicks added at n-th stage.
The structure reveals that some cellular automata that have recurrent periods can be represented by irregular triangles of first differences whose row lengths are the terms of A011782 multiplied by k (instead of powers of 2), where k is the length of their "word". In this case the word should be "abc", therefore k = 3. In the case of the cellular automaton with normal toothpicks (A139250) the word should be "ab", therefore k = 2.
For more information about the "word" of a cellular automaton see A296612.
Note that due to the unusual orientation of the polygons that are located on the edges of the structure, the image of this cellular automaton resembles the photo of an object that is rotating.
Note that between other polygons the structure contains the same "petals" as the floret pentagonal tiling.
Apparently the graph could be similar to the graph of A151907.

Examples

			After 49 stages in every 60-degree wedge of the mentioned dodecagon we can see six kind of closed regions as shown below:
----------------------------------------------------------------------------------
Polygon                    Sides's length  Perimeter   Area  Quantity  Total area
----------------------------------------------------------------------------------
Triangle                   [1,1,1]             3         1     100        100
Rhombus (diamond)          [2,2,2,2]           8         8       5         40
Trapeze                    [1,2,3,2]           8         8      35        280
Irregular pentagon (petal) [1,1,1,2,2]         7         7      58        406
Irregular pentagon         [1,1,3,2,4]        11        15       1         15
Hexagon                    [1,1,1,1,1,1]       6         6      20        120
----------------------------------------------------------------------------------
Subtotal per wedge                                             219        961
.
Then we have:
Subtotal of the six wedges                                    1308       5766
Shared triangle            [1,1,1]             3         1       2          2
----------------------------------------------------------------------------------
Total of the structure after 49 stages                        1306       5764
		

Crossrefs

Cf. A151907, A160160, A296511 (first differences), A296612.
Cf. A160120 (word "a"), A139250 (word "ab"), A299476 (word "abcb"), A299478 (word "abcbc").

A151904 a(n) = (3^(wt(k)+f(j))-1)/2 if n = 6k+j, 0 <= j < 6, where wt = A000120, f = A151899.

Original entry on oeis.org

0, 0, 1, 1, 1, 4, 1, 1, 4, 4, 4, 13, 1, 1, 4, 4, 4, 13, 4, 4, 13, 13, 13, 40, 1, 1, 4, 4, 4, 13, 4, 4, 13, 13, 13, 40, 4, 4, 13, 13, 13, 40, 13, 13, 40, 40, 40, 121, 1, 1, 4, 4, 4, 13, 4, 4, 13, 13, 13, 40, 4, 4, 13, 13, 13, 40, 13, 13, 40, 40, 40, 121, 4, 4, 13, 13, 13, 40, 13, 13, 40, 40, 40
Offset: 0

Views

Author

N. J. A. Sloane, Jul 31 2009

Keywords

Crossrefs

Programs

  • Maple
    f := proc(n) local j; j:=n mod 6; if (j<=1) then 0 elif (j<=4) then 1 else 2; fi; end;
    wt := proc(n) local w,m,i; w := 0; m := n; while m > 0 do i := m mod 2; w := w+i; m := (m-i)/2; od; w; end;
    A151904 := proc(n) local k,j; k:=floor(n/6); j:=n-6*k; (3^(wt(k)+f(j))-1)/2; end;
  • Mathematica
    wt[n_] := DigitCount[n, 2, 1];
    f[n_] := {0, 0, 1, 1, 1, 2}[[Mod[n, 6] + 1]];
    A151902[n_] := wt[Floor[n/6]] + f[n - 6 Floor[n/6]];
    a[n_] := (3^A151902[n] - 1)/2;
    Table[a[n], {n, 0, 82}] (* Jean-François Alcover, Feb 16 2023 *)
  • PARI
    a(n)=(3^(hammingweight(n\6)+[0,0,1,1,1,2][n%6+1])-1)/2 \\ Charles R Greathouse IV, Sep 26 2015

Formula

a(n) = (3^A151902(n)-1)/2.

A151905 a(0) = a(2) = 0, a(1) = 1; for n >= 3, n = 3*2^k+j, 0 <= j < 3*2^k, a(n) = A151904(j).

Original entry on oeis.org

0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 4, 0, 0, 1, 1, 1, 4, 1, 1, 4, 4, 4, 13, 0, 0, 1, 1, 1, 4, 1, 1, 4, 4, 4, 13, 1, 1, 4, 4, 4, 13, 4, 4, 13, 13, 13, 40, 0, 0, 1, 1, 1, 4, 1, 1, 4, 4, 4, 13, 1, 1, 4, 4, 4, 13, 4, 4, 13, 13, 13, 40, 1, 1, 4, 4, 4, 13, 4, 4, 13, 13, 13, 40, 4, 4, 13, 13, 13, 40, 13
Offset: 0

Views

Author

N. J. A. Sloane, Jul 31 2009

Keywords

Comments

Consider the Holladay-Ulam CA shown in Fig. 2 and Example 2 of the Ulam article. Then a(n) is the number of cells turned ON in generation n in a 45-degree sector that are not on the main stem.

Examples

			If written as a triangle:
0,
1, 0,
0, 0, 1,
0, 0, 1, 1, 1, 4,
0, 0, 1, 1, 1, 4, 1, 1, 4, 4, 4, 13,
0, 0, 1, 1, 1, 4, 1, 1, 4, 4, 4, 13, 1, 1, 4, 4, 4, 13, 4, 4, 13, 13, 13, 40
0, 0, 1, 1, 1, 4, 1, 1, 4, 4, 4, 13, 1, 1, 4, 4, 4, 13, 4, 4, 13, 13, 13, 40, 1, 1, 4, 4, 4, 13, 4, 4, 13, 13, 13, 40, 4, 4, 13, 13, 13, 40, 13, 13, 40, 40, 40, 121,
...
then the rows converge to A151904.
		

References

  • S. Ulam, On some mathematical problems connected with patterns of growth of figures, pp. 215-224 of R. E. Bellman, ed., Mathematical Problems in the Biological Sciences, Proc. Sympos. Applied Math., Vol. 14, Amer. Math. Soc., 1962.

Crossrefs

Programs

  • Maple
    f := proc(n) local j; j:=n mod 6; if (j<=1) then 0 elif (j<=4) then 1 else 2; fi; end;
    wt := proc(n) local w,m,i; w := 0; m := n; while m > 0 do i := m mod 2; w := w+i; m := (m-i)/2; od; w; end;
    A151904 := proc(n) local k,j; k:=floor(n/6); j:=n-6*k; (3^(wt(k)+f(j))-1)/2; end;
    A151905 := proc (n) local k,j;
    if (n=0) then 0;
    elif (n=1) then 1;
    elif (n=2) then 0;
    else k:=floor( log(n/3)/log(2) ); j:=n-3*2^k; A151904(j); fi;
    end;
  • Mathematica
    wt[n_] := DigitCount[n, 2, 1];
    f[n_] := {0, 0, 1, 1, 1, 2}[[Mod[n, 6] + 1]];
    A151902[n_] := wt[Floor[n/6]] + f[n - 6 Floor[n/6]];
    A151904[n_] := (3^A151902[n] - 1)/2;
    a[n_] := Module[{k, j}, Switch[n, 0, 0, 1, 1, 2, 0, _, k = Floor[Log2[n/3]]; j = n - 3*2^k; A151904[j]]];
    Table[a[n], {n, 0, 90}] (* Jean-François Alcover, Feb 16 2023, after Maple code *)

A151902 a(n) = wt(k) + f(j) if n = 6k+j, 0 <= j < 6, where wt() = A000120(), f() = A151899().

Original entry on oeis.org

0, 0, 1, 1, 1, 2, 1, 1, 2, 2, 2, 3, 1, 1, 2, 2, 2, 3, 2, 2, 3, 3, 3, 4, 1, 1, 2, 2, 2, 3, 2, 2, 3, 3, 3, 4, 2, 2, 3, 3, 3, 4, 3, 3, 4, 4, 4, 5, 1, 1, 2, 2, 2, 3, 2, 2, 3, 3, 3, 4, 2, 2, 3, 3, 3, 4, 3, 3, 4, 4, 4, 5, 2, 2, 3, 3, 3, 4, 3, 3, 4, 4, 4, 5, 3, 3, 4, 4, 4, 5, 4, 4, 5, 5, 5, 6, 1, 1, 2, 2, 2, 3, 2, 2, 3
Offset: 0

Views

Author

N. J. A. Sloane, Jul 31 2009

Keywords

Crossrefs

Programs

  • Maple
    f := proc(n) local j; j:=n mod 6; if (j<=1) then 0 elif (j<=4) then 1 else 2; fi; end;
    wt := proc(n) local w,m,i; w := 0; m := n; while m > 0 do i := m mod 2; w := w+i; m := (m-i)/2; od; w; end;
    A151902 := proc(n) local k,j; k:=floor(n/6); j:=n-6*k; wt(k)+f(j); end;
  • Mathematica
    wt[n_] := DigitCount[n, 2, 1];
    f[n_] := {0, 0, 1, 1, 1, 2}[[Mod[n, 6] + 1]];
    a[n_] := wt[Floor[n/6]] + f[n - 6 Floor[n/6]];
    Table[a[n], {n, 0, 104}] (* Jean-François Alcover, Feb 16 2023 *)

A151899 Period 6: repeat [0, 0, 1, 1, 1, 2].

Original entry on oeis.org

0, 0, 1, 1, 1, 2, 0, 0, 1, 1, 1, 2, 0, 0, 1, 1, 1, 2, 0, 0, 1, 1, 1, 2, 0, 0, 1, 1, 1, 2, 0, 0, 1, 1, 1, 2, 0, 0, 1, 1, 1, 2, 0, 0, 1, 1, 1, 2, 0, 0, 1, 1, 1, 2, 0, 0, 1, 1, 1, 2, 0, 0, 1, 1, 1, 2, 0, 0, 1, 1, 1, 2, 0, 0, 1, 1, 1, 2, 0, 0, 1, 1, 1, 2, 0, 0, 1, 1, 1, 2, 0, 0, 1, 1, 1, 2, 0, 0, 1, 1, 1, 2, 0, 0, 1
Offset: 0

Views

Author

N. J. A. Sloane, Jul 31 2009

Keywords

Crossrefs

Programs

  • Magma
    [Abs( ((1-n) mod 3) - ((1+n) mod 2) ) : n in [0..100]]; // Wesley Ivan Hurt, Aug 20 2014
    
  • Maple
    f := proc(n) local j; j:=n mod 6; if (j<=1) then 0 elif (j<=4) then 1 else 2; fi; end;
    A151899:=n->[0, 0, 1, 1, 1, 2][(n mod 6)+1]: seq(A151899(n), n=0..100); # Wesley Ivan Hurt, Jun 20 2016
  • Mathematica
    Table[Abs[Mod[-n + 1, 3] - Mod[n + 1, 2]], {n, 0, 100}] (* Wesley Ivan Hurt, Aug 20 2014 *)
    CoefficientList[Series[(x^2 + x^3 + x^4 + 2 x^5)/(1 - x^6), {x, 0, 100}], x] (* Wesley Ivan Hurt, Aug 20 2014 *)
    LinearRecurrence[{0, 0, 0, 0, 0, 1},{0, 0, 1, 1, 1, 2},105] (* Ray Chandler, Aug 26 2015 *)
  • PARI
    a(n)=[0,0,1,1,1,2][n%6+1]; \\ Joerg Arndt, Aug 25 2014

Formula

a(n) = 5/6 - cos(Pi*n/3)/3 - sin(Pi*n/3)/sqrt(3) - cos(2*Pi*n/3)/3 - sin(2*Pi*n/3)/sqrt(3) - (-1)^n/6. - R. J. Mathar, Oct 08 2011
G.f.: (x^2+x^3+x^4+2*x^5)/(1-x^6); a(n) = abs( mod(1-n,3) - mod(1+n,2) ). - Wesley Ivan Hurt, Aug 20 2014
a(n) = a(n-6) for n>5. - Wesley Ivan Hurt, Jun 20 2016

A373226 Number of points in a diagonal Vicsek fractal subset of an n X n square.

Original entry on oeis.org

0, 1, 2, 5, 6, 9, 10, 13, 18, 25, 26, 29, 30, 33, 38, 45, 46, 49, 50, 53, 58, 65, 74, 85, 90, 97, 110, 125, 126, 129, 130, 133, 138, 145, 146, 149, 150, 153, 158, 165, 174, 185, 190, 197, 210, 225, 226, 229, 230, 233
Offset: 0

Views

Author

Sidharth Ghoshal, May 28 2024

Keywords

Examples

			For n=3, a(3)=5 by counting x's in the following ASCII pattern:
  x.x
  .x.
  x.x
For n=4, a(4)=6 by counting x's in the following ASCII pattern:
  x...
  .x.x
  ..x.
  .x.x
For n=5, a(5)=9 by counting x's in the following ASCII pattern:
  x...x
  .x.x.
  ..x..
  .x.x.
  x...x
Generally for odd n, one can construct a diagonal Vicsek fractal on a 3^k X 3^k matrix such that 3^k >= n: place an n X n square in the center and count the x's.
For even n, there are 4 ways to most "centrally" place an n X n square; however, due to 4-fold symmetry of the diagonal Vicsek fractal they result in the same value. In our ASCII convention above we use the top-left selection.
		

Crossrefs

Cf. A151907 (conjectured to be only the odd terms).

Programs

  • Python
    import copy
    def combine(matrix): #accepts a matrix of matrices and fuses them
        aggregate = []
        for row in matrix:
            for j in range(0,len(matrix[0][0])):
                agg_row = []
                for block in row:
                    agg_row += block[j]
                aggregate.append(agg_row)
        return aggregate
    def descend(seed, zero, source, bound): #general fractal constructor
        for i in range(0, bound):
            for q in range(0, len(source)):
                for r in range(0, len(source[q])):
                    if source[q][r] == 1:
                        source[q][r] = copy.deepcopy(seed)
                    if source[q][r] == 0:
                        source[q][r] = copy.deepcopy(zero)
            source = combine(source) #fuse it up
        return source
    def count(matrix, bound):
        counter = 0
        center_x, center_y = len(matrix)//2, len(matrix)//2
        shift_limit = bound//2
        if len(matrix)%2 == 1 and bound % 2 == 1:
            for i in range(-shift_limit, shift_limit+1):
                for j in range(-shift_limit, shift_limit+1):
                    if matrix[center_x+i][center_y+j] == 1:
                        counter += 1
        if len(matrix)%2 == 1 and bound % 2 == 0:
            for i in range(-shift_limit, shift_limit):
                for j in range(-shift_limit, shift_limit):
                    if matrix[center_x+i][center_y+j] == 1:
                        counter += 1
        return counter
    seed = [[1,0,1],[0,1,0],[1,0,1]]
    source = [[1]]
    zero = [[0,0,0],[0,0,0],[0,0,0]]
    #example with n=5
    n=5
    print(count(descend(seed,zero,source,2),5)) #this constructs a 3^2 X 3^2 matrix and counts the center 5 X 5 matrix

Formula

Conjecture: a(n) = O(n^log_3(5)). This is motivated by the log_3(5) Hausdorff dimension of the diagonal Vicsek fractal.
Conjecture: a(3n) = 5*a(n). This is motivated by the recursive construction of the diagonal Vicsek fractal.
Conjecture: a(2n+1) = A151907(n)
Showing 1-8 of 8 results.