cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

User: Alexander Piperski

Alexander Piperski's wiki page.

Alexander Piperski has authored 1 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.

Original entry on oeis.org

0, 3, 7, 13, 20, 26, 36, 42, 52, 59, 69, 75, 89, 95, 105, 115, 126, 132, 146, 152, 166, 176, 186, 192, 210, 217, 227, 237, 251, 257, 275, 281, 295, 305, 315, 325, 344, 350, 360, 370, 388, 394, 412, 418, 432, 446, 456, 462, 484, 491, 505, 515, 529, 535, 553, 563, 581
Offset: 0

Author

Alexander Piperski, Jan 25 2020

Keywords

Examples

			For n = 1, the a(1) = 3 equations are x^2 - x = 0, x^2 + x = 0, and x^2 - 1 = 0.
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.
		

Crossrefs

Programs

  • Mathematica
    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 *)
  • PARI
    isok(b,c) = (b^2 > 4*c) && issquare(b^2-4*c);
    a(n) = sum(b=-n, n, sum(c=-n, n, isok(b,c))); \\ Michel Marcus, Jan 28 2020

Formula

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

Extensions

a(0)=0 prepended by Michel Marcus, Jan 30 2020