OFFSET
1,8
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
Pairs (p,q) of successive primes with p+q<=27: {(2,3), (3,5), (5,7), (7,11), (11,13)}, hence a(27)=5.
MAPLE
f:= proc(n) local p;
if n <= 4 then return 0 fi;
p:= prevprime(ceil(n/2));
if p + nextprime(p) <= n then numtheory:-pi(p) else numtheory:-pi(p)-1 fi
end proc:
map(f, [$1..100]); # Robert Israel, Dec 08 2024
MATHEMATICA
With[{t=Total/@Partition[Prime[Range[100]], 2, 1]}, Table[Count[t, _?(#<=n&)], {n, 100}]] (* Harvey P. Dale, Apr 16 2015 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Oct 14 2002
STATUS
approved