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.

A126071 Number of bases (2 <= b <= n+1) in which n is a palindrome.

This page as a plain text file.
%I A126071 #24 May 07 2025 09:13:41
%S A126071 1,1,2,2,3,2,3,3,3,4,2,3,3,3,4,4,4,4,2,4,5,3,3,5,3,5,4,5,3,4,4,4,4,4,
%T A126071 3,6,3,4,3,6,3,5,3,4,5,5,2,6,3,5,5,6,2,5,5,5,5,3,3,7,3,4,6,5,6,5,4,5,
%U A126071 3,5,3,7,4,4,4,4,3,7,2,8,4,5,3,7,6,4,3
%N A126071 Number of bases (2 <= b <= n+1) in which n is a palindrome.
%C A126071 a(n) >= 1, since n will always have a single "digit" in base n+1.
%H A126071 T. D. Noe, <a href="/A126071/b126071.txt">Table of n, a(n) for n = 1..1000</a>
%e A126071 From bases 2 to 9 respectively, 8 can be represented as: 1000, 22, 20, 13, 12, 11, 10, 8. Three of those are symmetrical (22, 11, 8) and so a(8) = 3.
%t A126071 Table[cnt = 0; Do[d = IntegerDigits[n, k]; If[d == Reverse[d], cnt++], {k, 2, n + 1}]; cnt, {n, 100}] (* _T. D. Noe_, Oct 04 2012 *)
%t A126071 a = Compile[{{n, _Integer}}, Module[{b = 2, c = Floor@ If[ IntegerQ@ Sqrt[n + 1], 0, 1], idn, s = Floor@ Sqrt[n + 1] - 1}, c = c + Count[ Mod[n, Range@ s], 0]; s = s + 2; While[ b < s, If[ Reverse[ idn = IntegerDigits[n, b]] == idn, c++]; b++]; c]]; Array[a, 87] (* _Robert G. Wilson v_, May 05 2025 *)
%o A126071 (PARI) a(n) = sum(k=2, n+1, d = digits(n, k); Vecrev(d) == d); \\ _Michel Marcus_, Mar 07 2015
%Y A126071 Cf. A016026.
%Y A126071 Cf. A016038, A047811 (related to numbers having 2 bases).
%K A126071 nonn,base
%O A126071 1,3
%A A126071 _Paul Richards_, Mar 01 2007
%E A126071 Extended by _T. D. Noe_, Oct 04 2012