The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A256452 Number of integer solutions to n^2 = x^2 + y^2 with x>0, y>=0. 2
1, 1, 1, 1, 3, 1, 1, 1, 1, 3, 1, 1, 3, 1, 3, 1, 3, 1, 1, 3, 1, 1, 1, 1, 5, 3, 1, 1, 3, 3, 1, 1, 1, 3, 3, 1, 3, 1, 3, 3, 3, 1, 1, 1, 3, 1, 1, 1, 1, 5, 3, 3, 3, 1, 3, 1, 1, 3, 1, 3, 3, 1, 1, 1, 9, 1, 1, 3, 1, 3, 1, 1, 3, 3, 5, 1, 1, 3, 1, 3, 1, 3, 1, 1, 9, 1, 3 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,5
LINKS
FORMULA
Multiplicative with a(p^e) = 2*e + 1 if p == 1 (mod 4), otherwise a(p^e) = 1.
a(n) = 1 + 2*A046080(n) if n>0.
a(n) = A046109(n)/4 for n > 0. - Hugo Pfoertner, Sep 21 2023
MATHEMATICA
a[ n_] := Sum[ Mod[ Length@Divisors[n^2 - k^2], 2], {k, n}];
a[ n_] := Length @ FindInstance[ n^2 == x^2 + y^2 && x > 0 && y >= 0, {x, y}, Integers, 10^9]; (* Michael Somos, Aug 15 2016 *)
f[p_, e_] := If[Mod[p, 4] == 1, 2*e + 1, 1]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Sep 12 2020 *)
PROG
(PARI) {a(n) = sum(k=1, n, issquare(n^2 - k^2))};
CROSSREFS
Sequence in context: A350559 A365401 A212181 * A330827 A010276 A214268
KEYWORD
nonn,mult
AUTHOR
Michael Somos, Mar 29 2015
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 11 19:21 EDT 2024. Contains 373317 sequences. (Running on oeis4.)