OFFSET
2,1
LINKS
Michael S. Branicky, Table of n, a(n) for n = 2..8284 (terms 2..523 from Robert Israel)
FORMULA
A375201(a(n)) = n. - Robert Israel, Oct 15 2024
EXAMPLE
a(7) = 10, because 10 is palindromic in bases 3 (as 101) and 4 (as 22), which are both less than 9. The sum of these bases (3 + 4) is 7, and no smaller number has this property.
Table begins:
a(2) = 5 = 101_2,
a(3) = 8 = 22_3,
a(4) = 25 = 121_4,
a(5) = 12 = 22_5,
a(6) = 14 = 22_6,
a(7) = 10 = 101_3 = 22_4,
a(8) = 89 = 131_8,
a(9) = 107 = 1101011_2 = 212_7,
a(10) = 16 = 121_3 = 22_7.
MAPLE
ispali:= proc(x, b) local F; F:= convert(x, base, b);
andmap(t -> F[t] = F[-t], [$1.. nops(F)/2])
end proc:
f:= proc(k) convert(select(b -> ispali(k, b), [$2..k-2]), `+`) end proc:
N:= 100: # for a(2) .. a(N)
V:= Vector(N): count:= 0:
for x from 5 while count < N-1 do
v:= f(x);
if v >= 2 and v <=N and V[v] = 0 then V[v]:= x; count:= count+1; fi
od:
convert(V[2..N], list); # Robert Israel, Oct 14 2024
PROG
(PARI) isok(k, n) = my(s=0); for(b=2, k-2, my(d=digits(k, b)); if (d == Vecrev(d), s += b)); s == n;
a(n) = my(k=1); while (!isok(k, n), k++); k; \\ Michel Marcus, Aug 14 2024
(Python)
from itertools import count, islice
from sympy.ntheory import is_palindromic
def f(n): return sum(b for b in range(2, n-2) if is_palindromic(n, b))
def agen(): # generator of terms
adict, n = dict(), 2
for k in count(4):
v = f(k)
if v not in adict:
adict[v] = k
while n in adict: yield adict[n]; n += 1
print(list(islice(agen(), 60))) # Michael S. Branicky, Oct 15 2024
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Jean-Marc Rebert, Aug 14 2024
EXTENSIONS
Name clarified by Robert Israel, Oct 15 2024
STATUS
approved