A100073 Number of representations of n as the difference of two positive squares.
0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 2, 1, 1, 0, 1, 1, 2, 0, 1, 2, 1, 0, 2, 1, 1, 0, 1, 2, 2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 1, 1, 3, 0, 1, 3, 1, 0, 2, 1, 1, 0, 2, 2, 2, 0, 1, 2, 1, 0, 3, 2, 2, 0, 1, 1, 2, 0, 1, 3, 1, 0, 3, 1, 2, 0, 1, 3, 2, 0, 1, 2, 2, 0, 2, 2, 1, 0, 2, 1, 2, 0, 2, 4, 1, 0, 3, 1, 1, 0, 1, 2, 4
Offset: 1
Examples
a(15) = 2 because 15 = 16 - 1 = 64 - 49.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
- A. Tripathi, On Pythagorean triples containing a fixed integer, Fib. Q., 46/47 (2008/2009), 331-340. See Theorem 5.
- Christian Aebi and Grant Cairns, Lattice equable quadrilaterals III: tangential and extangential cases, Integers (2023) Vol. 23, #A48.
Crossrefs
Programs
-
Maple
A100073:= proc(n) if n::odd then floor(numtheory:-tau(n)/2) elif (n/2)::odd then 0 else floor(numtheory:-tau(n/4)/2) fi end proc: map(A100073, [$1..200]); # Robert Israel, Jul 10 2018
-
Mathematica
nn=150; a=Table[0, {nn}]; Do[y=x-1; While[d=x^2-y^2; d<=nn&&y>0, a[[d]]++; y-- ], {x, 1+nn/2}]; a
-
PARI
a(n) = if (n % 2, ceil((numdiv(n)-1)/2), if (!(n%4), ceil((numdiv(n/4)-1)/2), 0)); \\ Michel Marcus, Mar 07 2016
-
PARI
A100073(n)=if(bittest(n,0),numdiv(n)\2,!bittest(n,1),numdiv(n\4)\2) \\ or shorter: a(n)=if(n%4!=2,numdiv(n\4^!(n%2))\2) \\ - M. F. Hasler, Jul 10 2018
Comments