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.

Previous Showing 11-20 of 33 results. Next

A070950 Triangle read by rows giving successive states of cellular automaton generated by "Rule 30".

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, May 19 2002

Keywords

Comments

If cell and right-hand neighbor are both 0 then new state of cell = state of left-hand neighbor; otherwise new state is complement of that of left-hand neighbor.
A simple rule which produces apparently random behavior. "... probably the single most surprising discovery I have ever made" - Stephen Wolfram.
Row n has length 2n+1.
A110240(n) = A245549(n) = value of row n, seen as binary number. - Reinhard Zumkeller, Jun 08 2013
A070952 gives number of ON cells. - N. J. A. Sloane, Jul 28 2014

Examples

			Triangle begins:
        1;
      1,1,1;
    1,1,0,0,1;
  1,1,0,1,1,1,1;
  ...
		

References

  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 27.

Crossrefs

Cf. A070951, A070952 (row sums), A051023 (central terms).
Cf. A071032 (mirror image, rule 86), A226463 (complemented, rule 135), A226464 (mirrored and complemented, rule 149).
Cf. A363343 (diagonals from the right), A363344 (diagonals from the left).
Cf. A094605 (periods of diagonals from the right), A363345 (eventual periods of diagonals from the left), A363346 (length of initial transients on diagonals from the left).
Cf. also A245549, A110240.

Programs

  • Haskell
    a070950 n k = a070950_tabf !! n !! k
    a070950_row n = a070950_tabf !! n
    a070950_tabf = iterate rule30 [1] where
       rule30 row = f ([0,0] ++ row ++ [0,0]) where
           f [,]          = []
           f (u:ws@(0:0:_)) = u : f ws
           f (u:ws)         = (1 - u) : f ws
    -- Reinhard Zumkeller, Feb 01 2013
  • Mathematica
    ArrayPlot[CellularAutomaton[30,{{1},0}, 50]] (* N. J. A. Sloane, Aug 11 2009 *)
    Clear[t, n, k]; nn = 10; t[1, k_] := t[1, k] = If[k == 3, 1, 0];
    t[n_, k_] := t[n, k] = Mod[t[-1 + n, -2 + k] + t[-1 + n, -1 + k] + (1 + t[-1 + n, -1 + k]) t[-1 + n, k], 2]; Flatten[Table[Table[t[n, k], {k, 3, 2*n + 1}], {n, 1, nn}]] (*Mats Granvik,Dec 08 2019*)

Formula

From Mats Granvik, Dec 06 2019: (Start)
The following recurrence expresses the rules in rule 30, except that instead of If, Or, And, Not, we use addition, subtraction, and multiplication.
T(n, 1) = 0
T(n, 2) = 0
T(1, 3) = 1
T(n, k) = [2*n + 1 >= k] ((1 - (T(n - 1, k - 2)*T(n - 1, k - 1)*T(n - 1, k)))*(1 - T(n - 1, k - 2)*T(n - 1, k - 1)*(1 - T(n - 1, k)))*(1 - (T(n - 1, k - 2)*(1 - T(n - 1, k - 1))*T(n - 1, k)))*(1 - ((1 - T(n - 1, k - 2))*(1 - T(n - 1, k - 1))*(1 - T(n - 1, k))))) + ((T(n - 1, k - 2)*(1 - T(n - 1, k - 1))*(1 - T(n - 1, k)))*((1 - T(n - 1, k - 2))*T(n - 1, k - 1)*T(n - 1, k))*((1 - T(n - 1, k - 2))*T(n - 1, k - 1)*(1 - T(n - 1, k)))*((1 - T(n - 1, k - 2))*(1 - T(n - 1, k - 1))*T(n - 1, k))).
Discarding the term after the plus sign, multiplying/expanding the terms out and replacing all exponents with ones, gives us this simplified recurrence:
T(n, 1) = 0
T(n, 2) = 0
T(1, 3) = 1
T(n, k) = T(-1 + n, -2 + k) + T(-1 + n, -1 + k) - 2 T(-1 + n, -2 + k) T(-1 + n, -1 + k) + (-1 + 2 T(-1 + n, -2 + k)) (-1 + T(-1 + n, -1 + k)) T(-1 + n, k).
That in turn simplifies to:
T(n, 1) = 0
T(n, 2) = 0
T(1, 3) = 1
T(n, k) = Mod(T(-1 + n, -2 + k) + T(-1 + n, -1 + k) + (1 + T(-1 + n, -1 + k)) T(-1 + n, k), 2).
(End)

Extensions

More terms from Hans Havermann, May 24 2002

A051023 Middle column of rule-30 1-D cellular automaton, from a lone 1 cell.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

A092539(n) gives the value of prefix of length n+1, seen as a binary number. - Reinhard Zumkeller, Jun 08 2013
Also middle column of rule 86 1-D cellular automaton, from a lone 1 cell, as rule 86 is the mirror image of rule 30. - Antti Karttunen, Oct 03 2019

Crossrefs

Cf. A070950, A269160 (rule 30), A071032, A269161 (rule 86).
Cf. A327974 (adjacent bits xored), A327982 (partial sums), A327983 (run lengths).
Characteristic function of A327984 (gives the positions of ones in this sequence), A327985 (positions of zeros).
Cf. also A328100, A328101, A328102 (neighbor columns).
Cf. A365254 (converted to base 10).

Programs

  • Haskell
    a051023 n = a070950 n n  -- Reinhard Zumkeller, Jun 06 2013
    
  • Mathematica
    CellularAutomaton[30, {{1}, 0}, 101, {All, {0}}]//Flatten
  • PARI
    A051023(n) = ((A110240(n)>>n)%2);
    \\ Or for fast creation of b-files:
    A051023write(up_to) = { my(s=1, n=0); for(n=0,up_to, write("b051023.txt", n, " ", ((s>>n)%2)); s = A269160(s)); }; \\ Antti Karttunen, Oct 03 2019

Formula

a(n) = A070950(n,n). - Reinhard Zumkeller, Jun 06 2013
a(n) = 1 - A226474(n). - Reinhard Zumkeller, Jun 08 2013
From Antti Karttunen, Oct 04 2019: (Start)
a(n) = A000035(floor(A110240(n) / 2^n)).
For n>= 2, a(n) = (A328100(n) OR A328101(n)) XOR A328101(1+n). ["Sideways evaluation"]
(End)

Extensions

Corrected from 64th term by Daniel B. Cristofani (cristofd(AT)hevanet.com), Jan 07 2004

A070952 Number of 1's in n-th generation of 1-D CA using Rule 30, started with a single 1.

Original entry on oeis.org

1, 3, 3, 6, 4, 9, 5, 12, 7, 12, 11, 14, 12, 19, 13, 22, 15, 19, 20, 24, 21, 23, 23, 28, 26, 27, 26, 33, 30, 34, 31, 39, 26, 39, 29, 46, 32, 44, 38, 45, 47, 41, 45, 49, 38, 55, 42, 51, 44, 53, 43, 59, 52, 60, 49, 65, 57, 60, 56, 69, 61, 70, 59, 78, 64, 56, 65, 69, 69
Offset: 0

Views

Author

N. J. A. Sloane, May 19 2002, Aug 10 2009

Keywords

Comments

Number of 1's in n-th row of triangle in A070950.
Row sums in A070950; a(n) = 2*n + 1 - A070951(n). - Reinhard Zumkeller, Jun 07 2013

Examples

			May be arranged into blocks of length 1,1,2,4,8,16,...:
1,
3,
3, 6,
4, 9, 5, 12,
7, 12, 11, 14, 12, 19, 13, 22,
15, 19, 20, 24, 21, 23, 23, 28, 26, 27, 26, 33, 30, 34, 31, 39,
26, 39, 29, 46, 32, 44, 38, 45, 47, 41, 45, 49, 38, 55, 42, 51,
    44, 53, 43, 59, 52, 60, 49, 65, 57, 60, 56, 69, 61, 70, 59, 78,
64, 56, 65, 69, 69, ...
		

Crossrefs

This sequence, A110240, and A245549 all describe the same sequence of successive states. See also A269160.
Cf. A110267 (partial sums), A246023, A246024, A246025, A246026, A246597.
A265703 is an essentially identical sequence.

Programs

  • Haskell
    a070952 = sum . a070950_row  -- Reinhard Zumkeller, Jun 07 2013
  • Mathematica
    Map[Function[Apply[Plus,Flatten[ #1]]], CellularAutomaton[30,{{1},0},100]] (* N. J. A. Sloane, Aug 10 2009 *)
    SequenceCount[s, {1,0}] + 2 SequenceCount[s, {0,0,1}] (* gives a(n) where s is the sequence for row n-1 *) (* Trevor Cappallo, May 01 2021 *)

Extensions

More terms from Hans Havermann, May 26 2002
Corrected offset and initial term - N. J. A. Sloane, Jun 07 2013

A245549 State of one-dimensional cellular automaton 'sigma' (Rule 30): 000,001,010,011,100,101,110,111 -> 0,0,0,1,1,1,1,0 at generation n, regarded as a binary number.

Original entry on oeis.org

1, 111, 11001, 1101111, 110010001, 11011110111, 1100100001001, 110111100111111, 11001000111000001, 1101111011001000111, 110010000101111011001, 11011110011010000101111
Offset: 0

Views

Author

N. J. A. Sloane, Jul 28 2014

Keywords

Comments

See A110240 for decimal equivalents. See A070952 for number of ON cells.

Crossrefs

Programs

  • Mathematica
    rule=30; rows=20; ca=CellularAutomaton[rule, {{1}, 0}, rows-1, {All, All}]; (* Start with single black cell *) catri=Table[Take[ca[[k]], {rows-k+1, rows+k-1}], {k, 1, rows}]; (* Truncated list of each row *) Table[FromDigits[catri[[k]]], {k, 1, rows}]   (* Binary Representation of Rows *)(* Robert Price, Feb 21 2016 *)

A265281 Decimal representation of the n-th iteration of the "Rule 86" elementary cellular automaton starting with a single ON (black) cell.

Original entry on oeis.org

1, 7, 19, 123, 275, 1915, 4627, 32379, 67347, 463739, 1276435, 8001147, 18245395, 124220283, 309475859, 2134808187, 4354074387, 30225757051, 82642024979, 530573137531, 1175676118803, 8199373878139, 19977819994643, 139441424012923, 286691477808915
Offset: 0

Views

Author

Robert Price, Dec 06 2015

Keywords

Comments

Iterates of A269161 starting from a(0) = 1. - Antti Karttunen, Feb 20 2016
Also, the decimal representation of the n-th generation of the "Rule 859583292" 5-neighbors elementary cellular automaton starting with a single ON (black) cell. - Philipp O. Tsvetkov, Jul 17 2019

References

  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 55.

Crossrefs

Programs

  • Mathematica
    rule = 86; rows = 30; Table[FromDigits[Table[Take[CellularAutomaton[rule,{{1},0}, rows-1, {All,All}][[k]], {rows-k+1, rows+k-1}], {k,1,rows}][[k]],2], {k,1,rows}]

Formula

From Antti Karttunen, Feb 20 2016: (Start)
a(0) = 1, for n >= 1, a(n) = A269161(a(n-1)).
a(n) = A030101(A110240(n)). [The rule 86 is the mirror image of the rule 30.]
(End)

A269162 a(0) = 0, for n > 0, a(n) = the least (necessarily also unique) k such that A269160(k) = n, or 0 if no such k exists.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 14, 13, 12, 11, 10, 0, 8, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 30, 29, 28, 27, 26, 0, 24, 23, 22, 21, 20, 0, 0, 25
Offset: 0

Views

Author

Antti Karttunen, Feb 20 2016

Keywords

Comments

If n > 0 and a(n) > 0 then a(n) is the unique finite predecessor of the configuration encoded in the binary representation of n (A007088) when Wolfram's Rule 30 cellular automaton is applied.

Crossrefs

Cf. A110240, A269160, A269163, A269164 (indices of zeros), A269165, A269166.

Programs

  • Mathematica
    (* empirical *) a[n_] := Module[{k}, For[k = Floor[n/7], k <= Ceiling[n/3], k++, If[BitXor[k, BitOr[2k, 4k]] == n, Return[k]]]; 0]; Table[a[n], {n, 0, 16387}] (* Jean-François Alcover, Feb 23 2016 *)
  • Scheme
    (define (A269162 n) (let loop ((p 0)) (cond ((= n (A269160 p)) p) ((> p n) 0) (else (loop (+ 1 p)))))) ;; Very slow implementation.
    (define (A269162 n) (if (zero? n) n (let ((nwid-2 (- (A000523 n) 2))) (let loop ((p (if (< n 4) 0 (A000079 nwid-2)))) (let ((k (A269160 p))) (cond ((= n k) p) ((> (A000523 p) nwid-2) 0) (else (loop (+ 1 p))))))))) ;; Somewhat optimized.

Formula

Other identities. For all n >= 0:
a(A269160(n)) = n. [This sequence works as a left inverse of A269160.]
a(A110240(n+1)) = A110240(n).

A327980 Distances between successive zeros in A051023, the middle column of rule-30 1-D cellular automaton, when started from a lone 1 cell.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Oct 03 2019

Keywords

Comments

First differences of A327985, which gives indices of zeros in A051023.

Examples

			The evolution of one-dimensional cellular automaton rule 30 proceeds as follows, when started from a single alive (1) cell:
   0:              (1)
   1:             1(1)1
   2:            11(0)01
   3:           110(1)111
   4:          1100(1)0001
   5:         11011(1)10111
   6:        110010(0)001001
   7:       1101111(0)0111111
   8:      11001000(1)11000001
   9:     110111101(1)001000111
  10:    1100100001(0)1111011001
  11:   11011110011(0)10000101111
  12:  110010001110(0)110011010001
When noting up the distances between successive 0's in its central column (indicated here with parentheses), we obtain 6-2 (as the first 0 is on row 2, and the second is on row 6), 7-6, 10-7, 11-10, 12-11, ..., that is, the first terms of this sequence: 4, 1, 3, 1, 1, ...
		

Crossrefs

Programs

  • Mathematica
    A327980list[upto_]:=Differences[Flatten[Position[CellularAutomaton[30,{{1},0},{upto,{{0}}}],0]]];A327980list[300] (* Paolo Xausa, Jun 01 2023 *)
  • PARI
    up_to = 105;
    A269160(n) = bitxor(n, bitor(2*n, 4*n));
    A327980list(up_to) = { my(v=vector(up_to), s=25, n=2, on=n, k=0); while(kA269160(s); if(!((s>>n)%2), k++; v[k] = (n-on); on=n)); (v); }
    v327980 = A327980list(up_to);
    A327980(n) = v327980[n];

Formula

a(n) = A327985(1+n) - A327985(n).

A327981 Distances between successive ones in A051023, the middle column of rule-30 1-D cellular automaton, when started from a lone 1 cell.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Oct 03 2019

Keywords

Comments

First differences of A327984, which gives indices of ones in A051023.

Examples

			The evolution of one-dimensional cellular automaton rule 30 proceeds as follows, when started from a single alive (1) cell:
   0:              (1)
   1:             1(1)1
   2:            11(0)01
   3:           110(1)111
   4:          1100(1)0001
   5:         11011(1)10111
   6:        110010(0)001001
   7:       1101111(0)0111111
   8:      11001000(1)11000001
   9:     110111101(1)001000111
  10:    1100100001(0)1111011001
  11:   11011110011(0)10000101111
  12:  110010001110(0)110011010001
  13: 1101111011001(1)1011100110111
The distances between successive 1's in its central column (indicated here with parentheses) are 1-0 (as the first 1 is on row 0, and the second is on row 1), 3-1, 4-3, 5-4, 8-5, 9-8, 13-9, ..., that is, the first terms of this sequence: 1, 2, 1, 1, 3, 1, 4, ...
		

Crossrefs

Programs

  • Mathematica
    A327981list[upto_]:=Differences[Flatten[Position[CellularAutomaton[30,{{1},0},{upto,{{0}}}],1]]];A327981list[300] (* Paolo Xausa, Jun 27 2023 *)
  • PARI
    up_to = 105;
    A269160(n) = bitxor(n, bitor(2*n, 4*n));
    A327981list(up_to) = { my(v=vector(up_to), s=1, n=0, on=n, k=0); while(kA269160(s); if((s>>n)%2, k++; v[k] = (n-on); on=n)); (v); }
    v327981 = A327981list(up_to);
    A327981(n) = v327981[n];

Formula

a(n) = A327984(1+n) - A327984(n).

A327984 Positions of ones in A051023, the middle column of rule-30 1-D cellular automaton, when started from a lone 1 cell.

Original entry on oeis.org

0, 1, 3, 4, 5, 8, 9, 13, 15, 16, 19, 22, 23, 24, 26, 28, 29, 30, 33, 34, 35, 37, 39, 41, 42, 47, 48, 51, 53, 55, 56, 58, 60, 62, 63, 64, 65, 66, 67, 72, 73, 74, 75, 79, 81, 83, 84, 85, 91, 94, 96, 97, 101, 102, 103, 107, 108, 110, 111, 113, 114, 116, 124, 128, 129, 130, 131, 132, 134, 135, 136, 138, 141, 142, 143, 147
Offset: 1

Views

Author

Antti Karttunen, Oct 03 2019

Keywords

Crossrefs

Cf. A051023 (characteristic function), A110240, A269160.
Cf. A327981 (first differences), A327982 (a left inverse), A327985 (complement).

Programs

Formula

For all n >= 1, A327982(a(n)) = n.

A328107 Binary weight of A327973.

Original entry on oeis.org

2, 4, 5, 6, 7, 8, 9, 13, 11, 13, 13, 14, 17, 18, 19, 23, 20, 23, 24, 27, 26, 24, 23, 30, 31, 29, 29, 31, 36, 35, 36, 37, 35, 34, 35, 42, 40, 46, 41, 50, 54, 48, 52, 47, 47, 53, 47, 51, 51, 54, 48, 51, 60, 55, 56, 64, 61, 60, 59, 68, 71, 67, 65, 78, 64, 63, 68, 72, 70, 74, 79, 89, 85, 77, 85, 76, 79, 83, 78, 90, 97, 82, 87, 81
Offset: 1

Views

Author

Antti Karttunen, Oct 05 2019

Keywords

Crossrefs

Programs

Formula

a(n) = A000120(A327973(n)) = A000120(A110240(n) XOR 2*A110240(n-1)).
Previous Showing 11-20 of 33 results. Next