cp's OEIS Frontend

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.

A375201 a(n) is the sum of the bases b with 1 < b < n-1 in which n is a palindrome.

This page as a plain text file.
%I A375201 #15 Oct 16 2024 09:20:26
%S A375201 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,
%T A375201 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,
%U A375201 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
%N A375201 a(n) is the sum of the bases b with 1 < b < n-1 in which n is a palindrome.
%C A375201 If n = s*t is composite with s <= t-2, then n = s * (t-1) + s is a two-digit palindrome in base t-1, while s^2 = (s-1)^2 + 2 * (s-1) + 1 is a palindrome in base s-1.  Thus a(n) >= sqrt(n)-1 for composite n > 6. On the other hand, there may be infinitely many primes for which a(n) = 0 (see A016038).
%H A375201 Robert Israel, <a href="/A375201/b375201.txt">Table of n, a(n) for n = 4..10000</a>
%e A375201 a(10) = 7 because 10 = 101_3 = 22_4 is a palindrome in bases 3 and 4, and 3 + 4 = 7.
%p A375201 ispali:= proc(x, b) local F; F:= convert(x, base, b);
%p A375201   andmap(t -> F[t] = F[-t], [$1.. nops(F)/2])
%p A375201 end proc:
%p A375201 f:= proc(k) convert(select(b -> ispali(k, b), [$2..k-2]), `+`) end proc:
%p A375201 map(f, [$4 .. 100]);
%o A375201 (Python)
%o A375201 from sympy.ntheory import is_palindromic
%o A375201 def a(n): return sum(b for b in range(2, n-2) if is_palindromic(n, b))
%o A375201 print([a(n) for n in range(4, 86)]) # _Michael S. Branicky_, Oct 15 2024
%Y A375201 Cf. A016038, A135549, A375350.
%K A375201 nonn,look
%O A375201 4,2
%A A375201 _Robert Israel_, Oct 15 2024