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.

A347347 If n is odd, a(n) is the smallest positive integer that is a palindrome when represented in binary, and is made by appending some number (zero or more) of binary digits on the left of n's binary representation. If n is even, then a(n) = 0.

Original entry on oeis.org

1, 0, 3, 0, 5, 0, 7, 0, 9, 0, 27, 0, 45, 0, 15, 0, 17, 0, 51, 0, 21, 0, 119, 0, 153, 0, 27, 0, 93, 0, 31, 0, 33, 0, 99, 0, 165, 0, 231, 0, 297, 0, 107, 0, 45, 0, 495, 0, 561, 0, 51, 0, 693, 0, 119, 0, 313, 0, 443, 0, 189, 0, 63, 0, 65, 0, 195, 0, 325, 0, 455, 0
Offset: 1

Views

Author

Chai Wah Wu, Aug 27 2021

Keywords

Comments

Base-2 analog of A347346.

Crossrefs

Programs

  • Python
    def A347347(n):
        if n % 2 == 0:
            return 0
        s = bin(n)[2:]
        if s == s[::-1]:
            return n
        for i in range(1,len(s)):
            if s[:-i]== s[-i-1::-1]:
                return int(s[:-i-1:-1]+s,2)

Formula

If n is odd, then a(n) = A161501(A030101(i)).
Showing 1-1 of 1 results.