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.

A048610 Smallest number that is the sum of two positive squares in >= n ways.

Original entry on oeis.org

2, 50, 325, 1105, 5525, 5525, 27625, 27625, 71825, 138125, 160225, 160225, 801125, 801125, 801125, 801125, 2082925, 2082925, 4005625, 4005625, 5928325, 5928325, 5928325, 5928325, 29641625, 29641625, 29641625, 29641625, 29641625, 29641625
Offset: 1

Views

Author

Keywords

Examples

			2 = 1^2 + 1^2; 50 = 1^2 + 7^2 = 5^2 + 5^2; 325 = 1^2 + 18^2 = 6^2 + 17^2 = 10^2 + 15^2.
		

References

  • J.-M. De Koninck, Ces nombres qui nous fascinent, Entry 50, p. 19, Ellipses, Paris 2008.
  • J. Meeus, Problem 1375, J. Rec. Math., 18 (No. 1, 1985), p. 70.
  • Problem 590, J. Rec. Math., 11 (No. 2, 1978), p. 137.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Mathematica
    (* Assuming a(n) multiple of 1105, from 1105 on, to speed up computation *) twoSquaresR[n_] := twoSquaresR[n] = With[{r = Reduce[0 < x <= y && n == x^2 + y^2, {x, y}, Integers]}, If[r === False, 0, Length[{x, y} /. {ToRules[r]}]]]; a[n_] := a[n] = For[an = a[n - 1], True, an = If[an < 1105, an + 1, an + 1105], If[ twoSquaresR[an] >= n, Return[an]]];a[1] = 2; Table[ Print[a[n]]; a[n], {n, 1, 30}] (* Jean-François Alcover, Jun 22 2012 *)
    nn = 10^6; t2 = Table[0, {nn}]; n2 = Floor[Sqrt[nn]]; Do[r = a^2 + b^2; If[r <= nn, t2[[r]]++], {a, n2}, {b, a, n2}]; t = {}; n = 1; While[a = Position[t2, ?(# >= n &), 1, 1]; a != {}, AppendTo[t, a[[1, 1]]]; n++]; t (* _T. D. Noe, Jun 22 2012 *)