OFFSET
1,1
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
EXAMPLE
a(1) = 3 because previousprime(3) + nextprime(3) = 2 + 5 = 7.
a(2) = 13 because previousprime(13) + nextprime(13) = 11 + 17 = 28 = 7 * 4.
a(3) = 61 because previousprime(61) + nextprime(61) = 59 + 67 = 126 = 7 * 18.
a(4) = 71 because previousprime(71) + nextprime(71) = 67 + 73 = 140 = 7 * 20.
MATHEMATICA
For[n = 2, n < 300, n++, If[(Prime[n - 1] + Prime[n + 1])/7 == Floor[(Prime[n - 1] + Prime[n + 1])/7], Print[Prime[n]]]] (* Stefan Steinerberger *)
Prime@Select[Range[2, 298], Mod[Prime[ # - 1] + Prime[ # + 1], 7] == 0 &] (* Robert G. Wilson v, Jan 11 2006 *)
Transpose[Select[Partition[Prime[Range[7000]], 3, 1], Divisible[First[#]+ Last[#], 7]&]][[2]] (* Harvey P. Dale, Jun 11 2013 *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Jonathan Vos Post, Dec 31 2005
EXTENSIONS
More terms from Stefan Steinerberger and Robert G. Wilson v, Jan 02 2006
STATUS
approved