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

A329360 The decimal expansion of a(n) is the first n terms of A000002.

Original entry on oeis.org

0, 1, 12, 122, 1221, 12211, 122112, 1221121, 12211212, 122112122, 1221121221, 12211212212, 122112122122, 1221121221221, 12211212212211, 122112122122112, 1221121221221121, 12211212212211211, 122112122122112112, 1221121221221121122, 12211212212211211221
Offset: 0

Views

Author

Gus Wiseman, Nov 12 2019

Keywords

Crossrefs

Programs

  • Mathematica
    kolagrow[q_]:=If[Length[q]<2,Take[{1,2},Length[q]+1],Append[q,Switch[{q[[Length[Split[q]]]],q[[-2]],Last[q]},{1,1,1},0,{1,1,2},1,{1,2,1},2,{1,2,2},0,{2,1,1},2,{2,1,2},2,{2,2,1},1,{2,2,2},1]]]
    kol[n_Integer]:=If[n==0,{},Nest[kolagrow,{1},n-1]];
    Table[FromDigits[kol[n]],{n,0,30}]

A329361 a(n) = Sum_{i = 1..n} 2^(n - i) * A000002(i).

Original entry on oeis.org

0, 1, 4, 10, 21, 43, 88, 177, 356, 714, 1429, 2860, 5722, 11445, 22891, 45784, 91569, 183139, 366280, 732562, 1465125, 2930252, 5860505, 11721011, 23442024, 46884049, 93768100, 187536202, 375072405, 750144811, 1500289624, 3000579249, 6001158499, 12002317000
Offset: 0

Views

Author

Gus Wiseman, Nov 12 2019

Keywords

Examples

			The first 5 terms of A000002 are {1, 2, 2, 1, 1}, so a(5) = 2^4 * 1 + 2^3 * 2 + 2^2 * 2 + 2^1 * 1 + 2^0 * 1 = 43.
		

Crossrefs

Programs

  • Mathematica
    kolagrow[q_]:=If[Length[q]<2,Take[{1,2},Length[q]+1],Append[q,Switch[{q[[Length[Split[q]]]],q[[-2]],Last[q]},{1,1,1},0,{1,1,2},1,{1,2,1},2,{1,2,2},0,{2,1,1},2,{2,1,2},2,{2,2,1},1,{2,2,2},1]]]
    kol[n_Integer]:=If[n==0,{},Nest[kolagrow,{1},n-1]];
    Table[FromDigits[kol[n],2],{n,0,30}]

Formula

a(n + 1) = A000002(n) + 2 a(n).

A333229 First sums of the Kolakoski sequence A000002.

Original entry on oeis.org

3, 4, 3, 2, 3, 3, 3, 4, 3, 3, 4, 3, 2, 3, 3, 2, 3, 4, 3, 3, 3, 2, 3, 3, 3, 4, 3, 2, 3, 3, 2, 3, 3, 3, 4, 3, 3, 4, 3, 2, 3, 3, 3, 4, 3, 3, 3, 2, 3, 3, 2, 3, 4, 3, 3, 4, 3, 2, 3, 3, 3, 4, 3, 3, 4, 3, 2, 3, 3, 2, 3, 3, 3, 4, 3, 3, 3, 2, 3, 4, 3, 3, 4, 3, 2, 3, 3
Offset: 1

Views

Author

Gus Wiseman, Mar 18 2020

Keywords

Crossrefs

Positions of 3's are A054353.
Positions of 2's are A074262.
Positions of 4's are A074263.
The number of runs in the first n terms of A000002 is A156253(n).
Even-indexed terms are A332273 (without the first term).
Odd-indexed terms are A332875.

Programs

  • Mathematica
    kolagrow[q_]:=If[Length[q]<2,Take[{1,2},Length[q]+1],Append[q,Switch[{q[[Length[Split[q]]]],q[[-2]],Last[q]},{1,1,1},0,{1,1,2},1,{1,2,1},2,{1,2,2},0,{2,1,1},2,{2,1,2},2,{2,2,1},1,{2,2,2},1]]]
    kol[n_Integer]:=Nest[kolagrow,{1},n-1];
    Table[kol[n][[-1]]+kol[n+1][[-1]],{n,30}]

Formula

a(n) = A000002(n) + A000002(n + 1).

A329758 Number of n-th generation nodes of a rooted binary tree whose m-th node has exactly A000002(m) descendants, where A000002 is the Kolakoski sequence.

Original entry on oeis.org

1, 1, 2, 3, 4, 7, 10, 15, 22, 34, 51, 76, 114, 171, 257, 385, 575, 862, 1295, 1941, 2916, 4374, 6558, 9840, 14766, 22151, 33236, 49864, 74775, 112144, 168198, 252313, 378489, 567747, 851649, 1277446, 1916182, 2874172, 4311325, 6466984, 9700248, 14550387, 21825590
Offset: 1

Views

Author

Jakub Zaborowski, Nov 20 2019

Keywords

Crossrefs

Programs

  • Python
    def A329758():
       x = 1
       g = A000002()
       while True:
           yield x
           acc = 0
           for i in range(0, x):
               acc = acc + next(g)
           x = acc # Jack W Grahl, May 04 2020

Formula

a(n) = A054353(a(1) + ... + a(n-1)) - A054353(a(1) + ... + a(n-2)) for n > 2.
a(n) = A054352(n-1) - A054352(n-2). - A.H.M. Smeets, Apr 08 2024

Extensions

More terms from Jack W Grahl, May 04 2020

A229785 Partial sums of A157129.

Original entry on oeis.org

1, 2, 4, 6, 7, 8, 9, 10, 12, 14, 16, 18, 19, 20, 22, 24, 25, 26, 28, 30, 31, 32, 33, 34, 36, 38, 40, 42, 43, 44, 45, 46, 48, 50, 52, 54, 55, 56, 58, 60, 61, 62, 63, 64, 66, 68, 70, 72, 73, 74, 76, 78, 79, 80, 81, 82, 84, 86, 88, 90, 91, 92, 94, 96, 97, 98, 100, 102, 103, 104
Offset: 1

Views

Author

Benoit Cloitre, Sep 29 2013

Keywords

Comments

Although the behavior of the partial sums of the Kolakoski sequence (A054353) is mysterious, this sequence is much easier to handle.

Crossrefs

Formula

a(n)=(3/2)n+O(1). More precisely, let b(n)=3*n-2*a(n); then b(n) satisfies the following recurrence modulo 12: b(n)=1,2,1,0,1,2,3,4,3,2,1 for n=1,2,3,4,5,6,7,8,9,10,11. Then for k>=1 we have b(12k)=b(4k), b(12k+1)=b(4k+1), b(12k+2)=b(4k+2), b(12k+2)=b(4k+2), b(12k+3)=b(4k+2)-1, b(12k+4)=b(4k+2)-2, b(12k+5)=b(4k+2)-1, b(12k+6)=b(4k+2), b(12k+7)=4-b(4k+3), b(12k+8)=4-b(4k+4), b(12k+9)=4-b(4k+3), b(12k+10)=4-b(4k+2), b(12k+11)=b(4k+3).

A216348 Numbers that appear in either both A156242(n) + 1 and A156243(n) or both A156242(n) and A156243(n) + 1.

Original entry on oeis.org

6, 7, 10, 15, 20, 21, 24, 25, 30, 33, 34, 37, 42, 43, 46, 47, 50, 55, 60, 61, 64, 69, 72, 73, 76, 77, 82, 87, 88, 91, 96, 101, 102, 105, 106, 109, 114, 117, 118, 123, 128, 129, 132, 137, 142, 143, 146, 147
Offset: 1

Views

Author

Jon Perry, Sep 04 2012

Keywords

Examples

			6 is in both A156242 and A156243 + 1.
7 is in both A156242 + 1 and A156243.
		

Crossrefs

Programs

  • Mathematica
    n = 10; t = Prepend[Nest[Flatten[Partition[#, 2] /. {{2, 2} -> {2, 2, 1, 1}, {2, 1} -> {2, 2, 1}, {1, 2} -> {2, 1, 1}, {1, 1} -> {2, 1}}] &, {2, 2}, n], 1]; t2 = Accumulate[t]; {t3, t4} = Transpose[Partition[t2, 2]]; Union[Intersection[t3, t4 + 1], Intersection[t3 + 1, t4]] (* T. D. Noe, Sep 26 2012 *)

A289324 Number of twos minus number of ones in the first 10^n entries of the Kolakoski sequence, A000002.

Original entry on oeis.org

-1, 0, 2, -4, 8, 56, 28, -92, -1350, -2446, 4658, -3174, -101402, -16318, -632474, -1954842, 10724544, 45041304, 111069790, 548593100, 1818298480
Offset: 0

Views

Author

Richard P. Brent, Jul 07 2017

Keywords

Comments

This is equivalent to A195206, since a(n) = (#twos)-(#ones) = 10^n-2*(#ones) in the first 10^n entries of A000002.
For example, a(2) = 51 - 49 = (100 - 49) - 49 = 100 - 2*49 = 2 because there are 49 ones and 51 twos in the first 100 = 10^2 entries of A000002.
The entries in this sequence appear to be of order 10^(n/2), whereas the entries in A195206 are larger (of order 10^n).
This sequence is analogous to A289323; the difference is that the indices are powers of ten instead of powers of two.

Examples

			The first 10 entries in the Kolakoski sequence, A000002, are 1221121221. There are 5 ones and 5 twos, so a(1) = 5 - 5 = 0.
The first 100=10^2 entries in the Kolakoski sequence A000002 include 49 ones and 51 twos, so a(2) = 51 - 49 = 2.
		

References

Crossrefs

Formula

a(n) = 10^n - 2*A195206(n).

Extensions

Additional (20th) term from Richard P. Brent, Mar 01 2018
Previous Showing 31-37 of 37 results.