login
A052059
Least k such that the longest palindromic substring (without leading zeros) contained in 2^k has length n.
2
0, 16, 17, 47, 49, 41, 146, 274, 76, 468, 1622, 4381, 2961, 12799, 4292, 28493, 34597, 16276
OFFSET
1,2
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
EXAMPLE
a(3) = 17 since 2^17 = {131}072.
PROG
(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
CROSSREFS
Sequence in context: A101196 A064637 A115942 * A041526 A041524 A042205
KEYWORD
nonn,base,hard,more
AUTHOR
Patrick De Geest, Jan 15 2000
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
STATUS
approved