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.

A118172 Duplicate of A071037.

Original entry on oeis.org

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

Views

Author

Eric W. Weisstein, Apr 13 2006

Keywords

A029578 The natural numbers interleaved with the even numbers.

Original entry on oeis.org

0, 0, 1, 2, 2, 4, 3, 6, 4, 8, 5, 10, 6, 12, 7, 14, 8, 16, 9, 18, 10, 20, 11, 22, 12, 24, 13, 26, 14, 28, 15, 30, 16, 32, 17, 34, 18, 36, 19, 38, 20, 40, 21, 42, 22, 44, 23, 46, 24, 48, 25, 50, 26, 52, 27, 54, 28, 56, 29, 58, 30, 60, 31, 62, 32, 64, 33, 66, 34, 68, 35, 70, 36, 72
Offset: 0

Views

Author

Keywords

Comments

a(n) = number of ordered, length two, compositions of n with at least one odd summand - Len Smiley, Nov 25 2001
Also number of 0's in n-th row of triangle in A071037. - Hans Havermann, May 26 2002
For n > 2: a(n) = number of odd terms in row n-2 of triangle A265705. - Reinhard Zumkeller, Dec 15 2015

Crossrefs

Cf. A065423 (at least one even summand).
Cf. A001477, A005843, A009531, A071037, A211538 (partial sums), A265705.

Programs

  • Haskell
    import Data.List (transpose)
    a029578 n =  (n - n `mod` 2) `div` (2 - n `mod` 2)
    a029578_list = concat $ transpose [a001477_list, a005843_list]
    -- Reinhard Zumkeller, Nov 27 2012
    
  • Magma
    A029578:= func< n | (n + (n-2)*(n mod 2))/2 >;
    [A029578(n): n in [0..80]]; // G. C. Greubel, Jan 22 2025
    
  • Mathematica
    With[{nn=40},Riffle[Range[0,nn],Range[0,2nn,2]]] (* or *) LinearRecurrence[ {0,2,0,-1},{0,0,1,2},80] (* Harvey P. Dale, Aug 23 2015 *)
  • PARI
    a(n)=if(n%2,n-1,n/2)
    
  • Python
    def A029578(n): return (n + (n-2)*(n%2))//2
    print([A029578(n) for n in range(81)]) # G. C. Greubel, Jan 22 2025

Formula

a(n) = (3*n - 2 - (-1)^n*(n - 2))/4.
a(n+4) = 2*a(n+2) - a(n).
G.f.: x^2*(1 + 2*x)/(1-x^2)^2.
a(n) = floor((n+1)/2) + (n is odd)*floor((n+1)/2).
a(n) = (n - n mod 2)/(2 - n mod 2). - Reinhard Zumkeller, Jul 30 2002
a(n) = floor(n/2)*binomial(2, mod(n, 2)) - Paul Barry, May 25 2003
a(2*n) = n.
a(2*n-1) = 2*n-2.
a(-n) = -A065423(n+2).
a(n) = Sum_{k=0..floor((n-2)/2)} (C(n-k-2, k) mod 2)((1+(-1)^k)/2)*2^A000120(n-2k-2). - Paul Barry, Jan 06 2005
a(n) = Sum_{k=0..n-2} gcd(n-k-1, k+1). - Paul Barry, May 03 2005
For n>6: a(n) = floor(a(n-1)*a(n-2)/a(n-3)). - Reinhard Zumkeller, Mar 06 2011
E.g.f.: (1/4)*((x+2)*exp(-x) + (3*x-2)*exp(x)). - G. C. Greubel, Jan 22 2025

Extensions

Explicated definition by Reinhard Zumkeller, Nov 27 2012
Title simplified by Sean A. Irvine, Feb 29 2020

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

Original entry on oeis.org

1, 7, 29, 115, 477, 1843, 7645, 29491, 122333, 471859, 1957341, 7549747, 31317469, 120795955, 501079517, 1932735283, 8017272285, 30923764531, 128276356573, 494780232499, 2052421705181, 7916483719987, 32838747282909, 126663739519795, 525419956526557
Offset: 0

Views

Author

Eric W. Weisstein, Apr 13 2006

Keywords

Examples

			            1;
         1, 1, 1;
      1, 1, 1, 0, 1;
   1, 1, 1, 0, 0, 1, 1;
1, 1, 1, 0, 1, 1, 1, 0, 1;
...
From _Michael De Vlieger_, Oct 08 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 1101 =     29
            111 0011 =    115
         1 1101 1101 =    477
       111 0011 0011 =   1843
    1 1101 1101 1101 =   7645
  111 0011 0011 0011 =  29491
11101 1101 1101 1101 = 122333
(End)
		

Crossrefs

Cf. A071037 (cells), A265379 (binary).

Programs

  • Mathematica
    Table[(-16 + (-4)^n - 10 (-1)^n + 55*4^n)/30, {n, 0, 24}] (* or *)
    clip[lst_] := Block[{p = Flatten@ Position[lst, 1]}, Take[lst, {Min@ p, Max@ p}]]; FromDigits[#, 2] & /@ Map[clip, CellularAutomaton[158, {{1}, 0}, 24]] (* Michael De Vlieger, Oct 08 2015 *)
  • PARI
    Vec(-(4*x^3-12*x^2-7*x-1)/((x-1)*(x+1)*(4*x-1)*(4*x+1)) + O(x^30)) \\ Colin Barker, Oct 08 2015
    
  • PARI
    vector(100, n, n--; (1/30)*(-16+(-4)^n-10*(-1)^n+55*4^n)) \\ Altug Alkan, Oct 08 2015
    
  • Python
    print([27*4**n//15 if n%2 else 28*4**n//15 for n in range(50)]) # Karl V. Keller, Jr., May 07 2022

Formula

a(n) = (1/30)*(-16+(-4)^n-10*(-1)^n+55*4^n).
From Colin Barker, Oct 08 2015: (Start)
a(n) = 17*a(n-2) - 16*a(n-4) for n>3.
G.f.: -(4*x^3-12*x^2-7*x-1) / ((x-1)*(x+1)*(4*x-1)*(4*x+1)).
(End)
a(n) = floor(28*4^n/15) for even n>=0; a(n) = floor(27*4^n/15) for odd n. - Karl V. Keller, Jr., Oct 09 2020

A265381 Decimal representation of the middle column of the "Rule 158" elementary cellular automaton starting with a single ON (black) cell.

Original entry on oeis.org

1, 3, 7, 14, 29, 59, 119, 238, 477, 955, 1911, 3822, 7645, 15291, 30583, 61166, 122333, 244667, 489335, 978670, 1957341, 3914683, 7829367, 15658734, 31317469, 62634939, 125269879, 250539758, 501079517, 1002159035, 2004318071, 4008636142, 8017272285
Offset: 0

Views

Author

Robert Price, Dec 07 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. The center column values up to that row are concatenated then converted into decimal at right:
             Rule 158                   Binary     Decimal
                (1)                 ->         1 =   1
              1 (1) 1               ->        11 =   3
            1 1 (1) 0 1             ->       111 =   7
          1 1 1 (0) 0 1 1           ->      1110 =  14
        1 1 1 0 (1) 1 1 0 1         ->     11101 =  29
      1 1 1 0 0 (1) 1 0 0 1 1       ->    111011 =  59
    1 1 1 0 1 1 (1) 0 1 1 1 0 1     ->   1110111 = 119
  1 1 1 0 0 1 1 (0) 0 1 1 0 0 1 1   ->  11101110 = 238
1 1 1 0 1 1 1 0 (1) 1 1 0 1 1 1 0 1 -> 111011101 = 477
(End)
		

Crossrefs

Cf. A071037, A265380 (binary).

Programs

  • Mathematica
    f[n_] := Block[{w = {}}, Do[AppendTo[w, Boole[Mod[k, 4] != 3]], {k, 0, n}]; FromDigits[w, 2]]; Table[f@ n, {n, 0, 32}] (* Michael De Vlieger, Dec 09 2015 *)
  • Python
    print([7*2**(n+2)//15 for n in range(34)]) # Karl V. Keller, Jr., Oct 01 2020

Formula

From Colin Barker, Dec 07 2015 and Apr 16 2019: (Start)
a(n) = (-45+5*(-1)^n-(6-i*3)*(-i)^n-(6+3*i)*i^n+7*2^(4+n))/60 where i = sqrt(-1).
a(n) = 2*a(n-1)+a(n-4)-2*a(n-5) for n>4.
G.f.: (1+x+x^2) / ((1-x)*(1+x)*(1-2*x)*(1+x^2)).
(End)
a(n) = floor(7*2^(n+2)/15) for n>=0. - Karl V. Keller, Jr., Oct 01 2020

A265379 Binary representation of the n-th iteration of the "Rule 158" elementary cellular automaton starting with a single ON (black) cell.

Original entry on oeis.org

1, 111, 11101, 1110011, 111011101, 11100110011, 1110111011101, 111001100110011, 11101110111011101, 1110011001100110011, 111011101110111011101, 11100110011001100110011, 1110111011101110111011101, 111001100110011001100110011, 11101110111011101110111011101
Offset: 0

Views

Author

Robert Price, Dec 07 2015

Keywords

Examples

			From _Michael De Vlieger_, Dec 09 2015: (Start)
First 12 rows:
                        1
                      1 1 1
                    1 1 1 0 1
                  1 1 1 0 0 1 1
                1 1 1 0 1 1 1 0 1
              1 1 1 0 0 1 1 0 0 1 1
            1 1 1 0 1 1 1 0 1 1 1 0 1
          1 1 1 0 0 1 1 0 0 1 1 0 0 1 1
        1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1
      1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1
    1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1
  1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1
1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1
(End)
		

Crossrefs

Cf. A071037 (cells), A118171 (decimal).

Programs

  • Mathematica
    rule = 158; rows = 20; Table[FromDigits[Table[Take[CellularAutomaton[rule,{{1},0}, rows-1, {All,All}][[k]], {rows-k+1, rows+k-1}], {k,1,rows}][[k]]], {k,1,rows}]
  • Python
    print([(11100 - (n%2))*100**n//9999 for n in range(30)]) # Karl V. Keller, Jr., Sep 20 2021

Formula

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

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

Original entry on oeis.org

1, 11, 111, 1110, 11101, 111011, 1110111, 11101110, 111011101, 1110111011, 11101110111, 111011101110, 1110111011101, 11101110111011, 111011101110111, 1110111011101110, 11101110111011101, 111011101110111011, 1110111011101110111, 11101110111011101110
Offset: 0

Views

Author

Robert Price, Dec 07 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 1 (1) 0 1                      -> 111
                  1 1 1 (0) 0 1 1                    -> 1110
                1 1 1 0 (1) 1 1 0 1                  -> 11101
              1 1 1 0 0 (1) 1 0 0 1 1                -> 111011
            1 1 1 0 1 1 (1) 0 1 1 1 0 1              -> 1110111
          1 1 1 0 0 1 1 (0) 0 1 1 0 0 1 1            -> 11101110
        1 1 1 0 1 1 1 0 (1) 1 1 0 1 1 1 0 1          -> 111011101
      1 1 1 0 0 1 1 0 0 (1) 1 0 0 1 1 0 0 1 1        -> 1110111011
    1 1 1 0 1 1 1 0 1 1 (1) 0 1 1 1 0 1 1 1 0 1      -> 11101110111
  1 1 1 0 0 1 1 0 0 1 1 (0) 0 1 1 0 0 1 1 0 0 1 1    -> 111011101110
1 1 1 0 1 1 1 0 1 1 1 0 (1) 1 1 0 1 1 1 0 1 1 1 0 1  -> 1110111011101
(End)
		

References

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

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{w = {}}, Do[AppendTo[w, Boole[Mod[k, 4] != 3]], {k, 0, n}]; FromDigits@ w]; Table[f@ n, {n, 0, 19}] (* Michael De Vlieger, Dec 09 2015 *)

Formula

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

Extensions

Removed an unjustified claim that Colin Barker's conjectures are correct. Removed 2 programs based on conjectures. - N. J. A. Sloane, Jun 13 2022

A071054 a(2n)=3n+1, a(2n+1)=2n+2.

Original entry on oeis.org

1, 3, 4, 5, 7, 7, 10, 9, 13, 11, 16, 13, 19, 15, 22, 17, 25, 19, 28, 21, 31, 23, 34, 25, 37, 27, 40, 29, 43, 31, 46, 33, 49, 35, 52, 37, 55, 39, 58, 41, 61, 43, 64, 45, 67, 47, 70, 49, 73, 51, 76, 53, 79, 55, 82, 57, 85, 59, 88, 61, 91, 63, 94, 65, 97, 67, 100, 69
Offset: 0

Views

Author

Hans Havermann, May 26 2002

Keywords

Comments

Number of ON cells at n-th generation of 1-D CA defined by Rule 158, starting with a single ON cell at generation 0. Equivalently, number of 1's in n-th row of triangle in A071037. - N. J. A. Sloane, Aug 10 2014

References

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

Crossrefs

Cf. A029578.

Programs

  • Mathematica
    CoefficientList[Series[(-x^3 + 2 x^2 + 3 x + 1)/(1 - x^2)^2, {x, 0, 100}], x] (* Vincenzo Librandi, Aug 11 2014 *)
    ArrayPlot[CellularAutomaton[158, {{1}, 0}, 20]] (* N. J. A. Sloane, Aug 11 2014 *)

Formula

G.f.: (-x^3+2x^2+3x+1)/(1-x^2)^2.
a(n) = (5/4)*n + 3/2 + (n/4 - 1/2)*(-1)^n. - Robert Israel, Aug 11 2014

Extensions

Simpler definition from N. J. A. Sloane, Aug 11 2014

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

Original entry on oeis.org

1, 4, 8, 13, 20, 27, 37, 46, 59, 70, 86, 99, 118, 133, 155, 172, 197, 216, 244, 265, 296, 319, 353, 378, 415, 442, 482, 511, 554, 585, 631, 664, 713, 748, 800, 837, 892, 931, 989, 1030, 1091, 1134, 1198, 1243, 1310, 1357, 1427, 1476, 1549, 1600, 1676, 1729
Offset: 0

Views

Author

Robert Price, Dec 07 2015

Keywords

Examples

			From _Michael De Vlieger_, Dec 09 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 1 . 1                      =  4 ->   8
                  1 1 1 . . 1 1                    =  5 ->  13
                1 1 1 . 1 1 1 . 1                  =  7 ->  20
              1 1 1 . . 1 1 . . 1 1                =  7 ->  27
            1 1 1 . 1 1 1 . 1 1 1 . 1              = 10 ->  37
          1 1 1 . . 1 1 . . 1 1 . . 1 1            =  9 ->  46
        1 1 1 . 1 1 1 . 1 1 1 . 1 1 1 . 1          = 13 ->  59
      1 1 1 . . 1 1 . . 1 1 . . 1 1 . . 1 1        = 11 ->  70
    1 1 1 . 1 1 1 . 1 1 1 . 1 1 1 . 1 1 1 . 1      = 16 ->  86
  1 1 1 . . 1 1 . . 1 1 . . 1 1 . . 1 1 . . 1 1    = 13 ->  99
1 1 1 . 1 1 1 . 1 1 1 . 1 1 1 . 1 1 1 . 1 1 1 . 1  = 19 -> 118
(End)
		

References

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

Crossrefs

Cf. A071037.

Programs

  • Mathematica
    rule = 158; 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[Count[#, n_ /; n == 1] & /@ CellularAutomaton[158, {{1}, 0}, 51]] (* Michael De Vlieger, Dec 09 2015 *)

Formula

Conjectures from Colin Barker, Dec 07 2015 and Apr 18 2019: (Start)
a(n) = 1/16*(10*n^2+2*(-1)^n*n+34*n-3*(-1)^n+19).
a(n) = 1/16*(10*n^2+36*n+16) for n even.
a(n) = 1/16*(10*n^2+32*n+22) for n odd.
a(n) = 2*a(n-1) - 2*a(n-2) - a(n-3) + a(n-4) for n>4.
G.f.: (1+3*x+2*x^2-x^3) / ((1-x)^3*(1+x)^2).
(End)
Showing 1-8 of 8 results.