|
|
A046711
|
|
From the Bruck-Ryser theorem: numbers n == 1 or 2 (mod 4) which are also the sum of 2 squares.
|
|
4
|
|
|
1, 2, 5, 9, 10, 13, 17, 18, 25, 26, 29, 34, 37, 41, 45, 49, 50, 53, 58, 61, 65, 73, 74, 81, 82, 85, 89, 90, 97, 98, 101, 106, 109, 113, 117, 121, 122, 125, 130, 137, 145, 146, 149, 153, 157, 162, 169, 170, 173, 178, 181, 185, 193, 194, 197, 202, 205, 218, 221, 225
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
|
|
REFERENCES
|
M. Hall, Jr., Combinatorial Theory, Theorem 12.3.2.
|
|
LINKS
|
|
|
MATHEMATICA
|
max = 225; Flatten[ Table[ a^2 + b^2, {a, 0, Sqrt[max]}, {b, a, Sqrt[max - a^2]}], 1] // Union // Select[#, (1 <= Mod[#, 4] <= 2)& ]& (* Jean-François Alcover, Sep 13 2012 *)
With[{max=15}, Select[Select[Total/@Tuples[Range[0, max]^2, 2], MemberQ[ {1, 2}, Mod[ #, 4]]&]//Union, #<=max^2&]] (* Harvey P. Dale, Jan 14 2017 *)
|
|
PROG
|
(Haskell)
a046711 n = a046711_list !! (n-1)
a046711_list = [x | x <- a042963_list, a000161 x > 0]
(Python)
from itertools import count, islice
from sympy import factorint
def A046711_gen(): # generator of terms
return filter(lambda n:0 < n & 3 < 3 and all(p & 3 != 3 or e & 1 == 0 for p, e in factorint(n).items()), count(0))
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy,nice
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|