login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A087155 Primes having nontrivial palindromic representation in some (at least one) base. 3
5, 7, 13, 17, 23, 29, 31, 37, 41, 43, 59, 61, 67, 71, 73, 83, 89, 97, 101, 107, 109, 113, 127, 131, 151, 157, 173, 181, 191, 193, 197, 199, 211, 227, 229, 233, 239, 241, 251, 257, 271, 277, 281, 307, 313, 331, 337, 349, 353, 373, 379, 383, 397, 401, 409, 419 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

COMMENTS

Number of terms < 10^n: 2, 18, 129, 1010, 8392, ..., . - Robert G. Wilson v, Jun 19 2014

Every whole number has single-digit representation in all large bases and all greater than 2 have representation 11 in the base one less than itself. Other palindromic representations are the nontrivial ones. - James G. Merickel, Jul 25 2015

Primes not in A016038. - Robert Israel, Jul 27 2015

LINKS

Robert G. Wilson v, Table of n, a(n) for n = 1..10000

EXAMPLE

17 is in the list because 17_2 = 10001 and 17_4 = 101, two nontrivial palindromic representations. 19 is not in the list because 19 is not a multidigit palindrome in any base other than base 18.

MAPLE

filter:= proc(n) local b, L;

if not isprime(n) then return false fi;

for b from 2 to floor(sqrt(n)) do

  L:= convert(n, base, b);

  if L = ListTools:-Reverse(L) then return true fi;

od:

false

end proc:

select(filter, [2*i+1 $ i=1..1000]); # Robert Israel, Jul 27 2015

MATHEMATICA

palindromicBases[n_] := Module[{p}, Table[p = IntegerDigits[n, b]; If[p == Reverse[p], {b, p}, Sequence @@ {}], {b, 2, n - 2}]]; Select[ Prime@ Range@ 300, palindromicBases[#] !={}&] (* Robert G. Wilson v, May 06 2014 *)

PROG

(PARI) q=1; forprime(m=3, 500, count=0; for(b=2, m-1, w=b+1; k=0; i=m; while(i>0, k=k*w+i%b; i=floor(i/b)); l=0; j=k; while(j>0, l=l*w+j%w; j=floor(j/w)); if(l==k, count=count+1; if(count>1, print1(m, ", "); q=b; m=nextprime(m+1); q=1; b=1, q=b), )))

CROSSREFS

Cf. A016038.

Sequence in context: A240716 A216773 A216745 * A216753 A045442 A216777

Adjacent sequences:  A087152 A087153 A087154 * A087156 A087157 A087158

KEYWORD

base,nonn

AUTHOR

Randy L. Ekl, Oct 18 2003

EXTENSIONS

Title, comments and example changed to agree with convention on single-digit numbers and incorporate 'nontrivial' concept by James G. Merickel, Jul 25 2015

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 | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy .

Last modified February 24 18:24 EST 2018. Contains 299628 sequences. (Running on oeis4.)