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

A157971 Odious twin locations: first members of pairs of consecutive odious numbers.

Original entry on oeis.org

1, 7, 13, 21, 25, 31, 37, 41, 49, 55, 61, 69, 73, 81, 87, 93, 97, 103, 109, 117, 121, 127, 133, 137, 145, 151, 157, 161, 167, 173, 181, 185, 193, 199, 205, 213, 217, 223, 229, 233, 241, 247, 253, 261, 265, 273, 279, 285, 289, 295
Offset: 1

Views

Author

John W. Layman, Mar 10 2009

Keywords

Comments

An odious number (A000069) is a nonnegative integer with an odd number of ones in its binary expansion.
In the reference it is shown that these odious twins alternate with the evil twins (see A157970), which are pairs of consecutive evil numbers (A001969) having even numbers of ones in their binary expansions.

Examples

			The sequence of odious numbers (A000069) begins 1,2,4,7,8,11,13,14,16,19,21,..., so the first few odious twins are at 1,7,13, ... .
		

Crossrefs

Programs

  • Mathematica
    SequencePosition[Table[If[OddQ[DigitCount[n,2,1]],1,0],{n,300}],{1,1}][[All,1]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Oct 05 2016 *)
  • PARI
    lista(nn) = select(n->((hammingweight(n) % 2) && (hammingweight(n+1) % 2)), vector(nn, i, i)); \\ Michel Marcus, Jul 10 2014

Formula

a(n) = A248057(n) - 1. - Amiram Eldar, Jun 16 2025

Extensions

Comment corrected by Jeff Aronson. - N. J. A. Sloane, Oct 04 2020

A198680 Multiples of 3 whose sum of base-3 digits are also multiples of 3.

Original entry on oeis.org

0, 15, 21, 33, 39, 45, 57, 63, 78, 87, 93, 99, 111, 117, 132, 135, 150, 156, 165, 171, 186, 189, 204, 210, 222, 228, 234, 249, 255, 261, 273, 279, 294, 297, 312, 318, 327, 333, 348, 351, 366, 372, 384, 390, 396, 405, 420, 426, 438, 444, 450, 462, 468, 483, 489, 495
Offset: 1

Views

Author

John W. Layman, Oct 28 2011

Keywords

Comments

It appears that Sum[k^j, 0<=k<=2^n-1, k in A198680] = Sum[k^j, 0<=k<=2^n-1, k in A198681] = Sum[k^j, 0<=k<=2^n-1, k in A180682], for 0<=j<=n-1, which has been verified numerically in a number of cases. This is a generalization of Prouhet's Theorem (see the reference). To illustrate for j=3, we have Sum[k^3, 0<=k<=2^n-1, k in A198680] = {0, 0, 12636, 1108809, 94478400, 7780827681, 633724260624, 51425722195929, 4168024588857600,...}, Sum[k^3, 0<=k<=2^n-1, k in A198681] = {0, 27, 14580, 1095687, 94478400, 7780827681, 633724260624, 51425722195929, 4168024588857600,..., Sum[k^3, 0<=k<=2^n-1, k in A198682] = {0, 216, 7776, 1121931, 94478400, 7780827681, 633724260624, 51425722195929, 4168024588857600,...}, and it is seen that all three sums agree for n>=4=j+1.

Crossrefs

Programs

  • Mathematica
    Select[3*Range[0,200],Divisible[Total[IntegerDigits[#,3]],3]&] (* Harvey P. Dale, May 31 2014 *)

Formula

a(n) = 3*A079498(n). - Charles R Greathouse IV, Nov 02 2011

Extensions

Offset corrected by Amiram Eldar, Jan 05 2020

A248056 Positions of 0,0 in the Thue-Morse sequence (A010060).

Original entry on oeis.org

6, 10, 18, 24, 30, 34, 40, 46, 54, 58, 66, 72, 78, 86, 90, 96, 102, 106, 114, 120, 126, 130, 136, 142, 150, 154, 160, 166, 170, 178, 184, 190, 198, 202, 210, 216, 222, 226, 232, 238, 246, 250, 258, 264, 270, 278, 282, 288, 294, 298, 306, 312, 318, 326, 330
Offset: 1

Views

Author

Clark Kimberling, Sep 30 2014

Keywords

Comments

Every positive integer lies in exactly one of these four sequences: A248056, A091855, A091855, A248057.

Examples

			Thue-Morse sequence:  0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,..., so that a(1) = 6 and a(2) = 10.
		

Crossrefs

Programs

  • Mathematica
    z = 400; u = Nest[Flatten[# /. {0 -> {0, 1}, 1 -> {1, 0}}] &, {0}, 9] (* A010060 *)
    v = Rest[u]
    t1 = Table[If[u[[n]] == 0 && v[[n]] == 0, 1, 0], {n, 1, z}];
    t2 = Table[If[u[[n]] == 0 && v[[n]] == 1, 1, 0], {n, 1, z}];
    t3 = Table[If[u[[n]] == 1 && v[[n]] == 0, 1, 0], {n, 1, z}];
    t4 = Table[If[u[[n]] == 1 && v[[n]] == 1, 1, 0], {n, 1, z}];
    Flatten[Position[t1, 1]]  (* A248056 *)
    Flatten[Position[t2, 1]]  (* A091855 *)
    Flatten[Position[t3, 1]]  (* A091785 *)
    Flatten[Position[t4, 1]]  (* A248057 *)
    SequencePosition[ThueMorse[Range[400]],{0,0}][[All,2]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Mar 02 2020 *)

Formula

a(n) = 2*A091785(n) for n >= 1.
a(n) = A157970(n) + 1. - Amiram Eldar, Jun 16 2025

A248104 Positions of 0,1,0 in the Thue-Morse sequence (A010060).

Original entry on oeis.org

4, 11, 16, 19, 28, 35, 44, 47, 52, 59, 64, 67, 76, 79, 84, 91, 100, 107, 112, 115, 124, 131, 140, 143, 148, 155, 164, 171, 176, 179, 188, 191, 196, 203, 208, 211, 220, 227, 236, 239, 244, 251, 256, 259, 268, 271, 276, 283, 292, 299, 304, 307, 316, 319, 324
Offset: 1

Views

Author

Clark Kimberling, Oct 01 2014

Keywords

Comments

Every positive integer lies in exactly one of these six sequences:
A248056 (positions of 0,0,1)
A248104 (positions of 0,1,0)
A157970 (positions of 1,0,0)
A157971 (positions of 0,1,1)
A248105 (positions of 1,0,1)
A248057 (positions of 1,1,0)
The terms of the sequence are the positions of the mean of the positions of the three numbers 0, 1, 0. - Harvey P. Dale, Jan 26 2019

Examples

			Thue-Morse sequence:  0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,..., so that a(1) = 4 and a(2) = 11.
		

Crossrefs

Programs

  • Mathematica
    z = 600; u = Nest[Flatten[# /. {0 -> {0, 1}, 1 -> {1, 0}}] &, {0}, 13]; v = Rest[u]; w = Rest[v]; t1 = Table[If[u[[n]] == 0 && v[[n]] == 0 && w[[n]] == 1, 1, 0], {n, 1, z}];
    t2 = Table[If[u[[n]] == 0 && v[[n]] == 1 && w[[n]] == 0, 1, 0], {n, 1, z}];
    t3 = Table[If[u[[n]] == 1 && v[[n]] == 0 && w[[n]] == 0, 1, 0], {n, 1, z}];
    t4 = Table[If[u[[n]] == 0 && v[[n]] == 1 && w[[n]] == 1, 1, 0], {n, 1, z}];
    t5 = Table[If[u[[n]] == 1 && v[[n]] == 0 && w[[n]] == 1, 1, 0], {n, 1, z}];
    t6 = Table[If[u[[n]] == 1 && v[[n]] == 1 && w[[n]] == 0, 1, 0], {n, 1, z}];
    Flatten[Position[t1, 1]]  (* A248056 *)
    Flatten[Position[t2, 1]]  (* A248104 *)
    Flatten[Position[t3, 1]]  (* A157970 *)
    Flatten[Position[t4, 1]]  (* A157971 *)
    Flatten[Position[t5, 1]]  (* A248105 *)
    Flatten[Position[t6, 1]]  (* A248057 *)
    Mean/@SequencePosition[ThueMorse[Range[400]],{0,1,0}] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jan 26 2019 *)

A248105 Positions of 1,0,1 in the Thue-Morse sequence (A010060).

Original entry on oeis.org

3, 12, 15, 20, 27, 36, 43, 48, 51, 60, 63, 68, 75, 80, 83, 92, 99, 108, 111, 116, 123, 132, 139, 144, 147, 156, 163, 172, 175, 180, 187, 192, 195, 204, 207, 212, 219, 228, 235, 240, 243, 252, 255, 260, 267, 272, 275, 284, 291, 300, 303, 308, 315, 320, 323
Offset: 1

Views

Author

Clark Kimberling, Oct 01 2014

Keywords

Comments

Every positive integer lies in exactly one of these six sequences:
A248056 (positions of 0,0,1)
A248104 (positions of 0,1,0)
A157970 (positions of 1,0,0)
A157971 (positions of 0,1,1)
A248105 (positions of 1,0,1)
A248057 (positions of 1,1,0)

Examples

			Thue-Morse sequence:  0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,..., so that a(1) = 3 and a(2) = 12.
		

Crossrefs

Programs

  • Mathematica
    z = 600; u = Nest[Flatten[# /. {0 -> {0, 1}, 1 -> {1, 0}}] &, {0}, 13]; v = Rest[u]; w = Rest[v]; t1 = Table[If[u[[n]] == 0 && v[[n]] == 0 && w[[n]] == 1, 1, 0], {n, 1, z}];
    t2 = Table[If[u[[n]] == 0 && v[[n]] == 1 && w[[n]] == 0, 1, 0], {n, 1, z}];
    t3 = Table[If[u[[n]] == 1 && v[[n]] == 0 && w[[n]] == 0, 1, 0], {n, 1, z}];
    t4 = Table[If[u[[n]] == 0 && v[[n]] == 1 && w[[n]] == 1, 1, 0], {n, 1, z}];
    t5 = Table[If[u[[n]] == 1 && v[[n]] == 0 && w[[n]] == 1, 1, 0], {n, 1, z}];
    t6 = Table[If[u[[n]] == 1 && v[[n]] == 1 && w[[n]] == 0, 1, 0], {n, 1, z}];
    Flatten[Position[t1, 1]]  (* A248056 *)
    Flatten[Position[t2, 1]]  (* A248104 *)
    Flatten[Position[t3, 1]]  (* A157970 *)
    Flatten[Position[t4, 1]]  (* A157971 *)
    Flatten[Position[t5, 1]]  (* A248105 *)
    Flatten[Position[t6, 1]]  (* A248057 *)

A331830 Numbers k such that k and k + 1 are both negabinary evil numbers.

Original entry on oeis.org

7, 13, 19, 27, 31, 39, 45, 51, 55, 61, 67, 75, 79, 87, 93, 99, 107, 111, 117, 123, 127, 135, 141, 147, 155, 159, 167, 173, 179, 183, 189, 195, 203, 207, 213, 219, 223, 231, 237, 243, 247, 253, 259, 267, 271, 279, 285, 291, 299, 303, 309, 315, 319, 327, 333, 339
Offset: 1

Views

Author

Amiram Eldar, Jan 28 2020

Keywords

Examples

			7 is a term since both 7 and 7 + 1 = 8 are negabinary evil numbers (A268272): 7 has 4 digits of 1 in its negabinary representation, 11011, 8 has 2 digits of 1 in its negabinary representation, 11000, and both 4 and 2 are even.
		

Crossrefs

Programs

  • Mathematica
    negaBinWt[n_] := negaBinWt[n] = If[n==0, 0, negaBinWt[Quotient[n-1, -2]] + Mod[n, 2]]; evilNegaBinQ[n_] := EvenQ[negaBinWt[n]]; c = 0; k = 1; s = {}; v = Table[-1, {2}]; While[c < 60, If[evilNegaBinQ[k], v = Join[Rest[v], {k}]; If[AllTrue[Differences[v], # == 1 &], c++; AppendTo[s, k - 1]]]; k++]; s

A381848 Sequence obtained by replacing 3-term subwords of A010060 by 0,1,2,3,4,5 as described in Comments.

Original entry on oeis.org

2, 5, 4, 1, 3, 0, 2, 5, 3, 0, 1, 4, 2, 5, 4, 1, 3, 0, 1, 4, 2, 5, 3, 0, 2, 5, 4, 1, 3, 0, 2, 5, 3, 0, 1, 4, 2, 5, 3, 0, 2, 5, 4, 1, 3, 0, 1, 4, 2, 5, 4, 1, 3, 0, 2, 5, 3, 0, 1, 4, 2, 5, 4, 1, 3, 0, 1, 4, 2, 5, 3, 0, 2, 5, 4, 1, 3, 0, 1, 4, 2, 5, 4, 1, 3, 0
Offset: 1

Views

Author

Clark Kimberling, May 28 2025

Keywords

Comments

The six 3-term subwords of A010060 are 0,0,1; 0,1,0; 0,1,1; 1,0,0; 1,0,1; 1,1,0. These are coded as 0,1,2,3,4,5 respectively, and then these numbers replace the corresponding subwords in A010060. The positions of 0,1,2,3,4,5 are given by A248956, A248104, A157971, A157970, A248105, A248057, respectively.

Examples

			Starting with A010060 = (0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0,...), the successive 3-term subwords are 0,1,1; 1,1,0; 1,0,1; 0,1,0; 1,0,0 ..., which code as 2,5,4,1,3,... .
		

Crossrefs

Programs

  • Mathematica
    Partition[ThueMorse[Range[0, 200]], 3, 1] /. Thread[{{0, 0, 1}, {0, 1, 0}, {0, 1, 1}, {1, 0, 0}, {1, 0, 1}, {1, 1, 0}} -> {0, 1, 2, 3, 4, 5}]  (* Peter J. C. Moses, May 22 2025 *)
Showing 1-7 of 7 results.