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 21-30 of 37 results. Next

A013948 Positions of 2's in Kolakoski sequence (A000002).

Original entry on oeis.org

2, 3, 6, 8, 9, 11, 12, 15, 18, 19, 21, 24, 26, 27, 30, 33, 35, 36, 38, 39, 42, 44, 45, 47, 50, 53, 54, 56, 57, 60, 62, 63, 65, 66, 69, 72, 74, 75, 77, 80, 81, 83, 84, 87, 89, 90, 92, 93, 96, 99, 100, 102, 105, 107, 108, 110, 111, 114, 117, 119, 120, 123, 126, 127, 129, 132, 135
Offset: 1

Views

Author

Keywords

Crossrefs

Complement: A013947.

Formula

Numbers n such that A078649(A054353(n-1)-n+2)-A054353(n-1)=1. [Benoit Cloitre, Feb 08 2009]
Least k such that A054353(k)>=A078649(n). a(n)=A078649(n)-n+1. [Benoit Cloitre, Feb 07 2009]

A216345 Position of the beginning of the n-th run in A000002.

Original entry on oeis.org

1, 2, 4, 6, 7, 8, 10, 11, 13, 15, 16, 18, 20, 21, 22, 24, 25, 26, 28, 30, 31, 33, 34, 35, 37, 38, 40, 42, 43, 44, 46, 47, 48, 50, 51, 53, 55, 56, 58, 60, 61, 62, 64, 65, 67, 69, 70, 72, 73, 74, 76, 77, 78, 80, 82, 83, 85, 87, 88, 89, 91, 92, 94, 96, 97, 99, 101, 102, 103
Offset: 1

Views

Author

Jon Perry, Sep 04 2012

Keywords

Comments

If n is odd then the run is 1's, otherwise it's 2's.

Examples

			Kolakoski sequence starts 1221121 so we can see that this sequence begins 1,2,4,6,7.
		

Crossrefs

Programs

  • Haskell
    a216345 n = a216345_list !! (n-1)
    a216345_list = 1 : (filter (\x -> a000002 x /= a000002 (x - 1)) [2..])
    -- Reinhard Zumkeller, Aug 03 2013
  • JavaScript
    a=new Array();
    a[1]=1;  a[2]=2;  a[3]=2;
    cd=1;  ap=3;
    for (i=4; i<50; i++)
    {
        if (a[ap]==1) a[i]=cd;
        else {a[i]=cd; a[i+1]=cd; i++}
        ap++;
        cd=3-cd;
    }
    /* document.write(a); document.write("
    "); */ b=new Array(); b[1]=1; c=2; for (i=2; i<50; i++) if (a[i]!=a[i-1]) b[c++]=i; document.write(b);

Formula

{n: A156728(n-1)=1}. - R. J. Mathar, Sep 14 2012
a(n+1) = A054353(n)+1 = a(n) + A000002(n). - Jean-Christophe Hervé, Oct 05 2014

A001083 Length of one version of Kolakoski sequence {A000002(i)} at n-th growth stage.

Original entry on oeis.org

1, 2, 2, 3, 5, 7, 10, 15, 23, 34, 50, 75, 113, 170, 255, 382, 574, 863, 1293, 1937, 2903, 4353, 6526, 9789, 14688, 22029, 33051, 49577, 74379, 111580, 167388, 251090, 376631, 564932, 847376, 1271059, 1906628, 2859984
Offset: 1

Views

Author

Keywords

Examples

			/* generate sequence of sequences by recursion using next1() ( origin 1 ) */
v=[2]; for(n=1,8,p1(v); print1(" -> "); v=next1(v))
2 -> 11 -> 12 -> 122 -> 12211 -> 1221121 -> 1221121221 -> 122112122122112 ->
v=[2]; for(n=1,8,print1(length(v)); print1(","); v=next1(v)) gives: 1,2,2,3,5,7,10,15,
		

Crossrefs

Programs

  • PARI
    /* generate sequence starting at 1 given run length sequence */
    next1(v)=local(w); w=[]; for(n=1,length(v), for(i=1,v[n],w=concat(w,2-n%2))); w
    /* print a number or sequence recursively with no commas */
    p1(v)=if(type(v)!="t_VEC",print1(v), for(n=1,length(v),p1(v[n])))

Formula

Conjecture: a(n) is asymptotic to c*(3/2)^n where c=0.5819.... - Benoit Cloitre, Jun 01 2004
For n >= 1, a(n+3) = S^n(2) where S(n) = A054353(n) and S^k(2) = S(S^(k-1)(2)). - Benoit Cloitre, Feb 24 2009 [adjusted to match sequence offset by Jon Maiga, Jul 27 2022]
Equivalently, a(n) = A054353(a(n-1)) for n>3. - Jon Maiga, Jul 10 2022

Extensions

Corrected by and better description from Michael Somos, May 05 2000

A074272 Partial alternating sums of the Kolakoski sequence A000002.

Original entry on oeis.org

1, -1, 1, 0, 1, -1, 0, -2, 0, -1, 1, -1, 0, -1, 1, 0, 1, -1, 1, 0, 2, 1, 2, 0, 1, -1, 1, 0, 1, -1, 0, -1, 1, 0, 2, 0, 1, -1, 1, 0, 1, -1, 0, -2, 0, -1, 1, 0, 1, -1, 0, -1, 1, -1, 0, -2, 0, -1, 0, -2, -1, -3, -1, -2, 0, -2, -1, -2, 0, -1, 0, -2, -1, -3, -1, -2, 0
Offset: 1

Views

Author

Jon Perry, Sep 21 2002

Keywords

Examples

			Kolakoski: 1,2,2,1,1,2,1,2,2,1,2,2,1,1,... We look at 1-2+2-1+1-2+1-2+2 and this gives 1,-1,1,0,1,-1,0,-2,0
		

Crossrefs

Cf. A054353.

A249942 Ranks of single 1's in the Kolakoski sequence A000002.

Original entry on oeis.org

7, 10, 20, 25, 34, 37, 43, 46, 55, 61, 64, 73, 76, 82, 88, 91, 101, 106, 109, 118, 128, 137, 143, 146, 152, 155, 164, 170, 173, 182, 187, 196, 199, 205, 211, 214, 223, 233, 236, 241, 251, 260, 263, 268, 277, 280, 286, 289, 298, 301, 307, 313, 316, 326, 331, 334
Offset: 1

Views

Author

Jean-Christophe Hervé, Nov 08 2014

Keywords

Comments

The single 1's whose ranks are given by this sequence are the 1's between two 2's in the OK sequence A000002. They are associated with iterated words of the OK sequence that develop themselves around each single 1 in two branches (for a description of the iterated words, see comments in A249507, which gives their lengths). The first term of A000002, which is indeed a single 1 but not between two 2's, is thus not considered here.
Each such single 1 is generated by a preceding 1 in the OK sequence that could be single or double, but each single 1 has a double 1 in its ancestors since the first 1 of the OK sequence has no descendants except itself. The length of the iterated word around a single 1 is linked to the number of generations between itself and its nearest double 1 ancestor (A249949 gives the number of generations of the n-th single 1).
A249948 gives the gaps between single 1's.

Crossrefs

Formula

a = {A054353(2k+1), k>1 and A000002(2k+1) = 1}.
Odd values of A216345: A216345(2k+1), k>0, such that A216345(2k+2) =
A216345(2k+1)+1.

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

Original entry on oeis.org

-1, 0, 0, 0, 0, -2, 0, 0, -2, 0, -2, 0, -6, 6, 0, 6, 44, 26, -20, -48, 52, 58, 104, -82, -250, -270, -474, -1864, -3094, -4588, -2534, -7574, -1522, 1818, 9264, 18082, 8898, -30500, -20586, -3232, -90522, -127446, -231384, -83574, -87364, 267886
Offset: 0

Views

Author

Richard P. Brent, Jul 05 2017

Keywords

Comments

This is equivalent to A289322, since a(n) = (#twos)-(#ones) = 2^n-2*(#ones) in the first 2^n entries of A000002.
For example, a(5)=15-17=(32-17)-17=32-2*17=-2 because there are 15 twos and 17 ones in the first 32=2^5 entries of A000002.
The entries in this sequence appear to be of order 2^(n/2), whereas the entries in A289322 are larger (of order 2^n).

Examples

			The first 32 entries of the Kolakoski sequence, A000002, are 12211212212211211221211212211211. From this we see that a(5)=15-17=-2, since among the first 2^5 letters, 15 of them are twos and 17 of them are ones.
		

References

Crossrefs

Formula

a(n) = 2^n - 2*A289322(n) = -A088568(2^n) = 2*A054353(2^n) - 3*2^n = 2^n - 2*A156077(2^n).

A074288 n-th term of the Kolakoski sequence (A000002) multiplied by the n-th partial sum.

Original entry on oeis.org

1, 6, 10, 6, 7, 18, 10, 24, 28, 15, 34, 38, 20, 21, 46, 24, 25, 54, 58, 30, 64, 33, 34, 72, 37, 78, 82, 42, 43, 90, 46, 47, 98, 50, 104, 108, 55, 114, 118, 60, 61, 126, 64, 132, 136, 69, 142, 72, 73, 150, 76, 77, 158, 162, 82, 168, 172, 87, 88, 180, 91, 186
Offset: 1

Views

Author

Jon Perry, Sep 21 2002

Keywords

Examples

			The Kolakoski sequence begins 1,2,2,1,1,2,...  and its sequence of partial sums (A054353) begins 1,3,5,6,7,9,... Therefore the opening terms are 1,6,10,6,7,18.
		

Crossrefs

Extensions

Edited and offset corrected by Nathaniel Johnston, May 02 2011

A156351 a(n) = Sum_{k=1..n} (-1)^K(k+1)*(K(k+1)-K(k)) where K(k) = A000002(k).

Original entry on oeis.org

1, 1, 2, 2, 3, 4, 5, 5, 6, 7, 7, 8, 8, 9, 10, 10, 11, 11, 12, 13, 14, 14, 15, 16, 17, 17, 18, 18, 19, 20, 20, 21, 22, 23, 23, 24, 25, 25, 26, 26, 27, 28, 29, 29, 30, 31, 32, 32, 33, 34, 34, 35, 35, 36, 37, 37, 38, 38, 39, 40, 41, 41, 42, 43, 43, 44, 44, 45, 46, 46, 47, 48, 49, 49
Offset: 1

Views

Author

Benoit Cloitre, Feb 08 2009

Keywords

Comments

a(n)=1 plus the number of symbol changes in the first n terms of A078880. - Jean-Marc Fedou and Gabriele Fici, Mar 18 2010

Crossrefs

Partial sums of A156728.

Programs

  • Mathematica
    a2 = {1, 2, 2}; Do[ a2 = Join[a2, {1 + Mod[n - 1, 2]}], {n, 3, 80}, {i, 1, a2[[n]]}]; a[n_] := Sum[(-1)^a2[[k + 1]]*(a2[[k + 1]] - a2[[k]]), {k, 1, n}]; Table[a[n], {n, 1, 80}] (* Jean-François Alcover, Jun 18 2013 *)

Formula

n - A054353(a(n)) = 1 if n is in A078649, n - A054353(a(n)) = 0 otherwise. A078649(n + 1 - a(n)) - n takes values among {0,1,2,3}.
a(n) = gcd(a(a(n-1)),2) + a(n-2) (conjectured). - Jon Maiga, Dec 07 2021

A289322 Number of 1s in the first 2^n entries of the Kolakoski sequence, A000002.

Original entry on oeis.org

1, 1, 2, 4, 8, 17, 32, 64, 129, 256, 513, 1024, 2051, 4093, 8192, 16381, 32746, 65523, 131082, 262168, 524262, 1048547, 2097100, 4194345, 8388733, 16777351, 33554669, 67109796, 134219275, 268437750, 536872179
Offset: 0

Views

Author

Richard P. Brent, Jul 05 2017

Keywords

Examples

			The first 32 entries of the Kolakoski sequence, A000002, are 12211212212211211221211212211211. From this we see that a(5)=17, since among the first 2^5 letters, 17 of them are 1s.
		

Crossrefs

Cf. A000002. Analogous for powers of ten is A195206. Equivalent but with smaller entries is A289323. Closely related are A054353, A074286, A088568, A156077.

Formula

a(n) = (2^n + A088568(2^n))/2 = (2^n - A289323(n))/2.

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}]
Previous Showing 21-30 of 37 results. Next