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!)
A090709 Primes whose decimal representation is a valid number in base 6 and interpreted as such is again a prime. 9
2, 3, 5, 11, 31, 101, 151, 211, 241, 251, 331, 421, 431, 521, 1021, 1151, 1231, 1321, 2011, 2131, 2311, 2351, 2441, 2531, 2551, 3041, 3221, 3251, 3301, 3541, 4021, 4111, 4201, 4421, 4441, 4451, 5011, 5021, 5101, 5231, 5441, 5531, 10331, 11131, 11311 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

LINKS

Chai Wah Wu, Table of n, a(n) for n = 1..10000

EXAMPLE

31 is prime in decimal and a valid number in base 6: 31_6 = 19, a prime.

MATHEMATICA

Select[ FromDigits@# & /@ IntegerDigits[ Prime@ Range@ 270, 6], PrimeQ] (* Robert G. Wilson v, Jan 05 2014 *)

vn6pQ[n_]:=Module[{idn=IntegerDigits[n]}, Max[idn]<6&&PrimeQ[ FromDigits[ idn, 6]]]; Select[Prime[Range[1500]], vn6pQ] (* Harvey P. Dale, Jul 10 2015 *)

PROG

(Python)

from gmpy2 import digits, is_prime

A090709_list = [n for n in (int(digits(d, 6)) for d in range(10**6) if is_prime(d)) if is_prime(n)] # Chai Wah Wu, Apr 09 2016

(PARI) fixBase(n, oldBase, newBase)=my(d=digits(n, oldBase), t=newBase-1); for(i=1, #d, if(d[i]>t, for(j=i, #d, d[j]=t); break)); fromdigits(d, newBase)

list(lim)=my(v=List(), t); forprime(p=2, fixBase(lim\1, 10, 6), if(isprime(t=fromdigits(digits(p, 6), 10)), listput(v, t))); Vec(v) \\ Charles R Greathouse IV, Nov 07 2016

(MAGMA) [[n:n in PrimesUpTo(12000)| Max(Intseq(n, 10)) le 5 and IsPrime(Seqint(Intseq(Seqint(Intseq(n), 6))))]; // Marius A. Burtea, Jun 30 2019

CROSSREFS

Cf. A031974, A089971, A089981, A090707, A090708, A090710, A235394, A235395, A000040.

Sequence in context: A072535 A073680 A079557 * A112279 A130166 A007097

Adjacent sequences:  A090706 A090707 A090708 * A090710 A090711 A090712

KEYWORD

base,nonn

AUTHOR

Cino Hilliard, Jan 18 2004

EXTENSIONS

Following suggestions by V.J. Pohjola and Donovan Johnson, name, example and offset corrected by M. F. Hasler, Jan 03 2014

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 August 10 01:24 EDT 2020. Contains 336361 sequences. (Running on oeis4.)