login
Numbers of the form 4x^2+2xy+7y^2, x, y >= 0.
3

%I #13 Jul 06 2018 09:15:43

%S 0,4,7,13,16,27,28,36,49,52,63,64,73,76,79,91,100,108,112,117,124,144,

%T 148,151,163,172,175,189,193,196,208,211,217,241,243,252,256,268,279,

%U 292,301,304,316,324,325,343,349,361,364,367,379,387

%N Numbers of the form 4x^2+2xy+7y^2, x, y >= 0.

%H Reinhard Zumkeller, <a href="/A219907/b219907.txt">Table of n, a(n) for n = 1..10000</a>

%H W. C. Jagy, <a href="https://www.jstor.org/stable/10.4169/amer.math.monthly.119.10.880">Problem 11539</a>, Amer. Math. Monthly, 119 (2012), 884-885.

%o (Haskell)

%o import Data.Set (deleteFindMin, empty, fromList, union)

%o import qualified Data.Set as Set (null)

%o a219907 n = a219907_list !! (n-1)

%o a219907_list = f 0 empty where

%o f z s | Set.null s || z' <= m = f (z + 1) (s `union` (fromList ws))

%o | otherwise = m : f z s'

%o where (m,s') = deleteFindMin s

%o ws = map (h z) [0..z] ++ map (flip h z) [0..z-1]

%o h i j = 4 * i ^ 2 + 2 * i * j + 7 * j ^ 2

%o z' = h z 0

%o -- _Reinhard Zumkeller_, Dec 15 2012

%Y Cf. A219908.

%K nonn

%O 1,2

%A _N. J. A. Sloane_, Dec 14 2012