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.

A135551 Number of bases b, 1 < b < n, in which n is a palindrome.

This page as a plain text file.
%I A135551 #45 Mar 01 2018 14:35:47
%S A135551 0,0,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,
%T A135551 3,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,
%U A135551 4,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
%N A135551 Number of bases b, 1 < b < n, in which n is a palindrome.
%C A135551 Every integer n is a palindrome when expressed in unary, or in base n-1 (where it will be 11).
%C A135551 First occurrence in A037183.
%C A135551 a(n) is always less than A001221(n) except for 2 and 6; a(n) is always less than A001222(n) except for even powers of twos and 6, 12, 81, 243, 625, 729, 2187, 19683, 59049, ..., . - _Robert G. Wilson v_, Jul 17 2016
%H A135551 Robert G. Wilson v, <a href="/A135551/b135551.txt">Table of n, a(n) for n = 0..100000</a>
%H A135551 John P. Linderman, <a href="/A135549/a135549.html">Description of A135549-A135551 and A016038</a>
%H A135551 John P. Linderman, <a href="/A135549/a135549.txt">Perl program</a> [Use the command: BASEDELTA=0 palin.pl]
%F A135551 a(n) = A135549(n) + 1 for n>2; otherwise a(n) = A135549(n) = 0. - _Michel Marcus_, Oct 15 2014
%F A135551 a(n) = A126071(n) - 1. - _Michel Marcus_, Mar 07 2015
%t A135551 palindromicBases[n_] := Module[{p}, Table[p = IntegerDigits[n, b]; If[p == Reverse[p], {b, p}, Sequence @@ {}], {b, 2, n - 1}]]; Array[ Length@ palindromicBases@# &, 105, 0] (* _Robert G. Wilson v_, Oct 15 2014 *)
%t A135551 palQ[n_Integer, base_Integer] := Module[{idn = IntegerDigits[n, base]}, idn == Reverse[idn]];
%t A135551 f[n_] := Block[{s = Ceiling@ Sqrt@ n, b = 2, c = If[ IntegerQ@ Sqrt[4n + 1], -1, 0]}, While[b < s, If[ palQ[n, b], c++]; b++]; c + Count[ Mod[n, Range[s - 1]], 0]]; f[0] = 0; Array[f, 105, 0] (* much faster for large Ns *) (* _Robert G. Wilson v_, Oct 20 2014 *)
%Y A135551 Cf. A037183, A135549, A135550, A016038.
%Y A135551 Essentially the same as A065531.
%K A135551 nonn,base
%O A135551 0,6
%A A135551 _John P. Linderman_, Feb 26 2008, Feb 28 2008