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.

A341257 Positions of palindromes in the ordering of all 01-words defined at A341256.

Original entry on oeis.org

1, 2, 3, 6, 7, 9, 12, 14, 15, 21, 24, 30, 31, 35, 41, 45, 48, 52, 58, 62, 63, 75, 81, 93, 96, 108, 114, 126, 127, 135, 147, 155, 161, 169, 181, 189, 192, 200, 212, 220, 226, 234, 246, 254, 255, 279, 291, 315, 321, 345, 357, 381, 384, 408, 420, 444, 450, 474
Offset: 1

Views

Author

Clark Kimberling, Mar 16 2021

Keywords

Comments

Also, the positions in A076478 of palindromes. - Clark Kimberling, Aug 16 2021

Examples

			Among the first 20 words (0, 1, 00, 10, 01, 11, 000, 100, 010, 110, 001, 101, 011, 111, 0000, 1000, 0100, 1100, 0010, 1010), there are 9 palindromes: 0, 1, 00, 11, 000, 010, 101, 111, 0000, beginning in positions 1, 2, 3, 6, 7, 9, 12, 14, 15, respectively.
		

Crossrefs

Cf. A341256.
Appears to equal A044051 - 2. - Hugo Pfoertner, Mar 16 2021

Programs

  • Mathematica
    z = 800; s = Table[2 n - 1, {n, 1, z}];
    t = Complement[Range[Max[s]], s];
    s1[n_] := Length[Intersection[Range[n - 1], s]];
    t1[n_] := n - 1 - s1[n];
    w[1] = {0}; w[t[[1]]] = {1};
    w[n_] := If[MemberQ[s, n], Join[{0}, w[s1[n]]], Join[{1}, w[t1[n]]]]
    tt = Table[w[n], {n, 1, z}]; Select[tt, # == Reverse[#] &]
    p = Select[Range[Length[tt]], tt[[#]] == Reverse[tt[[#]]] &]