login
A375350
a(n) is the smallest number k such that the sum of the bases b, 1 < b < k-1, for which k is palindromic, equals n . If no such number exists, a(n) = -1.
2
5, 8, 25, 12, 14, 10, 89, 107, 16, 67, 20, 18, 109, 331, 187, 227, 95, 157, 26, 409, 28, 24, 45, 191, 65, 241, 58, 85, 57, 44, 161, 299, 63, 62, 401, 42, 40, 337, 50, 36, 74, 56, 99, 52, 94, 1129, 86, 145, 129, 54, 68, 64, 1613, 76, 48, 1073, 175, 533, 559, 341
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
KEYWORD
nonn,base
AUTHOR
Jean-Marc Rebert, Aug 14 2024
EXTENSIONS
Name clarified by Robert Israel, Oct 15 2024
STATUS
approved