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

A329355 The binary expansion of a(n) is the second through n-th terms of A000002 - 1.

Original entry on oeis.org

0, 1, 3, 6, 12, 25, 50, 101, 203, 406, 813, 1627, 3254, 6508, 13017, 26034, 52068, 104137, 208275, 416550, 833101, 1666202, 3332404, 6664809, 13329618, 26659237, 53318475, 106636950, 213273900, 426547801, 853095602, 1706191204, 3412382409, 6824764818
Offset: 1

Views

Author

Gus Wiseman, Nov 12 2019

Keywords

Examples

			a(11) = 813 has binary expansion q = {1, 1, 0, 0, 1, 0, 1, 1, 0, 1}, and q + 1 is {2, 2, 1, 1, 2, 1, 2, 2, 1, 2}, which is the second through 11th terms of A000002.
		

Crossrefs

Replacing "A000002 - 1" with "2 - A000002" gives A329356.
Partial sums of A000002 are A054353.
Initial subsequences of A000002 are A329360.

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]-1,2],{n,30}]

A329356 The binary expansion of a(n) is the first n terms of 2 - A000002.

Original entry on oeis.org

0, 1, 2, 4, 9, 19, 38, 77, 154, 308, 617, 1234, 2468, 4937, 9875, 19750, 39501, 79003, 158006, 316012, 632025, 1264050, 2528101, 5056203, 10112406, 20224813, 40449626, 80899252, 161798505, 323597011, 647194022, 1294388045, 2588776091, 5177552182, 10355104365
Offset: 0

Views

Author

Gus Wiseman, Nov 12 2019

Keywords

Examples

			a(7) = 77 has binary expansion q = {1, 0, 0, 1, 1, 0, 1}, and 2 - q is {1, 2, 2, 1, 1, 2, 1}, which is the first 7 terms of A000002.
		

Crossrefs

Replacing "2 - A000002" with "A000002 - 1" gives A329355.
Initial subsequences of A000002 are A329360.

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[2-kol[n],2],{n,0,30}]

Formula

a(n) = floor((1-c/2)*2^n), where c = A118270 is the Kolakoski constant. - Lorenzo Sauras Altuzarra, Jan 01 2023

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).
Showing 1-3 of 3 results.