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 41-50 of 297 results. Next

A074264 Values of Kolakoski sequence A000002 at positions n = 0 mod 3.

Original entry on oeis.org

2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
Offset: 1

Views

Author

Jon Perry, Sep 20 2002

Keywords

Examples

			The Kolakoski sequence (A000002) begins 1,2,2,1,1,2,1,2,2,1,2,2... At n=3,6,9,12, A000002(n) is 2,2,2,2
		

Crossrefs

Extensions

Corrected offset from Nathaniel Johnston, May 02 2011

A195206 Number of 1s in the first 10^n entries of the Kolakoski sequence, A000002.

Original entry on oeis.org

1, 5, 49, 502, 4996, 49972, 499986, 5000046, 50000675, 500001223, 4999997671, 50000001587, 500000050701, 5000000008159, 50000000316237, 500000000977421, 4999999994637728, 49999999977479348, 499999999944465105, 4999999999725703450, 49999999999090850760
Offset: 0

Views

Author

Johan Nilsson, Sep 13 2011

Keywords

Examples

			The first entries of the Kolakoski sequence, A000002, are 1221121221... From this we see that a(0)=1, since the first letter is 1, and a(1)=5 since among the first 10 letters 5 of them are 1s.
		

Crossrefs

Cf. A000002.

Extensions

a(14) from Ed Wynn, Jun 24 2014
a(15)-a(19) from Richard P. Brent, Jul 02 2017
a(20) from Richard P. Brent, Mar 01 2018

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.

A074293 Dominant (i.e., most populous) digit in Kolakoski sequence (A000002) when partitioned into groups of 5.

Original entry on oeis.org

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

Views

Author

Jon Perry, Sep 21 2002

Keywords

Examples

			The Kolakoski sequence begins (1,2,2,1,1), (2,1,2,2,1), (2,2,1,1,2), (1,1,2,2,1), hence sequence begins 1,2,2,1.
		

Crossrefs

Programs

  • Maple
    lim:=400: s:=[1,2,2]: for n from 3 to lim do for i from 1 to s[n] do s:=[op(s),1+((n-1)mod 2)]: od: od: lim2:=floor(nops(s)/5)-1: for n from 0 to lim2 do if(s[5*n+1]+s[5*n+2]+s[5*n+3]+s[5*n+4]+s[5*n+5]<=7)then printf("1, "): else printf("2, "): fi: od: # Nathaniel Johnston, May 01 2011

A074298 First occurrence of an 'average' valued sequence of length 2n in the Kolakoski sequence (A000002).

Original entry on oeis.org

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

Views

Author

Jon Perry, Sep 21 2002

Keywords

Comments

a(n) is the least k such that K(k) + K(k+1) + ... + K(k + 2*n - 1) = 3*n, where K(m) = A000002(m).

Examples

			a[1]=1, as A000002 begins 1,2 (sum 3) a[2]=1, as A000002 begins 1,2,2,1 (sum 6) a[3]=1, as A000002 begins 1,2,2,1,1,2 (sum 9).
		

Crossrefs

Programs

  • Mathematica
    nmax = 90; a2 = {1, 2, 2}; For[n = 3, n <= 2*nmax, n++, For[i = 1, i <= a2[[n]], i++, AppendTo[a2, 1 + Mod[n - 1, 2]]]]; a[n_] := For[k = 1, True, k++, If[Plus @@ a2[[k ;; k + 2*n - 1]] == 3*n, Return[k]]]; Table[a[n], {n, 1, nmax}] (* Jean-François Alcover, Sep 25 2012 *)

Extensions

Offset corrected by Nathaniel Johnston, May 02 2011

A156257 Digit of runs of length 2 in the Kolakoski sequence A000002: a(n) = A000002(A078649(n)).

Original entry on oeis.org

2, 1, 2, 2, 1, 1, 2, 1, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 1, 2, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 2, 2, 1, 2
Offset: 1

Views

Author

Benoit Cloitre, Feb 07 2009

Keywords

Comments

Often equal to A074292 (at the beginning), but not always (see comments in A074292). First differences between the two sequences are at n = 47, 48, 56, 57, 128, 129, 137, 139, 147, 148,176, 177,... (see A248345 = A156257 - A074292). - Jean-Christophe Hervé, Oct 11 2014
As in the Kolakoski sequence, runs in this sequence are of length 1 or 2: a run XX in this sequence implies YXXYX in OK for the first X, and this cannot be continued by a single Y (because XYXYX is not possible), thus we have YXXYXXY, which can be continued by YXXYXXYY or by YXXYXXYXYY, but not by YXXYXXYXX (because this would imply an impossible 21212 in OK). However, words of the form YXYXY appear in this sequence, but they don't in A000002. - Jean-Christophe Hervé, Oct 12 2014
Applying Lenormand's "raboter" transformation (see A318921) to A000002 leads to this sequence. - Rémy Sigrist, Nov 11 2020

Examples

			Kolakoski sequence begins (1),(2,2),(1,1),(2),(1),(2,2),(1),(2,2), so this one begins 2,1,2,2.
		

Crossrefs

Programs

Formula

a(n) = A000002(A078649(n)) = A000002(A078649(n)+1).
Strictly positive terms of (A000002(n)-1)*(mod(n-1, 2)+1). - Jean-Christophe Hervé, Oct 11 2014
Strictly positive terms of (1-abs(A000002(n+1)-A000002(n)))*A000002(n). - Jean-Christophe Hervé, Oct 11 2014

Extensions

Definition revised by Jean-Christophe Hervé, Oct 11 2014

A157684 a(n)=#{1<=k<=n : [K(k),K(k+1)]=[1,2]} where K=A000002.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 9, 9, 9, 9, 10, 10, 10, 11, 11, 12, 12, 12, 13, 13, 13, 13, 14, 14, 15, 15, 15, 16, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 19, 19, 20, 20, 21, 21, 21, 22, 22, 22, 22, 23, 23, 23, 24, 24, 25, 25, 25, 26, 26, 26, 27
Offset: 1

Views

Author

Benoit Cloitre, Mar 04 2009

Keywords

Comments

Presumably a(n)=n/3+o(n)

Crossrefs

Programs

Formula

a(n)=sum(k=1,n,(K(k+1)-1)*(K(k+1)-K(k))) where K(k)=A000002(k).

A171899 Backwards van Eck transform of A000002.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Oct 22 2010

Keywords

Comments

Given a sequence a, the backwards van Eck transform b is defined as follows: If a(n) has already appeared in a, let a(m) be the most recent occurrence, and set b(n)=n-m; otherwise b(n)=0.
The forwards van Eck transform of A000002 is A078929.

Crossrefs

Programs

  • Maple
    ECKb:=proc(a) local b,i,m,n;
    if whattype(a) <> list then RETURN([]); fi:
    b:=[0];
    for n from 2 to nops(a) do
    # has a(n) appeared before?
    m:=0;
    for i from n-1 by -1 to 1 do
    if (a[i]=a[n]) then m:=n-i; break; fi
    od:
    b:=[op(b),m];
    od:
    RETURN(b);
    end:

A246145 Index sequence for limit-block extending A000002 (Kolakoski sequence) with first term as initial block.

Original entry on oeis.org

1, 4, 13, 16, 51, 78, 97, 124, 178, 247, 322, 402, 475, 578, 623, 746, 842, 1030, 1111, 1173, 1454, 1481, 2071, 2385, 2686, 4395, 5402, 5587, 5932, 6150, 6622, 6767, 7038, 7311, 7461, 10404, 10674, 12797, 18358, 20169, 20575, 21667, 23244, 25101, 26224
Offset: 1

Views

Author

Keywords

Comments

Suppose S = (s(0), s(1), s(2), ...) is an infinite sequence such that every finite block of consecutive terms occurs infinitely many times in S. (It is assumed that A000002 is such a sequence.) Let B = B(m,k) = (s(m), s(m+1),...s(m+k)) be such a block, where m >= 0 and k >= 0. Let m(1) be the least i > m such that (s(i), s(i+1),...,s(i+k)) = B(m,k), and put B(m(1),k+1) = (s(m(1)), s(m(1)+1),...s(m(1)+k+1)). Let m(2) be the least i > m(1) such that (s(i), s(i+1),...,s(i+k)) = B(m(1),k+1), and put B(m(2),k+2) = (s(m(2)), s(m(2)+1),...s(m(2)+k+2)). Continuing in this manner gives a sequence of blocks B'(n) = B(m(n),k+n), so that for n >= 0, B'(n+1) comes from B'(n) by suffixing a single term; thus the limit of B'(n) is defined; we call it the "limiting block extension of S with initial block B(m,k)", denoted by S^ in case the initial block is s(0).
The sequence (m(i)), where m(0) = 0, is the "index sequence for limit-block extending S with initial block B(m,k)", as in A246128. If the sequence S is given with offset 1, then the role played by s(0) in the above definitions is played by s(1) instead, as in the case of A246144 and A246145.
Limiting block extensions are analogous to limit-reverse sequences, S*, defined at A245920. The essential difference is that S^ is formed by extending each new block one term to the right, whereas S* is formed by extending each new block one term to the left (and then reversing).

Examples

			S = A000002, with B = (s(1)); that is, (m,k) = (1,0)
S = (1,2,2,1,1,2,1,2,2,1,2,2,1,1,2,1,1,2,2,1,2,1,...)
B'(0) = (1)
B'(1) = (1,1)
B'(2) = (1,1,2)
B'(3) = (1,1,2,2)
B'(4) = (1,1,2,2,1)
B'(5) = (1,1,2,2,1,2)
S^ = (1,1,2,2,1,2,1,1,2,1,2,2,1,1,2,1,1,...),
with index sequence (1,4,13,16,51,78,97,124,178,247,322,...)
		

Crossrefs

Programs

  • Mathematica
    seqPosition1[list_, seqtofind_] := If[Length[#] > Length[list], {}, Last[Last[Position[Partition[list, Length[#], 1], Flatten[{_, #, _}], 1, 1]]]] &[seqtofind]; n = 30; s = 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]; (* A246144 *)
    Take[s, 30]
    t = {{1}}; p[0] = seqPosition1[s, Last[t]]; s = Drop[s, p[0]]; Off[Last::nolast]; n = 1; While[(p[n] = seqPosition1[s, Last[t]]) > 0, (AppendTo[t, Take[s, {#, # + Length[Last[t]]}]]; s = Drop[s, #]) &[p[n]]; n++]; On[Last::nolast]; Last[t] (* A246144*)
    Accumulate[Table[p[k], {k, 0, n - 1}]] (*A246145*)

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.
Previous Showing 41-50 of 297 results. Next