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

A078649 Numbers n such that A000002(n)=A000002(n+1) where A000002 is the Kolakoski sequence.

Original entry on oeis.org

2, 4, 8, 11, 13, 16, 18, 22, 26, 28, 31, 35, 38, 40, 44, 48, 51, 53, 56, 58, 62, 65, 67, 70, 74, 78, 80, 83, 85, 89, 92, 94, 97, 99, 103, 107, 110, 112, 115, 119, 121, 124, 126, 130, 133, 135, 138, 140, 144, 148, 150, 153, 157, 160, 162, 165, 167, 171, 175, 178, 180
Offset: 1

Views

Author

Benoit Cloitre, Dec 14 2002

Keywords

Comments

Complement sequence of A054353. - Benoit Cloitre, Feb 07 2009
This sequence is the union of A074262 and A074263. - Nathaniel Johnston, May 02 2011
A054354(a(n)-1) = 0. - Reinhard Zumkeller, Aug 03 2013
This is a subsequence of A216345. In particular, this consists of A216345(i) such that A000002(i) = A216345(i+1)-A216345(i) = 2. A013948 is the sequence of all such i. - Danny Rorabaugh, Mar 13 2015

Crossrefs

Programs

  • Haskell
    a078649 n = a078649_list !! (n-1)
    a078649_list = map (+ 1) $ filter ((== 0) . a054354) [1..]
    -- Reinhard Zumkeller, Aug 03 2013
  • Maple
    isA078649 := proc(n)
        if A000002(n) = A000002(n+1) then
            true;
        else
            false;
        end if;
    end proc:
    A078649 := proc(n)
        option remember;
        if n = 1 then
            2;
        else
            for a from procname(n-1)+1 do
                if isA078649(a) then
                    return a;
                end if;
            end do:
        end if;
    end proc:
    seq(A078649(n),n=1..50) ; # R. J. Mathar, Nov 15 2014
  • Mathematica
    a2 = {1, 2, 2}; Do[ a2 = Join[a2, {1+Mod[n-1, 2]}], {n, 3, 80}, {a2[[n]]}]; a3 = Accumulate[a2]; Complement[ Range[ Last[a3]], a3] (* Jean-François Alcover, Jun 18 2013 *)

Formula

a(n) is probably asymptotic to 3*n.
a(n) = A216345(A013948(n)). - Danny Rorabaugh, Mar 13 2015

A054354 First differences of Kolakoski sequence A000002.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, May 07 2000

Keywords

Comments

The Kolakoski sequence has only 1's and 2's, and is cubefree. Thus, for all n>=1, a(n) is in {-1, 0, 1}, a(n+1) != a(n), and if a(n) = 0, a(n+1) = -a(n-1), while if a(n) != 0, either a(n+1) = 0 and a(n+2) = -a(n) or a(n+1) = -a(n). A further consequence is that the maximum gap between equal values is 4: for all n, there is an integer k, 1Jean-Christophe Hervé, Oct 05 2014
From Daniel Forgues, Jul 07 2015: (Start)
Second differences: {-1, -1, 1, 1, -2, 2, -1, -1, 2, -1, -1, 1, 1, ...}
The sequence of first differences bounces between -1 and 1 with a slope whose absolute value is either 1 or 2. We can compress the information in the second differences into {-1, 1, -2, 2, -1, 2, -1, 1, ...} since the -1 and the 1 come in pairs; which can be compressed further into {1, 1, 2, 2, 1, 2, 1, 1, ...} since the signs alternate, where we only need to know that the initial sign is negative. (End)
This appears to divide the positive integers into three sets, each with density approaching 1/3. Note there are no adjacent equal parts (as mentioned above). - Gus Wiseman, Oct 10 2024

Crossrefs

Positions of 0 are A078649.
For Golomb's sequence (A001462) we have A088517.
Positions of -1 are A156242 (descents).
Positions of 1 are A156243 (ascents).
First differences (or second differences of A000002) are A376604.
The Kolakoski sequence (A000002):
- Statistics: A074286, A088568, A156077, A156253.
- Transformations: A054354, A156728, A306323, A332273, A332875, A333229.
Cf. A333254.

Programs

  • Haskell
    a054354 n = a054354_list !! (n-1)
    a054354_list = zipWith (-) (tail a000002_list) a000002_list
    -- Reinhard Zumkeller, Aug 03 2013
  • Mathematica
    a2 = {1, 2, 2}; Do[ a2 = Join[a2, {1 + Mod[n - 1, 2]}], {n, 3, 70}, {a2[[n]]}]; Differences[a2] (* Jean-François Alcover, Jun 18 2013 *)

Formula

Abs(a(n)) = (A000002(n)+A000002(n+1)) mod 2. - Benoit Cloitre, Nov 17 2003

A376604 Second differences of the Kolakoski sequence (A000002). First differences of A054354.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Oct 02 2024

Keywords

Comments

Since A000002 has no runs of length 3, this sequence contains no zeros.
The densities appear to approach (1/3, 1/3, 1/6, 1/6).

Examples

			The Kolakoski sequence (A000002) is:
  1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 2, ...
with first differences (A054354):
  1, 0, -1, 0, 1, -1, 1, 0, -1, 1, 0, -1, 0, 1, -1, 0, 1, 0, -1, 1, -1, 0, 1, -1, ...
with first differences (A376604):
  -1, -1, 1, 1, -2, 2, -1, -1, 2, -1, -1, 1, 1, -2, 1, 1, -1, -1, 2, -2, 1, 1, -2, ...
		

Crossrefs

A001462 is Golomb's sequence.
A078649 appears to be zeros of the first and third differences.
A288605 gives positions of first appearances of each balance.
A306323 gives a 'broken' version.
A333254 lists run-lengths of differences between consecutive primes.
For the Kolakoski sequence (A000002):
- Restrictions: A074264, A100428, A100429, A156263, A156264.
- Transformations: A054354, A156728, A332273, A332875, A333229, A376604.
For second differences: A036263 (prime), A073445 (composite), A376559 (perfect-power), A376562 (non-perfect-power), A376590 (squarefree), A376593 (nonsquarefree), A376596 (prime-power), A376599 (non-prime-power).

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,2},1,{1,2,1},2,{2,1,1},2,{2,1,2},2,{2,2,1},1,{2,2,2},1]]]
    kol[n_]:=Nest[kolagrow,{1},n-1];
    Differences[kol[100],2]

A074263 Positions of '22' in Kolakoski sequence A000002.

Original entry on oeis.org

2, 8, 11, 18, 26, 35, 38, 44, 53, 56, 62, 65, 74, 80, 83, 89, 92, 99, 107, 110, 119, 126, 135, 138, 144, 150, 153, 162, 165, 171, 180, 188, 197, 203, 206, 212, 215, 224, 231, 234, 242, 249, 258, 261, 269, 278, 281, 287, 296, 299, 305, 308, 314, 317, 324, 332
Offset: 1

Views

Author

Jon Perry, Sep 20 2002

Keywords

Examples

			Kolakoski sequence begins 1,2,2,1,1,2,1,2,2,1,2,2,1,1,... so the sequence includes 2, 8, and 11.
		

Crossrefs

Cf. A074262.

Programs

  • Mathematica
    a2 = {1, 2, 2}; Do[ a2 = Join[a2, {1 + Mod[n - 1, 2]}], {n, 3, 300}, {i, 1, a2[[n]]}]; Split[a2] /. {2, 2} -> {0, 2} // Flatten // Position[#, 0] & // Flatten (* Jean-François Alcover, Jun 18 2013 *)

Extensions

Extended and offset changed by Nathaniel Johnston, May 02 2011

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