OFFSET
1,1
COMMENTS
For the purposes of this sequence, single digits are not counted as palindromes (otherwise every number n is a palindrome in all bases > n). - Robert Israel, May 01 2020
LINKS
Robert Israel, Table of n, a(n) for n = 1..5867
EXAMPLE
31 is in the list, as 31 base 2 = 11111, 31 base 5 = 111 and 31 base 30 = 11, i.e. three different ways.
MAPLE
N:= 1000: # for all terms <= N
digrev:= proc(n, b)
local L, i;
L:= convert(n, base, b);
add(L[-i]*b^(i-1), i=1..nops(L))
end proc:
bpalis:= proc(b, N)
local Res, dmax, d, m;
dmax:= floor(log[b](N))+1;
if dmax < 2 then return [] fi;
Res:= seq(i*(b+1), i=1..b-1);
for d from 3 to dmax do
if d::even then
m:= d/2;
Res:= Res, seq(n*b^m + digrev(n, b), n=b^(m-1)..b^m-1);
else
m:= (d-1)/2;
Res:= Res, seq(seq(n*b^(m+1)+y*b^m+digrev(n, b), y=0..b-1), n=b^(m-1)..b^m-1);
fi
od;
select(`<=`, [Res], N)
end proc:
V:= Vector(N):
for b from 2 to N-1 do
bp:= bpalis(b, N);
V[bp]:= V[bp] +~ 1
od:
select(p -> isprime(p) and V[p] >= 3, [seq(i, i=3..N, 2)]); # Robert Israel, May 01 2020
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Randy L. Ekl, Oct 18 2003
EXTENSIONS
Corrected by Robert Israel, May 01 2020
STATUS
approved