A086002 Primes which when added to their own rotation yield a prime.
229, 239, 241, 257, 269, 271, 277, 281, 439, 443, 463, 467, 479, 499, 613, 641, 653, 661, 673, 677, 683, 691, 811, 823, 839, 863, 881, 10111, 10151, 10169, 10181, 10243, 10247, 10253, 10267, 10303, 10313, 10331, 10343, 10391, 10429, 10453, 10457
Offset: 1
Examples
a(100)=12917 because (i) 12917 is prime and (ii) rotate(12917) = 17912 and 12917+17912=30829, which is also prime.
Links
- Chai Wah Wu, Table of n, a(n) for n = 1..10000
Programs
-
Maple
A055642 := proc(n) max(1,1+ilog10(n)) ; end: rot := proc(n) local d,dl,dh,pre,suf ; d := A055642(n) ; dl := floor( d/2) ; dh := floor( (d+1)/2) ; pre := floor(n/10^dh) ; suf := n mod 10^dl ; if dl <> dh then suf*10^dh+pre+10^dl*( floor(n/10^dl) mod 10) ; else suf*10^dh+pre ; fi; end: isA086002 := proc(p) if isprime(p) then isprime(p+rot(p)) ; else false; fi; end: for n from 1 to 1500 do p := ithprime(n) ; if isA086002(p) then printf("%d,",p) ; fi; od: # R. J. Mathar, May 27 2009
-
Mathematica
rot[n_]:=Module[{idn=IntegerDigits[n],len},len=Length[idn];If[OddQ[len],FromDigits[ Join[Take[idn,-Floor[len/2]],{idn[[(len+1)/2]]},Take[idn,Floor[len/2]]]],FromDigits[ Join[ Take[ idn,-len/2],Take[idn,len/2]]]]]; Select[Prime[Range[1500]],PrimeQ[ #+rot[#]]&] (* Harvey P. Dale, Apr 26 2022 *)
Extensions
Edited by R. J. Mathar, May 27 2009
Comments