OFFSET
1,7
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
Wikipedia, Integer Triangle
FORMULA
a(n) = Sum_{k=1..floor(n/3)} Sum_{i=k..floor((n-k)/2)} sign(floor((i+k)/(n-i-k+1))) * c(n-i-k), where c(n) is the prime characteristic (A010051).
MAPLE
f:= proc(n) local p, v;
v:= add(1/2*(3*p-n+1)+`if`((n-p)::even, 1/2, 0), p = select(isprime, [$ceil(n/3)..floor((n-1)/2)]));
end proc:
map(f, [$1..100]); # Robert Israel, May 28 2019
MATHEMATICA
Table[Sum[Sum[ (PrimePi[n - i - k] - PrimePi[n - i - k - 1]) Sign[Floor[(i + k)/(n - i - k + 1)]], {i, k, Floor[(n - k)/2]}], {k, Floor[n/3]}], {n, 100}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Wesley Ivan Hurt, May 27 2019
STATUS
approved