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

A342040 Binary palindromes of odd length.

Original entry on oeis.org

1, 101, 111, 10001, 10101, 11011, 11111, 1000001, 1001001, 1010101, 1011101, 1100011, 1101011, 1110111, 1111111, 100000001, 100010001, 100101001, 100111001, 101000101, 101010101, 101101101, 101111101, 110000011, 110010011, 110101011
Offset: 1

Views

Author

Seiichi Manyama, Feb 26 2021

Keywords

Comments

Subsequence of A057148.

Crossrefs

Programs

  • Mathematica
    a[1] = 1; a[n_] := FromDigits[Join[#, {Mod[n, 2]}, Reverse[#]] &@ IntegerDigits[Floor[n/2], 2]]; Array[a, 26] (* Amiram Eldar, Apr 28 2021 *)
  • Python
    def A342040(n):
        s = bin(n)[2:]
        return int(s+s[-2::-1]) # Chai Wah Wu, Feb 26 2021

Formula

a(n) = A007088(A048700(n)).
Showing 1-1 of 1 results.