login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A087166 Primes which are palindromes in 3 or more bases. 1
17, 31, 67, 73, 107, 109, 127, 151, 157, 173, 181, 191, 197, 211, 227, 241, 257, 271, 277, 307, 313, 337, 353, 373, 379, 401, 409, 419, 421, 433, 443, 457, 461, 463, 487, 521, 523, 541, 577, 587, 601, 617, 619, 631, 647, 661, 673, 683, 701, 719, 727, 743, 757, 761, 773, 787, 797, 809, 857, 859 (list; graph; refs; listen; history; text; internal format)
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

Primes in A253594.

Sequence in context: A270441 A256374 A286512 * A167496 A164041 A085598

Adjacent sequences:  A087163 A087164 A087165 * A087167 A087168 A087169

KEYWORD

base,nonn

AUTHOR

Randy L. Ekl, Oct 18 2003

EXTENSIONS

Corrected by Robert Israel, May 01 2020

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 28 09:43 EDT 2021. Contains 346325 sequences. (Running on oeis4.)