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

A157970 Evil twin locations: first members of pairs of consecutive evil numbers.

Original entry on oeis.org

5, 9, 17, 23, 29, 33, 39, 45, 53, 57, 65, 71, 77, 85, 89, 95, 101, 105, 113, 119, 125, 129, 135, 141, 149, 153, 159, 165, 169, 177, 183, 189, 197, 201, 209, 215, 221, 225, 231, 237, 245, 249, 257, 263, 269, 277, 281, 287, 293, 297
Offset: 1

Views

Author

John W. Layman, Mar 10 2009

Keywords

Comments

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

Examples

			The sequence of evil numbers (A001969) begins 0,3,5,6,9,10,12,15,17,18,20,..., so the first few evil twins are 5, 9, 17, ... .
		

Crossrefs

Programs

  • Mathematica
    SequencePosition[Table[If[EvenQ[DigitCount[n, 2, 1]], 1, 0], {n, 300}], {1, 1}][[All, 1]] (* Amiram Eldar, Dec 09 2019 after Harvey P. Dale at A157971 *)
  • PARI
    lista(nn) = select(n->(!(hammingweight(n) % 2) && !(hammingweight(n+1) % 2)), vector(nn, i, i)); \\ Michel Marcus, Jul 10 2014

Formula

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

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

Original entry on oeis.org

2, 8, 14, 22, 26, 32, 38, 42, 50, 56, 62, 70, 74, 82, 88, 94, 98, 104, 110, 118, 122, 128, 134, 138, 146, 152, 158, 162, 168, 174, 182, 186, 194, 200, 206, 214, 218, 224, 230, 234, 242, 248, 254, 262, 266, 274, 280, 286, 290, 296, 302, 310, 314, 322, 328
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) = 2 and a(2) = 8.
		

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]],{1,1}][[All,2]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, May 16 2017 *)
  • PARI
    t(n)=hammingweight(n)%2;
    for(n=1,500,if(t(n)==1&&t(n-1)==1,print1(n,", "))); \\ Joerg Arndt, Mar 12 2022

Formula

a(n) = 2*A091855(n) for n >= 1.
a(n) = A157971(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 *)
Showing 1-4 of 4 results.