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.

A052059 Least k such that the longest palindromic substring (without leading zeros) contained in 2^k has length n.

Original entry on oeis.org

0, 16, 17, 47, 49, 41, 146, 274, 76, 468, 1622, 4381, 2961, 12799, 4292, 28493, 34597, 16276
Offset: 1

Views

Author

Patrick De Geest, Jan 15 2000

Keywords

Comments

a(12) > 3000. - Erich Friedman, Feb 19 2000
a(16) > 15000. - Sean A. Irvine, Oct 19 2021
No other terms <= 35000. - Michael S. Branicky, Nov 12 2021

Examples

			a(3) = 17 since 2^17 = {131}072.
		

Crossrefs

Programs

  • Python
    def ispal(s): return s == s[::-1]
    def longestpalss(n):
        s = str(n)
        for l in range(len(s), 0, -1):
            for offset in range(len(s)-l+1):
                if s[offset] != '0' and ispal(s[offset:offset+l]):
                    return l
    def a(n):
        k, pow2 = 0, 1
        while longestpalss(pow2) != n: k += 1; pow2 <<= 1
        return k
    print([a(n) for n in range(1, 11)]) # Michael S. Branicky, Nov 12 2021

Extensions

a(11)=1445 from Erich Friedman, Feb 19 2000
Title clarified, a(11) corrected, and a(12)-a(15) from Sean A. Irvine, Oct 19 2021
a(16)-a(18) from Michael S. Branicky, Nov 12 2021