%I #31 Dec 08 2024 20:41:38
%S 2,3,5,7,11,13,17,19,23,29,37,43,47,53,61,71,73,79,83,97,103,107,109,
%T 113,131,149,151,157,163,167,181,191,193,197,227,233,241,251,277,293,
%U 307,311,313,317,349,359,373,389,401,419,421,433,443,449,463,467,503
%N Primes that when written in base 4, then reinterpreted in base 10, again give primes.
%C In general rebase notation (Marc LeBrun): p4 = (4) [p] (10).
%H Harry J. Smith, <a href="/A065722/b065722.txt">Table of n, a(n) for n=1..1000</a>
%H Brady Haran and Grant Sanderson, <a href="https://www.youtube.com/watch?v=jhObLT1Lrfo">Paterson Primes</a>, YouTube/Numberphile video, Nov. 2022.
%H M. F. Hasler, <a href="https://docs.google.com/document/d/10IM7fcAbB2tqRGuwfGvuEGUzD_IXbgXPDK0tfxN4M3o/pub">Primes whose base c expansion is also the base b expansion of a prime</a>
%F Numbers n such that A049084(n)>0 and A049084(A007090(n))>0. - _R. J. Mathar_, Jun 15 2007
%e The decimal prime 29 in base 4 is 131 which is again a prime in base 10.
%e E.g., 509_10 = 13331_4 is prime but also 13331_10.
%p A007090 := proc(n) local b4digs ; b4digs := convert(n,base,4) ; add( op(i,b4digs)*10^(i-1),i=1..nops(b4digs)) ; end: isA065722 := proc(n) local rebase ; if isprime(n) then rebase := A007090(n) ; RETURN(isprime(rebase)) ; else RETURN(false) ; fi ; end: for n from 1 to 1000 do p := ithprime(n) : if isA065722(p) then printf("%d, ",p) ; fi : od : # _R. J. Mathar_, Jun 15 2007
%t Select[ Range[505], PrimeQ[ # ] && PrimeQ[ FromDigits[ IntegerDigits[ #, 4]]] & ]
%o (PARI) isok(p)={ isprime(p) && isprime(fromdigits(digits(p,4))) } \\ _Harry J. Smith_, Oct 27 2009
%Y Cf. A065720-A065727, A065361.
%Y Cf. A004678, A107715, A090707.
%K nonn,base
%O 1,1
%A _Patrick De Geest_, Nov 15 2001
%E Edited by _N. J. A. Sloane_, Jul 02 2008 at the suggestion of _R. J. Mathar_