OFFSET
1,4
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = Sum_{k=1..floor(n/2)} k*(n-k)*c(k), where c is the prime characteristic (A010051).
EXAMPLE
a(6) = 17; the rectangles are 2 X 4 and 3 X 3. The total area of both rectangles is then 2*4 + 3*3 = 8 + 9 = 17.
MAPLE
P:= select(isprime, [2, seq(i, i=3..50, 2)]):
f:= proc(n) local p, m, i;
m:= ListTools:-BinaryPlace(P, (n+1)/2);
add(P[i]*(n-P[i]), i=1..m)
end proc:
map(f, [$1..100]); # Robert Israel, Dec 21 2022
MATHEMATICA
Table[Sum[i*(n-i) (PrimePi[i] - PrimePi[i-1]), {i, Floor[n/2]}], {n, 60}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Wesley Ivan Hurt, Apr 27 2021
STATUS
approved