login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A230263 Number of nonnegative integer solutions to the equation x^2 - 4*y^2 = n. 4
1, 0, 0, 1, 1, 0, 0, 0, 2, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 2, 0, 0, 0, 2, 0, 0, 1, 1, 0, 0, 1, 2, 0, 0, 2, 1, 0, 0, 0, 1, 0, 0, 1, 3, 0, 0, 1, 2, 0, 0, 1, 1, 0, 0, 0, 2, 0, 0, 2, 1, 0, 0, 2, 2, 0, 0, 1, 2, 0, 0, 0, 1, 0, 0, 1, 2, 0, 0, 1, 3, 0, 0, 2, 2, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,9

COMMENTS

For (x, y) to be a solution to the more general equation x^2 - d^2*y^2 = n, it can be shown that n-f^2 must be divisible by 2*f*d, where f is a divisor of n not exceeding sqrt(n). Then y = (n-f^2)/(2*f*d) and x = d*y+f.

LINKS

Bruno Berselli, Table of n, a(n) for n = 1..1000

EXAMPLE

a(9) = 2 because x^2 - 4*y^2 = 9 has two nonnegative integer solutions: (x,y) = (5,2) and (3,0).

PROG

(PARI) a(n) = sumdiv(n, f, f^2<=n && (n-f^2)%(4*f)==0);

(MAGMA) d:=2; solutions:=func<i | [f: f in Divisors(i) | f le Isqrt(i) and IsZero((i-f^2) mod (2*f*d))]>; [#solutions(n): n in [1..100]]; // Bruno Berselli, Oct 16 2013

CROSSREFS

Cf. A034178, A230239, A230264.

Sequence in context: A170957 A178725 A257402 * A139354 A124762 A258590

Adjacent sequences:  A230260 A230261 A230262 * A230264 A230265 A230266

KEYWORD

nonn

AUTHOR

Colin Barker, Oct 14 2013

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 2 17:49 EDT 2021. Contains 346428 sequences. (Running on oeis4.)