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.
%I A375350 #46 Nov 04 2024 16:30:56 %S A375350 5,8,25,12,14,10,89,107,16,67,20,18,109,331,187,227,95,157,26,409,28, %T A375350 24,45,191,65,241,58,85,57,44,161,299,63,62,401,42,40,337,50,36,74,56, %U A375350 99,52,94,1129,86,145,129,54,68,64,1613,76,48,1073,175,533,559,341 %N 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. %H A375350 Michael S. Branicky, <a href="/A375350/b375350.txt">Table of n, a(n) for n = 2..8284</a> (terms 2..523 from Robert Israel) %F A375350 A375201(a(n)) = n. - _Robert Israel_, Oct 15 2024 %e A375350 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. %e A375350 Table begins: %e A375350 a(2) = 5 = 101_2, %e A375350 a(3) = 8 = 22_3, %e A375350 a(4) = 25 = 121_4, %e A375350 a(5) = 12 = 22_5, %e A375350 a(6) = 14 = 22_6, %e A375350 a(7) = 10 = 101_3 = 22_4, %e A375350 a(8) = 89 = 131_8, %e A375350 a(9) = 107 = 1101011_2 = 212_7, %e A375350 a(10) = 16 = 121_3 = 22_7. %p A375350 ispali:= proc(x,b) local F; F:= convert(x,base,b); %p A375350 andmap(t -> F[t] = F[-t], [$1.. nops(F)/2]) %p A375350 end proc: %p A375350 f:= proc(k) convert(select(b -> ispali(k,b),[$2..k-2]),`+`) end proc: %p A375350 N:= 100: # for a(2) .. a(N) %p A375350 V:= Vector(N): count:= 0: %p A375350 for x from 5 while count < N-1 do %p A375350 v:= f(x); %p A375350 if v >= 2 and v <=N and V[v] = 0 then V[v]:= x; count:= count+1; fi %p A375350 od: %p A375350 convert(V[2..N],list); # _Robert Israel_, Oct 14 2024 %o A375350 (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; %o A375350 a(n) = my(k=1); while (!isok(k, n), k++); k; \\ _Michel Marcus_, Aug 14 2024 %o A375350 (Python) %o A375350 from itertools import count, islice %o A375350 from sympy.ntheory import is_palindromic %o A375350 def f(n): return sum(b for b in range(2, n-2) if is_palindromic(n, b)) %o A375350 def agen(): # generator of terms %o A375350 adict, n = dict(), 2 %o A375350 for k in count(4): %o A375350 v = f(k) %o A375350 if v not in adict: %o A375350 adict[v] = k %o A375350 while n in adict: yield adict[n]; n += 1 %o A375350 print(list(islice(agen(), 60))) # _Michael S. Branicky_, Oct 15 2024 %Y A375350 Cf. A002113,A007632, A007953, A065531, A107129, A135549, A253594, A375201. %K A375350 nonn,base %O A375350 2,1 %A A375350 _Jean-Marc Rebert_, Aug 14 2024 %E A375350 Name clarified by _Robert Israel_, Oct 15 2024