Integers of the form $a^2-b^2$? I would like to know if there is a formula to calculate the cardinality of the set of all the numbers of the form $a^2-b^2$ such that $a^2-b^2\leq n$ and $b\leq a$.
Numerically I found something around $3n/4$.
Thanks!

Observe that $a^2-b^2\equiv 0,1,3\pmod4$, and every number $r\equiv 0,1,3\pmod4$ has a representation of the above form. For the proof observe following two identities
$$
(k+1)^2-k^2=2k+1,(k+1)^2-(k-1)^2=4k
$$
