A375201 a(n) is the sum of the bases b with 1 < b < n-1 in which n is a palindrome.
0, 2, 0, 2, 3, 2, 7, 0, 5, 3, 6, 6, 10, 6, 13, 0, 12, 12, 10, 3, 23, 4, 20, 10, 22, 4, 23, 7, 22, 12, 20, 6, 41, 6, 22, 12, 38, 5, 37, 6, 31, 24, 31, 0, 56, 6, 40, 22, 45, 0, 51, 20, 43, 30, 28, 4, 82, 6, 35, 34, 53, 26, 63, 11, 52, 22, 56, 7, 91, 10, 42, 38, 55, 10, 87, 0, 91, 34, 52, 5, 112, 29
Offset: 4
Examples
a(10) = 7 because 10 = 101_3 = 22_4 is a palindrome in bases 3 and 4, and 3 + 4 = 7.
Links
- Robert Israel, Table of n, a(n) for n = 4..10000
Programs
-
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: map(f, [$4 .. 100]);
-
Python
from sympy.ntheory import is_palindromic def a(n): return sum(b for b in range(2, n-2) if is_palindromic(n, b)) print([a(n) for n in range(4, 86)]) # Michael S. Branicky, Oct 15 2024
Comments