A154800 List of pairs of primes that are equidistant from and nearest to n, or the pair (0,0) if there is no such pair.
0, 0, 0, 0, 0, 0, 3, 5, 3, 7, 5, 7, 3, 11, 5, 11, 7, 11, 7, 13, 5, 17, 11, 13, 7, 19, 11, 17, 13, 17, 13, 19, 11, 23, 17, 19, 7, 31, 17, 23, 19, 23, 13, 31, 17, 29, 19, 29, 19, 31, 23, 29, 23, 31, 19, 37, 17, 41, 29, 31, 19, 43, 23, 41, 29, 37, 31, 37, 29, 41, 31, 41, 31, 43, 29, 47
Offset: 1
Examples
Array begins: n ............... Pair 1 .............. 0 . 0 2 .............. 0 . 0 3 .............. 0 . 0 4 .............. 3 . 5 5 ............ 3 . . . 7 6 .............. 5 . 7 7 ........ 3 . . . . . . . 11 8 .......... 5 . . . . . 11 9 ............ 7 . . . 11 10 ......... 7 . . . . . 13
Programs
-
Maple
A154800 := proc(n) local d; for d from 1 to n-1 do if isprime(n-d) and isprime(n+d) then printf("%d,%d,",n-d,n+d); RETURN() ; fi; od: printf("0,0,") ; end: seq(A154800(n),n=1..80) ; # R. J. Mathar, Jul 13 2009
Extensions
More terms from R. J. Mathar, Jul 13 2009
Comments