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 A002479 M0547 N0197 #78 Jan 21 2025 11:23:55 %S A002479 0,1,2,3,4,6,8,9,11,12,16,17,18,19,22,24,25,27,32,33,34,36,38,41,43, %T A002479 44,48,49,50,51,54,57,59,64,66,67,68,72,73,75,76,81,82,83,86,88,89,96, %U A002479 97,98,99,100,102,107,108,113,114,118,121,123,128,129,131 %N A002479 Numbers of the form x^2 + 2*y^2. %C A002479 A positive number k belongs to this sequence if and only if every prime p == 5, 7 (mod 8) dividing k occurs to an even power. - Sharon Sela (sharonsela(AT)hotmail.com), Mar 23 2002 %C A002479 Norms of numbers in Z[sqrt(-2)]. - _Alonso del Arte_, Sep 23 2014 %C A002479 Euler (E256) shows that these numbers are closed under multiplication, according to the Euler Archive. - _Charles R Greathouse IV_, Jun 16 2016 %C A002479 In addition to the previous comment: The proof was already given 1100 years before Euler by Brahmagupta's identity (a^2 + m*b^2)*(c^2 + m*d^2) = (a*c - m*b*d)^2 + m*(a*d + b*c)^2. - _Klaus Purath_, Oct 07 2023 %D A002479 L. Euler, (E388) Vollstaendige Anleitung zur Algebra, Zweiter Theil, reprinted in: Opera Omnia. Teubner, Leipzig, 1911, Series (1), Vol. 1, p. 421. %D A002479 D. H. Lehmer, Guide to Tables in the Theory of Numbers. Bulletin No. 105, National Research Council, Washington, DC, 1941, p. 59. %D A002479 N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence). %D A002479 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence). %H A002479 N. J. A. Sloane, <a href="/A002479/b002479.txt">Table of n, a(n) for n = 1..3148</a> (first 1000 terms from T. D. Noe) %H A002479 L. Euler, <a href="http://www.mathematik.uni-bielefeld.de/~sieben/euler/euler_2.djvu">Vollstaendige Anleitung zur Algebra, Zweiter Teil</a>. %H A002479 L. Euler, (E256) <a href="http://eulerarchive.maa.org/pages/E256.html">Specimen de usu observationum in mathesi pura</a>, Novi Commentarii academiae scientiarum Petropolitanae 6 (1761), pp. 185-230. %H A002479 N. J. A. Sloane et al., <a href="https://oeis.org/wiki/Binary_Quadratic_Forms_and_OEIS">Binary Quadratic Forms and OEIS</a> (Index to related sequences, programs, references) %p A002479 lis:={}; M:=50; M2:=M^2; %p A002479 for x from 0 to M do for y from 0 to M do %p A002479 if x^2+2*y^2 <= M2 then lis:={op(lis),x^2+2*y^2}; fi; od: od: %p A002479 sort(convert(lis,list)); # _N. J. A. Sloane_, Apr 30 2015 %t A002479 q = 16; imax = q^2; Select[Union[Flatten[Table[x^2 + 2y^2, {y, 0, q/Sqrt[2]}, {x, 0, q}]]], # <= imax &] (* _Vladimir Joseph Stephan Orlovsky_, Apr 20 2011 *) %t A002479 Union[#[[1]]+2#[[2]]&/@Tuples[Range[0,10]^2,2]] (* _Harvey P. Dale_, Nov 24 2014 *) %o A002479 (PARI) is(n)=my(f=factor(n));for(i=1,#f[,1],if(f[i,1]%8>4 && f[i,2]%2, return(0)));1 \\ _Charles R Greathouse IV_, Nov 20 2012 %o A002479 (PARI) list(lim)=my(v=List()); for(a=0,sqrtint(lim\=1), for(b=0,sqrtint((lim-a^2)\2), listput(v,a^2+2*b^2))); Set(v) \\ _Charles R Greathouse IV_, Jun 16 2016 %o A002479 (Haskell) %o A002479 a002479 n = a002479_list !! (n-1) %o A002479 a002479_list = 0 : filter f [1..] where %o A002479 f x = all (even . snd) $ filter ((`elem` [5,7]) . (`mod` 8) . fst) $ %o A002479 zip (a027748_row x) (a124010_row x) %o A002479 -- _Reinhard Zumkeller_, Feb 20 2014 %o A002479 (Magma) [n: n in [0..131] | NormEquation(2, n) eq true]; // _Arkadiusz Wesolowski_, May 11 2016 %o A002479 (Python) %o A002479 from itertools import count, islice %o A002479 from sympy import factorint %o A002479 def A002479_gen(): # generator of terms %o A002479 return filter(lambda n:all(p & 7 < 5 or e & 1 == 0 for p, e in factorint(n).items()),count(0)) %o A002479 A002479_list = list(islice(A002479_gen(),30)) # _Chai Wah Wu_, Jun 27 2022 %Y A002479 Complement of A097700. Subsequence of A000408. For primes see A033203. %Y A002479 Cf. A035251, A027748, A124010, A003628. %K A002479 easy,nonn,nice %O A002479 1,3 %A A002479 _N. J. A. Sloane_