OFFSET
1,1
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
EXAMPLE
a(2) = 41 which is equal to 20+21 and 12+14+15.
MATHEMATICA
composite[ n_Integer ] := (k = n + PrimePi[ n ] + 1; While[ k - PrimePi[ k ] - 1 != n, k++ ]; k); a = {}; Do[ p = composite[ n ] + composite[ n + 1 ]; If[ PrimeQ[ p ], a = Append[ a, p ] ], {n, 1, 1000} ]; b = {}; Do[ p = composite[ n ] + composite[ n + 1 ] + composite[ n + 2 ]; If[ PrimeQ[ p ], b = Append[ b, p ] ], {n, 1, 1000} ]; Intersection[ a, b ]
Module[{cmps=Select[Range[700], CompositeQ], c2, c3}, c2=Total/@Partition[cmps, 2, 1]; c3=Total/@Partition[cmps, 3, 1]; Select[Intersection[c2, c3], PrimeQ]] (* Harvey P. Dale, Nov 12 2022 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert G. Wilson v, Mar 30 2001
STATUS
approved