A198772 Numbers having exactly one representation by the quadratic form x^2 + xy + y^2 with 0 <= x <= y.
0, 1, 3, 4, 7, 9, 12, 13, 16, 19, 21, 25, 27, 28, 31, 36, 37, 39, 43, 48, 52, 57, 61, 63, 64, 67, 73, 75, 76, 79, 81, 84, 93, 97, 100, 103, 108, 109, 111, 112, 117, 121, 124, 127, 129, 139, 144, 148, 151, 156, 157, 163, 171, 172, 175, 181, 183, 189, 192, 193
Offset: 1
Keywords
Examples
a(20) = 48 = 4^2 + 4*4 + 4^2, A088534(48) = 1; a(21) = 52 = 2^2 + 2*6 + 6^2, A088534(52) = 1.
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
Crossrefs
Programs
-
Haskell
a198772 n = a198772_list !! (n-1) a198772_list = filter ((== 1) . a088534) a003136_list
-
Julia
function isA198772(n) M = Int(round(2*sqrt(n/3))) count = 0 for y in 0:M, x in 0:y n == x^2 + y^2 + x*y && (count += 1) count == 2 && break end return count == 1 end A198772list(upto) = [n for n in 0:upto if isA198772(n)] A198772list(193) |> println # Peter Luschny, Mar 17 2018
-
Mathematica
amax = 200; xmax = Sqrt[amax] // Ceiling; Clear[f]; f[_] = 0; Do[q = x^2 + x y + y^2; f[q] = f[q] + 1, {x, 0, xmax}, {y, x, xmax}]; A198772 = Select[Range[0, 3 xmax^2], # <= amax && f[#] == 1&] (* Jean-François Alcover, Jun 21 2018 *)