cp's OEIS Frontend

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.

A198775 Numbers having exactly four representations by the quadratic form x^2+xy+y^2 with 0<=x<=y.

This page as a plain text file.
%I A198775 #22 May 16 2022 16:43:10
%S A198775 1729,2821,3367,3913,4123,4459,4921,5187,5551,5719,6097,6517,6643,
%T A198775 6916,7189,7657,8029,8113,8463,8827,8911,9139,9331,9373,9709,9919,
%U A198775 10101,10507,10621,10633,11137,11284,11557,11739,12369,12649,12691,12901,13237,13377
%N A198775 Numbers having exactly four representations by the quadratic form x^2+xy+y^2 with 0<=x<=y.
%C A198775 A088534(a(n)) = 4; subsequence of A118886, see also A003136.
%H A198775 Chai Wah Wu, <a href="/A198775/b198775.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..250 from Reinhard Zumkeller).
%e A198775 a(1) = 1729 = 3^2+3*40+40^2 = 8^2+8*37+37^2 = 15^2+15*32+32^2 = 23^2+23*25+25^2, A088534(1729) = 4;
%e A198775 a(10) = 5719 = 5^2+5*73+73^2 = 15^2+15*67+67^2 = 18^2+18*65+65^2 = 37^2+37*50+50^2, A088534(5719) = 4;
%e A198775 a(100) = 23779 = 17^2+17*145+145^2 = 30^2+30*137+137^2 = 50^2+50*123+123^2 = 85^2+85*93+93^2, A088534(23779) = 4.
%t A198775 amax = 20000; 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}];
%t A198775 A198775 = Select[Range[0, 3 xmax^2], # <= amax && f[#] == 4&] (* _Jean-François Alcover_, Jun 21 2018 *)
%o A198775 (Haskell)
%o A198775 a198775 n = a198775_list !! (n-1)
%o A198775 a198775_list = filter ((== 4) . a088534) a003136_list
%o A198775 (Python)
%o A198775 from itertools import count, islice
%o A198775 def A198775_gen(startvalue=1): # generator of terms >= startvalue
%o A198775     for n in count(max(startvalue,1)):
%o A198775         c = 0
%o A198775         for y in range(n+1):
%o A198775             if c > 4 or y**2 > n:
%o A198775                 break
%o A198775             for x in range(y+1):
%o A198775                 z = x*(x+y)+y**2
%o A198775                 if z > n:
%o A198775                     break
%o A198775                 elif z == n:
%o A198775                     c += 1
%o A198775                     if c > 4:
%o A198775                         break
%o A198775         if c == 4:
%o A198775             yield n
%o A198775 A198775_list = list(islice(A198775_gen(),10)) # _Chai Wah Wu_, May 16 2022
%Y A198775 Cf. A198772, A198773, A198774.
%K A198775 nonn
%O A198775 1,1
%A A198775 _Reinhard Zumkeller_, Oct 30 2011