login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A369233
Smallest base for which the digits expansion of 2^n is palindromic.
1
3, 3, 3, 3, 7, 7, 7, 15, 7, 7, 31, 7, 15, 15, 31, 15, 15, 31, 63, 15, 31, 31, 127, 63, 31, 31, 63, 127, 127, 31, 63, 63, 255, 255, 127, 63, 63, 127, 511, 255, 255, 63, 127, 127, 511, 511, 511, 255, 127, 127, 255, 1023, 1023, 511, 511, 127, 255, 255, 2047, 1023, 1023, 1023, 127, 255
OFFSET
1,1
COMMENTS
From the Kreher and Stinson article we know that a(n) is of the form 2^k-1 (cf. A000225). - David A. Corneth, Jan 18 2024
LINKS
David A. Corneth, Table of n, a(n) for n = 1..10000 (first 400 terms from Michel Marcus)
Donald L. Kreher and Douglas R. Stinson, On min-base palindromic representations of powers of 2, arXiv:2401.07351 [math.NT], 2024. See Table 3 p. 7.
FORMULA
a(n) = A016026(A000079(n)).
MAPLE
f:= proc(n) local x, b, L, i;
x:= 2^n;
for b from 3 do
L:= convert(x, base, b);
if andmap(i -> L[i]=L[-i], [$1..nops(L)/2]) then return b fi
od
end proc:
map(f, [$1..100]); # Robert Israel, Jan 17 2024
MATHEMATICA
A369233[n_] := Block[{p = 2^n, k = 1}, While[!PalindromeQ[IntegerDigits[p, 2^++k-1]]]; 2^k-1]; Array[A369233, 100] (* Paolo Xausa, Mar 10 2024 *)
PROG
(PARI) ispal(n, b) = my(d=digits(n, b)); d == Vecrev(d);
a(n) = my(b=2, N=2^n); while (! ispal(N, b), b++); b;
(PARI) a(n) = {my(pow2 = 1<<n, i, d); for(i = 2, max(n, 2), d = digits(pow2, 1<<i-1); if(Vecrev(d) == d, return(1<<i-1)))} \\ David A. Corneth, Jan 18 2024
(Python)
from itertools import count
from sympy.ntheory.factor_ import digits
def A369233(n):
m = 1<<n
return next(b for b in count(2) if (s := digits(m, b)[1:])[:(t:=len(s)+1>>1)]==s[:-t-1:-1]) # Chai Wah Wu, Jan 17 2024
CROSSREFS
KEYWORD
nonn,base,look
AUTHOR
Michel Marcus, Jan 17 2024
STATUS
approved