|
Search: id:A086002
|
|
|
| A086002 |
|
Primes which when added to their own rotation yield a prime. |
|
+0 3
|
|
| 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
(list; graph; listen)
|
|
|
OFFSET
|
1,1
|
|
|
COMMENT
|
Rotation results in the suffix and prefix swapping positions around a central pivot. If the number of digits in n is odd, the center digit remains untouched during rotation. So for example the rotation of 1234 is 3412, while the rotation of 12345 is 45312. As a final step, n is added to its own rotation, so rotateAndAdd(12345) = 12345 + 45312 = 57657. This final number is tested for primality.
|
|
FORMULA
|
BEGIN rotateAndAdd(n) Let e = floor(LOG10(n))+1; Let h = floor(e/2); Let prefix = (n mod 10^h) * (10^(e-h)); Let middle = n - (floor(n/(10^(e-h)))*(10^(e-h))) - (n mod 10^h); Let suffix = floor(n / (10^(e-h))); Let rotated = prefix + middle + suffix; Return (n + rotated); END. If isPrime(n) And isPrime(rotateAndAdd(n)) Then sequence.add(n)
|
|
EXAMPLE
|
a(100)=12917 because i. 12917 is prime. ii. rotate(12917) = 17912 and 12917+17912=30829 which is also prime.
|
|
CROSSREFS
|
Cf. A086003, 86004.
Adjacent sequences: A085999 A086000 A086001 this_sequence A086003 A086004 A086005
Sequence in context: A098246 A091551 A033528 this_sequence A061783 A119711 A062589
|
|
KEYWORD
|
base,nonn,uned
|
|
AUTHOR
|
Chuck Seggelin (barkeep(AT)plastereddragon.com), Jul 07 2003
|
|
|
Search completed in 0.002 seconds
|