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.

A065531 Number of palindromes in all base b representations for n, for 2<=b<=n.

This page as a plain text file.
%I A065531 #39 May 06 2025 10:30:27
%S A065531 1,0,1,1,2,1,2,2,2,3,1,2,2,2,3,3,3,3,1,3,4,2,2,4,2,4,3,4,2,3,3,3,3,3,
%T A065531 2,5,2,3,2,5,2,4,2,3,4,4,1,5,2,4,4,5,1,4,4,4,4,2,2,6,2,3,5,4,5,4,3,4,
%U A065531 2,4,2,6,3,3,3,3,2,6,1,7,3,4,2,6,5,3,2,5,2,5,4,5,4,2,2,6,2,5,4,7,2,4,1,6,6
%N A065531 Number of palindromes in all base b representations for n, for 2<=b<=n.
%C A065531 a(1) = 1 by convention, which makes this sequence different from A135551.
%C A065531 Index of first occurrence of k in A037183. - _Robert G. Wilson v_, Oct 27 2014
%H A065531 Robert G. Wilson v, <a href="/A065531/b065531.txt">Table of n, a(n) for n = 1..1000</a>
%t A065531 f = Compile[{{n, _Integer}}, Module[{b = 2, c = Floor@ If[ IntegerQ@ Sqrt[n + 1], -1, 0], 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]]; f[1] = 1; Array[f, 105] (* _Robert G. Wilson v_, May 05 2025 *)
%Y A065531 Cf. A016038, A047811, A037183, A107129.
%Y A065531 Essentially the same as A135551.
%K A065531 easy,nonn,base
%O A065531 1,5
%A A065531 _Naohiro Nomoto_, Dec 02 2001