OFFSET
1,2
COMMENTS
LINKS
Zhi-Wei Sun, Table of n, a(n) for n = 1..10000
EXAMPLE
a(2) = 2 since 2 = pi(1*2/2) + pi(2^2) = pi(2*3/2) + pi(1^2).
a(3) = 1 since 3 = pi(3*4/2) + pi(1^2).
a(5) = 1 since 5 = pi(3*4/2) + pi(2^2).
a(7) = 1 since 7 = pi(3*4/2) + pi(3^2).
a(35) = 1 since 35 = pi(13*14/2) + pi(6^2).
a(37) = 1 since 37 = pi(3*4/2) + pi(12^2).
a(217) = 1 since 217 = pi(17*18/2) + pi(33^2).
a(590) = 1 since 590 = 58 + 532 = pi(23*24/2) + pi(62^2).
a(7439) = 1 since 7439 = 3854 + 3585 = pi(269*270/2) + pi(183^2).
a(10381) = 1 since 10381 = 1875 + 8506 = pi(179*180/2) + pi(296^2).
MATHEMATICA
s[n_]:=s[n]=PrimePi[n^2]
t[n_]:=t[n]=PrimePi[n(n+1)/2]
Do[r=0; Do[If[s[k]>n, Goto[bb]]; Do[If[t[j]>n-s[k], Goto[aa]]; If[t[j]==n-s[k], r=r+1]; Continue, {j, 1, n-s[k]+1}]; Label[aa]; Continue, {k, 1, n}]; Label[bb]; Print[n, " ", r]; Continue, {n, 1, 100}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, Oct 07 2015
STATUS
approved