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

A022293 Sequence A022292 divided by 2.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 18, 19, 20, 21, 22, 23, 24, 25, 27, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 39, 40, 41, 43, 44, 49, 52, 53, 58, 59, 61, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 79, 80, 81, 82, 84, 85, 88, 89, 90, 91, 92, 93, 94, 95, 96, 99
Offset: 0

Views

Author

Keywords

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]

A080383 Number of j (0 <= j <= n) such that the central binomial coefficient C(n,floor(n/2)) = A001405(n) is divisible by C(n,j).

Original entry on oeis.org

1, 2, 3, 4, 3, 6, 3, 6, 3, 6, 3, 6, 7, 10, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 8, 3, 6, 3, 6, 7, 10, 3, 6, 3, 6, 3, 8, 3, 6, 5, 10, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 7, 10, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 7, 10, 3, 6, 3, 6, 7, 10, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6
Offset: 0

Views

Author

Labos Elemer, Mar 12 2003

Keywords

Examples

			For n <= 500 only a few values of a(n) arise: {1,2,3,4,5,6,7,8,10,11,14}.
From _Jon E. Schoenfield_, Sep 15 2019: (Start)
a(n)=1 occurs only at n=0.
a(n)=2 occurs only at n=1.
a(n)=3 occurs for all even n > 0 such that C(n,j) divides C(n,n/2) only at j = 0, n/2, and n. (This is the case for about 4/9 of the first 100000 terms, and there appear to be nearly as many terms for which a(n)=6.)
a(n)=4 occurs only at n=3.
For n <= 100000, the only values of a(n) that occur are 1..16, 18, 19, 22, 23, and 26.
   k | Indices n (up to 100000) at which a(n)=k
  ---+-------------------------------------------------------
   1 | 0
   2 | 1
   3 | 2, 4, 6, 8, 10, 14, 16, 18, 20, 22, 24, ...
   4 | 3
   5 | 40, 176, 208, 480, 736, 928, 1248, 1440, ... (A327430)
   6 | 5, 7, 9, 11, 15, 17, 19, 21, 23, 27, 29, ... (A080384)
   7 | 12, 30, 56, 84, 90, 132, 154, 182, 220, ...  (A080385)
   8 | 25, 37, 169, 199, 201, 241, 397, 433, ...    (A080386)
   9 | 1122, 1218, 5762, 11330, 12322, 15132, ...   (A327431)
  10 | 13, 31, 41, 57, 85, 91, 133, 155, 177, ...   (A080387)
  11 | 420, 920, 1892, 1978, 2444, 2914, 3198, ...
  12 | 1103, 1703, 2863, 7773, 10603, 15133, ...
  13 | 12324, 37444
  14 | 421, 921, 1123, 1893, 1979, 1981, 2445, ...
  15 | 4960, 6956, 13160, 16354, 18542, 24388, ...
  16 | 11289, 16483, 36657, 62653, 89183
  17 |
  18 | 4961, 6957, 12325, 13161, 16355, 18543, ...
  19 | 16356, 88510, 92004
  20 |
  21 |
  22 | 16357, 88511, 90305, 92005
  23 | 90306
  24 |
  25 |
  26 | 90307
(End)
		

Crossrefs

Programs

  • Magma
    [#[j:j in [0..n]| Binomial(n,Floor(n/2)) mod Binomial(n,j) eq 0]:n in [0..100]]; // Marius A. Burtea, Sep 15 2019
  • Mathematica
    Table[Count[Table[IntegerQ[Binomial[n, Floor[n/2]]/Binomial[n, j]], {j, 0, n}], True], {n, 0, 500}] (* adapted by Vincenzo Librandi, Jul 29 2017 *)
  • PARI
    a(n) = my(b=binomial(n, n\2)); sum(i=0, n, (b % binomial(n, i)) == 0); \\ Michel Marcus, Jul 29 2017
    
  • PARI
    a(n) = {if(n==0, return(1)); my(bb = binomial(n, n\2), b = n); res = 2 + !(n%2) + 2 * (n>2 && n%2 == 1); for(i = 2, (n-1)\2, res += 2*(bb%b==0); b *= (n + 1 - i) / i); res} \\ David A. Corneth, Jul 29 2017
    

Extensions

Edited by Dean Hickerson, Mar 14 2003
Offset corrected by David A. Corneth, Jul 29 2017

A074261 Positions in the Kolakoski sequence (A000002) when the number of 2's is greater than the number of 1's.

Original entry on oeis.org

3, 9, 11, 12, 13, 15, 19, 21, 27, 39, 45, 47, 57, 63, 65, 66, 67, 69, 75, 77, 81, 83, 84, 85, 87, 89, 90, 91, 92, 93, 94, 95, 96, 97, 99, 100, 101, 102, 103, 105, 107, 108, 109, 110, 111, 112, 113, 114, 115, 117, 119, 120, 121, 123, 127, 129, 139, 145, 147
Offset: 1

Views

Author

Jon Perry, Sep 20 2002

Keywords

Examples

			The Kolakoski sequence begins 1,2,2,1,1,2,1,2,2, so this sequence begins with 3,9.
		

Crossrefs

Programs

Extensions

Extended and offset changed by Nathaniel Johnston, May 02 2011

A342799 Numbers m such that there are more 1s than 2s in {K(1), .., K(m)}, where K = A000002 (Kolakoski sequence).

Original entry on oeis.org

1, 5, 7, 17, 23, 25, 29, 31, 32, 33, 34, 35, 37, 41, 43, 49, 51, 52, 53, 55, 59, 61, 71, 73, 79, 125, 131, 133, 134, 135, 137, 141, 143, 149, 161, 179, 185, 187, 191, 193, 194, 195, 196, 197, 199, 201, 202, 203, 205, 209, 211, 221, 223, 227, 229, 230, 231
Offset: 1

Views

Author

Clark Kimberling, May 10 2021

Keywords

Comments

The three sequences A022292 (without the initial 0), A074261, and A342799 partition the positive integers.

Examples

			The Kolakoski sequence is (1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1, 1, 2, ...), so that a(1) = 1, a(2) = 5.
		

Crossrefs

Programs

  • Mathematica
    k = 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}, 14], 1]; (* A000002 *)
    Select[Range[400], Count[Take[k, #], 1] < #/2 &]   (* A074261 *)
    Select[Range[400], Count[Take[k, #], 1] == #/2 &]  (* A022292 *)
    Select[Range[400], Count[Take[k, #], 1] > #/2 &]   (* A342799 *)

A074299 Lengths of subsequences such that the first 'average' value (a[n]*1.5) is not achieved from the starting position in the Kolakoski sequence (A000002).

Original entry on oeis.org

12, 32, 34, 52, 66, 84, 90, 92, 94, 96, 100, 102, 108, 110, 112, 114, 120, 134, 154, 156, 166, 172, 174, 194, 196, 202, 216, 230, 248, 254, 256, 258, 260, 266, 268, 272, 274, 276, 278, 280, 284, 286, 292, 294, 296, 298, 304, 318, 336, 342, 344, 348, 350, 352
Offset: 1

Views

Author

Jon Perry, Sep 21 2002

Keywords

Comments

All members of this sequence are even. 2n is in this sequence if and only if A074298(n)>1.
The even numbers missing from A022292.

Examples

			The initial run of 12 adds up to 19, however if we start at position 3, then the sum is 18.
		

Crossrefs

Programs

  • JavaScript
    a=new Array();
    a[1]=1; a[2]=2; a[3]=2; cd=1; ap=3;
    for (i=4; i<1000; i++)
    {
        if (a[ap]==1) a[i]=cd;
        else {a[i]=cd; a[i+1]=cd; i++}
        ap++;
        cd=3-cd;
    }
    b=new Array();
    oc=0; tc=0; c=1;
    for (i=1; i<1000; i++)
    {
        if (oc==tc) b[c++]=i-1;
        if (a[i]==1) oc++;
        else tc++;
    }
    /* document.write(b); */
    /* document.write("
    "); */ function isElement(x, arr) { for (j=1; jx) return false; } return false; } for (i=1; i<500; i++) if (!isElement(2*i, b)) document.write(2*i+", "); // Jon Perry, Sep 11 2012
  • Mathematica
    max = 200; kol = {1, 2, 2}; For[n=3, n <= 2*max, n++, For[i=1, i <= kol[[n]], i++, AppendTo[kol, 1 + Mod[n-1, 2]]]]; A074298[n_] := For[k=1, True, k++, If[Plus @@ kol[[k ;; k + 2*n - 1]] == 3*n, Return[k]]]; Select[2*Range[max], A074298[#/2] > 1 &] (* Jean-François Alcover, Sep 25 2012 *)

Extensions

Edited by Nathaniel Johnston, May 02 2011

A339976 Numbers k such that exactly half of the first k terms of A337546 are 0's.

Original entry on oeis.org

0, 2, 6, 8, 14, 38, 44, 46, 50, 56, 60, 62, 66, 72, 74, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 102, 104, 110, 114, 116, 120, 126, 130, 132, 138, 162, 168, 170, 174, 180, 184, 186, 190, 196, 198, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 226, 228
Offset: 1

Views

Author

Rémy Sigrist, Dec 25 2020

Keywords

Comments

Equivalently, these are the positions of 0's in A339975.

Examples

			The first 6 terms of A337546 are 0, 1, 0, 0, 1, 1.
Exactly half of them are 0's, so 6 belongs to the sequence.
		

Crossrefs

Programs

  • C
    See Links section.
Showing 1-8 of 8 results.