login
A295819
Number of nonnegative solutions to (x,y) = 1 and x^2 + y^2 = n.
4
0, 2, 1, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 4, 0, 0
OFFSET
0,2
LINKS
FORMULA
a(n) = A000089(n) for n >= 2.
a(A006278(n)) = 2^n for n >= 1.
EXAMPLE
a(1) = 2;
(1,0) = 1 and 1^2 + 0^2 = 1.
(0,1) = 1 and 0^2 + 1^2 = 1.
a(2) = 1;
(1,1) = 1 and 1^2 + 1^2 = 2. -> 1^2 + 1^2 == 1^2 + 1 == 0 mod 2.
a(5) = 2;
(2,1) = 1 and 2^2 + 1^2 = 5. -> 2^2 + 1^2 == 2^2 + 1 == 0 mod 5.
(1,2) = 1 and 1^2 + 2^2 = 5. -> 3^2 + 6^2 == 3^2 + 1 == 0 mod 5.
a(10) = 2;
(3,1) = 1 and 3^2 + 1^2 = 10. -> 3^2 + 1^2 == 3^2 + 1 == 0 mod 10.
(1,3) = 1 and 1^2 + 3^2 = 10. -> 7^2 + 21^2 == 7^2 + 1 == 0 mod 10.
a(13) = 2;
(3,2) = 1 and 3^2 + 2^2 = 13. -> 21^2 + 14^2 == 8^2 + 1 == 0 mod 13.
(2,3) = 1 and 2^2 + 3^2 = 13. -> 18^2 + 27^2 == 5^2 + 1 == 0 mod 13.
MATHEMATICA
a[n_] := Sum[j = Sqrt[n - i^2] // Floor; Boole[GCD[i, j] == 1 && i^2 + j^2 == n], {i, 0, Sqrt[n]}];
Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Jul 05 2018, after Andrew Howroyd *)
PROG
(PARI) a(n) = {sum(i=0, sqrtint(n), my(j=sqrtint(n-i^2)); gcd(i, j)==1 && i^2+j^2==n)} \\ Andrew Howroyd, Dec 12 2017
CROSSREFS
Cf. A006278.
Similar sequences: A000010, A000925, A295820, A295848, A295976.
A000089 is essentially the same sequence.
Sequence in context: A110855 A054673 A155103 * A048105 A360012 A363806
KEYWORD
nonn
AUTHOR
Seiichi Manyama, Nov 28 2017
STATUS
approved