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-7 of 7 results.

A071045 Number of 0's in n-th row of triangle in A071030.

Original entry on oeis.org

0, 0, 3, 1, 6, 2, 9, 3, 12, 4, 15, 5, 18, 6, 21, 7, 24, 8, 27, 9, 30, 10, 33, 11, 36, 12, 39, 13, 42, 14, 45, 15, 48, 16, 51, 17, 54, 18, 57, 19, 60, 20, 63, 21, 66, 22, 69, 23, 72, 24, 75, 25, 78, 26, 81, 27, 84, 28, 87, 29, 90, 30, 93, 31, 96, 32, 99, 33, 102, 34
Offset: 0

Views

Author

Hans Havermann, May 26 2002

Keywords

References

  • Stephen Wolfram, A New Kind of Science, Wolfram Media, 2002; Chapter 3.

Crossrefs

Programs

  • Maple
    a := n -> n + ((-1)^n*(2*n + 1) - 1)/4;
    seq(a(n), n=0..69); # Peter Luschny, Feb 11 2019
  • Mathematica
    LinearRecurrence[{0, 2, 0, -1}, {0, 0, 3, 1}, 70] (* Jean-François Alcover, Jul 08 2019 *)

Formula

a(n) = Sum_{k=0..n-1} Sum_{i=0..k} C(i,k) - (-1)^k. - Wesley Ivan Hurt, Sep 20 2017
a(n) = n + ((-1)^n*(2*n + 1) - 1)/4 = n - A001057(n). - Peter Luschny, Feb 11 2019
For n > 0: a(n) = (n^2 - 1) mod (2*n + 1). - Ctibor O. Zizka, Mar 11 2025

A064455 a(2n) = 3n, a(2n-1) = n.

Original entry on oeis.org

1, 3, 2, 6, 3, 9, 4, 12, 5, 15, 6, 18, 7, 21, 8, 24, 9, 27, 10, 30, 11, 33, 12, 36, 13, 39, 14, 42, 15, 45, 16, 48, 17, 51, 18, 54, 19, 57, 20, 60, 21, 63, 22, 66, 23, 69, 24, 72, 25, 75, 26, 78, 27, 81, 28, 84, 29, 87, 30, 90, 31, 93, 32, 96, 33, 99, 34, 102, 35, 105, 36, 108
Offset: 1

Views

Author

N. J. A. Sloane, Oct 02 2001

Keywords

Comments

Also number of 1's in n-th row of triangle in A071030. - Hans Havermann, May 26 2002
Number of ON cells at generation n of 1-D CA defined by Rule 54. - N. J. A. Sloane, Aug 09 2014
a(n)*A098557(n) equals the second right hand column of A167556. - Johannes W. Meijer, Nov 12 2009
Given a(1) = 1, for all n > 1, a(n) is the least positive integer not equal to a(n-1) such that the arithmetic mean of the first n terms is an integer. The sequence of arithmetic means of the first 1, 2, 3, ..., terms is 1, 2, 2, 3, 3, 4, 4, ... (A004526 disregarding its first three terms). - Rick L. Shepherd, Aug 20 2013

Examples

			a(13) = a(2*7 - 1) = 7, a(14) = a(2*7) = 21.
a(8) = 8-9+10-11+12-13+14-15+16 = 12. - _Bruno Berselli_, Jun 05 2013
		

Crossrefs

Interleaving of A000027 and A008585 (without first term).

Programs

  • ARIBAS
    maxarg := 75; for n := 1 to maxarg do if n mod 2 = 1 then write((n+1) div 2, " ") else write((n div 2)*3," "); end; end;
    
  • GAP
    a:=[];;  for n in [1..75] do if n mod 2 = 0 then Add(a,3*n/2); else Add(a,(n+1)/2); fi; od; a; # Muniru A Asiru, Oct 28 2018
    
  • Haskell
    import Data.List (transpose)
    a064455 n = n + if m == 0 then n' else - n'  where (n',m) = divMod n 2
    a064455_list = concat $ transpose [[1 ..], [3, 6 ..]]
    -- Reinhard Zumkeller, Oct 12 2013
    
  • Magma
    [(1/2)*n*(-1)^n+n+(1/4)*(1-(-1)^n): n in [1..80]]; // Vincenzo Librandi, Aug 10 2014
    
  • Maple
    A064455 := proc(n)
        if type(n,'even') then
            3*n/2 ;
        else
            (n+1)/2 ;
        end if;
    end proc: # R. J. Mathar, Aug 03 2015
  • Mathematica
    Table[ If[ EvenQ[n], 3n/2, (n + 1)/2], {n, 1, 70} ]
  • PARI
    a(n) = { if (n%2, (n + 1)/2, 3*n/2) } \\ Harry J. Smith, Sep 14 2009
    
  • PARI
    a(n)=if(n<3,2*n-1,((n-1)*(n-2))%(2*n-1)) \\ Jim Singh, Oct 14 2018
    
  • Python
    def A064455(n): return (3*n - (2*n-1)*(n%2))//2
    print([A064455(n) for n in range(1,81)]) # G. C. Greubel, Jan 30 2025

Formula

a(n) = (1/2)*n*(-1)^n + n + (1/4)*(1 - (-1)^n). - Stephen Crowley, Aug 10 2009
G.f.: x*(1+3*x) / ( (1-x)^2*(1+x)^2 ). - R. J. Mathar, Mar 30 2011
From Jaroslav Krizek, Mar 22 2011: (Start)
a(n) = n - A123684(n-1) for odd n.
a(n) = n + a(n-1) for even n.
a(n) = A123684(n) + A137501(n).
Abs( a(n) - A123684(n) ) = A052928(n). (End)
a(n) = Sum_{i=n..2*n} i*(-1)^i. - Bruno Berselli, Jun 05 2013
a(n) = n + floor(n/2)*(-1)^(n mod 2). - Bruno Berselli, Dec 14 2015
a(n) = (n^2-3*n+2) mod (2*n-1) for n>2. - Jim Singh, Oct 31 2018
E.g.f.: (1/2)*(x*cosh(x) + (1+3*x)*sinh(x)). - G. C. Greubel, Jan 30 2025

A118108 Decimal representation of n-th iteration of the Rule 54 elementary cellular automaton starting with a single black cell.

Original entry on oeis.org

1, 7, 17, 119, 273, 1911, 4369, 30583, 69905, 489335, 1118481, 7829367, 17895697, 125269879, 286331153, 2004318071, 4581298449, 32069089143, 73300775185, 513105426295, 1172812402961, 8209686820727, 18764998447377, 131354989131639, 300239975158033
Offset: 0

Views

Author

Eric W. Weisstein, Apr 13 2006

Keywords

Comments

a(1660) is 1000 digits long. - Michael De Vlieger, Oct 07 2015

Examples

			From _Michael De Vlieger_, Oct 07 2015: (Start)
First 8 rows, representing ON cells as "1", OFF cells within the bounds of ON cells as "0", interpreted as a binary number at left, the decimal equivalent appearing at right:
                    1 =     1
                  111 =     7
               1 0001 =    17
             111 0111 =   119
          1 0001 0001 =   273
        111 0111 0111 =  1911
     1 0001 0001 0001 =  4369
   111 0111 0111 0111 = 30583
1 0001 0001 0001 0001 = 69905
(End)
		

Crossrefs

See A071030, A118109 for two other versions of this sequence.

Programs

  • Mathematica
    clip[lst_] := Block[{p = Flatten@ Position[lst, 1]}, Take[lst, {Min@ p, Max@ p}]]; FromDigits[#, 2] & /@ Map[clip, CellularAutomaton[54, {{1}, 0}, 27]] (* or *)
    Table[If[EvenQ@ n, (4^(n + 2) - 1), 7 (4^(n + 1) - 1)]/15, {n, 0, 27}] (* Michael De Vlieger, Oct 07 2015 *)
  • Python
    print([(16+12*(n%2))*4**n//15 for n in range(30)]) # Karl V. Keller, Jr., Aug 04 2021

Formula

a(n) = 7*(4^(n+1)-1)/15 for n odd; a(n) = (4^(n+2)-1)/15 for n even.
From Colin Barker, Oct 08 2015 and Apr 16 2019: (Start)
a(n) = 17*a(n-2) - 16*a(n-4) for n>3.
G.f.: (7*x+1) / ((x-1)*(x+1)*(4*x-1)*(4*x+1)).
(End)
a(n) = floor((16+12*(n mod 2))*4^n/15). - Karl V. Keller, Jr., Aug 04 2021

Extensions

a(23)-a(24) from Michael De Vlieger, Oct 07 2015

A265225 Total number of ON (black) cells after n iterations of the "Rule 54" elementary cellular automaton starting with a single ON (black) cell.

Original entry on oeis.org

1, 4, 6, 12, 15, 24, 28, 40, 45, 60, 66, 84, 91, 112, 120, 144, 153, 180, 190, 220, 231, 264, 276, 312, 325, 364, 378, 420, 435, 480, 496, 544, 561, 612, 630, 684, 703, 760, 780, 840, 861, 924, 946, 1012, 1035, 1104, 1128, 1200, 1225, 1300, 1326, 1404, 1431
Offset: 0

Views

Author

Robert Price, Dec 05 2015

Keywords

Comments

Take the first 2n positive integers and choose n of them such that their sum: a) is divisible by n, and b) is minimal. It seems their sum equals a(n). - Ivan N. Ianakiev, Feb 16 2019

Examples

			From _Michael De Vlieger_, Dec 14 2015: (Start)
First 12 rows, replacing "0" with "." for better visibility of ON cells, followed by the total number of 1's per row, and the running total up to that row:
                        1                          =  1 ->  1
                      1 1 1                        =  3 ->  4
                    1 . . . 1                      =  2 ->  6
                  1 1 1 . 1 1 1                    =  6 -> 12
                1 . . . 1 . . . 1                  =  3 -> 15
              1 1 1 . 1 1 1 . 1 1 1                =  9 -> 24
            1 . . . 1 . . . 1 . . . 1              =  4 -> 28
          1 1 1 . 1 1 1 . 1 1 1 . 1 1 1            = 12 -> 40
        1 . . . 1 . . . 1 . . . 1 . . . 1          =  5 -> 45
      1 1 1 . 1 1 1 . 1 1 1 . 1 1 1 . 1 1 1        = 15 -> 60
    1 . . . 1 . . . 1 . . . 1 . . . 1 . . . 1      =  6 -> 66
  1 1 1 . 1 1 1 . 1 1 1 . 1 1 1 . 1 1 1 . 1 1 1    = 18 -> 84
1 . . . 1 . . . 1 . . . 1 . . . 1 . . . 1 . . . 1  =  7 -> 91
(End)
		

References

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

Crossrefs

Programs

  • Maple
    A265225:=n->1/4*(n+1)*(2*n-(-1)^n+5): seq(A265225(n), n=0..60); # Wesley Ivan Hurt, Dec 25 2016
  • Mathematica
    rule = 54; rows = 30; Table[Total[Take[Table[Total[Table[Take[CellularAutomaton[rule,{{1},0},rows-1,{All,All}][[k]],{rows-k+1,rows+k-1}],{k,1,rows}][[k]]],{k,1,rows}],k]],{k,1,rows}]
    Accumulate[Total /@ CellularAutomaton[54, {{1}, 0}, 52]]

Formula

Conjectures from Colin Barker, Dec 08 2015 and Apr 20 2019: (Start)
a(n) = (n+1)*(2*n -(-1)^n +5)/4.
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5) for n>4.
G.f.: (1+3*x) / ((1-x)^3*(1+x)^2).
(End)
a(n) = n + 1 + (n+1) * floor((n+1)/2), conjectured. - Wesley Ivan Hurt, Dec 25 2016
a(n) = A093353(n) + n + 1, conjectured. - Matej Veselovac, Jan 21 2020

A118109 Binary representation of n-th iteration of the Rule 54 elementary cellular automaton starting with a single black cell.

Original entry on oeis.org

1, 111, 10001, 1110111, 100010001, 11101110111, 1000100010001, 111011101110111, 10001000100010001, 1110111011101110111, 100010001000100010001, 11101110111011101110111, 1000100010001000100010001, 111011101110111011101110111, 10001000100010001000100010001, 1110111011101110111011101110111
Offset: 0

Views

Author

Eric W. Weisstein, Apr 13 2006

Keywords

Examples

			From _Michael De Vlieger_, Oct 07 2015: (Start)
First 8 rows, representing ON cells as "1", OFF cells within the bounds of ON cells as "0", interpreted as a binary number at left, the decimal equivalent appearing at right (A118108):
                   1 =     1
                 111 =     7
              1 0001 =    17
            111 0111 =   119
         1 0001 0001 =   273
       111 0111 0111 =  1911
    1 0001 0001 0001 =  4369
  111 0111 0111 0111 = 30583
10001 0001 0001 0001 = 69905
(End)
		

Crossrefs

Cf. A071030 (essentially the same but lists bits separately), A118108 (converted to base 10).

Programs

  • Mathematica
    rule=54; 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 *)

Formula

Conjectures from Colin Barker, Dec 08 2015 and Apr 16 2019: (Start)
a(n) = 10001*a(n-2)-10000*a(n-4) for n>3.
G.f.: (1+111*x) / ((1-x)*(1+x)*(1-100*x)*(1+100*x)).
(End)
Conjecture: a(n) = floor((10000+1100*(n mod 2))*100^n/9999). - Karl V. Keller, Jr., Sep 24 2021

Extensions

Terms changed to match definition, as suggested by Michael De Vlieger. - N. J. A. Sloane, Oct 17 2015

A259661 Binary representation of the middle column of the "Rule 54" elementary cellular automaton starting with a single ON (black) cell.

Original entry on oeis.org

1, 11, 110, 1100, 11001, 110011, 1100110, 11001100, 110011001, 1100110011, 11001100110, 110011001100, 1100110011001, 11001100110011, 110011001100110, 1100110011001100, 11001100110011001, 110011001100110011, 1100110011001100110, 11001100110011001100
Offset: 0

Views

Author

Robert Price, Dec 05 2015

Keywords

Examples

			From _Michael De Vlieger_, Dec 09 2015: (Start)
First 8 rows at left, ignoring "0" outside of range of 1's, the center column values in parentheses, and at right the value of center column cells up to that row:
                (1)                 -> 1
              1 (1) 1               -> 11
            1 0 (0) 0 1             -> 110
          1 1 1 (0) 1 1 1           -> 1100
        1 0 0 0 (1) 0 0 0 1         -> 11001
      1 1 1 0 1 (1) 1 0 1 1 1       -> 110011
    1 0 0 0 1 0 (0) 0 1 0 0 0 1     -> 1100110
  1 1 1 0 1 1 1 (0) 1 1 1 0 1 1 1   -> 11001100
1 0 0 0 1 0 0 0 (1) 0 0 0 1 0 0 0 1 -> 110011001
(End)
		

Crossrefs

Programs

  • Mathematica
    lim = 20; Take[Last@ Take[#, Ceiling[Length[#]/2]] & /@ CellularAutomaton[54, {{1}, 0}, lim], #] & /@ Range@ lim (* Michael De Vlieger, Dec 09 2015 *)

Formula

Conjectures from Colin Barker, Dec 08 2015 and Apr 17 2019: (Start)
a(n) = 11*a(n-1) - 11*a(n-2) + 11*a(n-3) - 10*a(n-4) for n>3.
G.f.: 1 / ((1-x)*(1-10*x)*(1+x^2)).
(End)

A204714 Maximum period of cellular automaton rule 54 in a cyclic universe of width n.

Original entry on oeis.org

1, 1, 1, 4, 1, 4, 4, 8, 27, 30, 99, 12, 169, 112, 330, 40, 289, 306, 494, 86, 399, 484, 690, 312, 1800, 624, 918, 224, 783, 780, 1240, 608, 1056, 952, 1540, 684
Offset: 1

Views

Author

Ben Branman, Jan 18 2012

Keywords

Examples

			For n=8, the initial condition 00011101 yields the evolution
00011101
10100011
01110100
10001110
11010001
00111010
01000111
11101000
00011101
Which is period 8, the maximum possible, so a(8)=8.
		

Crossrefs

Programs

  • Mathematica
    f[list_] := -Subtract @@ Flatten[Map[Position[#, #[[-1]]] &, NestWhileList[CellularAutomaton[54], list, Unequal, All], {0}]]; a[n_] := Max[Table[f[IntegerDigits[i, 2, n]], {i, 0, 2^n - 1}]]; Table[a[n], {n, 1, 10}]

Extensions

a(15)-a(36) from Lars Blomberg, Dec 24 2015
Showing 1-7 of 7 results.