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!)
A330407 Number of ordered integer pairs (b,c) with -n <= b <= n and -n <= c <= n such that both roots of x^2 + b*x + c = 0 are distinct integers. 0

%I #28 Jan 30 2020 17:45:54

%S 0,3,7,13,20,26,36,42,52,59,69,75,89,95,105,115,126,132,146,152,166,

%T 176,186,192,210,217,227,237,251,257,275,281,295,305,315,325,344,350,

%U 360,370,388,394,412,418,432,446,456,462,484,491,505,515,529,535,553,563,581

%N Number of ordered integer pairs (b,c) with -n <= b <= n and -n <= c <= n such that both roots of x^2 + b*x + c = 0 are distinct integers.

%F a(n) = A067274(n) - A001650(n+1) for n > 1.

%e For n = 1, the a(1) = 3 equations are x^2 - x = 0, x^2 + x = 0, and x^2 - 1 = 0.

%e For n = 2, the a(2) = 7 equations are the 3 equations listed above and x^2 - 2x = 0, x^2 + 2x = 0, x^2 - x - 2 = 0, and x^2 + x - 2 = 0.

%t ok[b_, c_] := Block[{d = b^2 - 4 c}, d > 0 && IntegerQ@ Sqrt@ d]; a[n_] := Sum[ Boole@ ok[b, c], {b, -n, n}, {c, -n, n}]; Array[a, 57, 0] (* _Giovanni Resta_, Jan 28 2020 *)

%o (Python 3.7) [sum([1 for b in range(-n, n+1) for c in range(-n,n+1) if b**2-4*c > 0 and int((-b+(b**2-4*c)**0.5)/2) == (-b+(b**2-4*c)**0.5)/2]) for n in range(0,101)]

%o (PARI) isok(b,c) = (b^2 > 4*c) && issquare(b^2-4*c);

%o a(n) = sum(b=-n, n, sum(c=-n, n, isok(b,c))); \\ _Michel Marcus_, Jan 28 2020

%Y Cf. A001650, A067274.

%K nonn

%O 0,2

%A _Alexander Piperski_, Jan 25 2020

%E a(0)=0 prepended by _Michel Marcus_, Jan 30 2020

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 May 1 02:59 EDT 2024. Contains 372148 sequences. (Running on oeis4.)