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.
%I A000050 M0715 N0265 #40 Dec 19 2022 10:17:28 %S A000050 1,2,3,5,9,16,29,54,97,180,337,633,1197,2280,4357,8363,16096,31064, %T A000050 60108,116555,226419,440616,858696,1675603,3273643,6402706,12534812, %U A000050 24561934,48168461,94534626,185661958,364869032,717484560,1411667114,2778945873,5473203125 %N A000050 Number of positive integers <= 2^n of form x^2 + y^2. %D A000050 N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence). %D A000050 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence). %H A000050 Seth A. Troisi, <a href="/A000050/b000050.txt">Table of n, a(n) for n = 0..50</a> (terms 0..35 from N. J. A. Sloane) %H A000050 P. Moree and H. J. J. te Riele, <a href="https://arxiv.org/abs/math/0204332">The hexagonal versus the square lattice</a>, arXiv:math/0204332 [math.NT], 2002. %H A000050 P. Moree and H. J. J. te Riele, <a href="http://dx.doi.org/10.1090/S0025-5718-03-01556-4">The hexagonal versus the square lattice</a>, Math. Comp. 73 (2004), no. 245, 451-473. %H A000050 D. Shanks and L. P. Schmid, <a href="http://dx.doi.org/10.1090/S0025-5718-1966-0210678-1">Variations on a theorem of Landau. Part I</a>, Math. Comp., 20 (1966), 551-569. %H A000050 Seth A. Troisi, <a href="https://github.com/sethtroisi/OEIS/tree/main/A000050">C++ program</a> %H A000050 <a href="/index/Qua#quadpop">Index entries for sequences related to populations of quadratic forms</a> %e A000050 There are 5 integers <= 2^3 of the form x^2 + y^2. The five (x,y) pairs (x <= y) are (0,1), (1,1), (0,2), (1,2), (2,2) and give the integers 1, 2, 4, 5, 8, respectively. So a(3) = 5. - _Seth A. Troisi_, Apr 27 2022 %t A000050 (* This program is not suitable for a large number of terms *) a[0] = 1; a[n_] := a[n] = (For[cnt = 0; k = 2^(n-1)+1, k <= 2^n, k++, If[SquaresR[2, k] > 0, cnt++]]; cnt + a[n-1]); Table[Print["a(", n, ") = ", a[n]]; a[n], {n, 0, 26}] (* _Jean-François Alcover_, Mar 20 2014 *) %o A000050 (Haskell) %o A000050 isqrt = a000196 %o A000050 issquare = a010052 %o A000050 a000050 n = foldl f 0 [1..2^n] %o A000050 where f i j = if a000050' j > 0 then i + 1 else i %o A000050 a000050' k = foldl f 0 (h k) %o A000050 where f i y = g y + i %o A000050 where g y = issquare (k - y^2) %o A000050 h k = [0..isqrt k] %o A000050 -- _James Spahlinger_, Oct 09 2012 %Y A000050 Cf. A001481. %K A000050 nonn %O A000050 0,2 %A A000050 _N. J. A. Sloane_