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.

A216672 Total number of solutions to the equation x^2 + k*y^2 = n with x > 0, y > 0, k > 0. (Order does not matter for the equation x^2 + y^2 = n.)

This page as a plain text file.
%I A216672 #20 May 26 2019 18:56:44
%S A216672 0,1,1,1,2,2,2,3,3,3,3,4,5,3,3,4,6,5,5,6,6,5,4,6,7,5,6,8,8,5,6,8,9,7,
%T A216672 5,9,10,6,6,10,11,6,8,9,11,7,6,10,11,8,8,14,11,10,8,10,13,9,8,10,14,7,
%U A216672 9,12,14,9,10,14,12,10,8,15,17,9,9,16,12,8,11
%N A216672 Total number of solutions to the equation x^2 + k*y^2 = n with x > 0, y > 0, k > 0. (Order does not matter for the equation x^2 + y^2 = n.)
%C A216672 If the equation x^2 + y^2 = n has two solutions (x, y), (y, x) then they will be counted only once.
%C A216672 No solutions can exist for the values of k >= n.
%C A216672 This sequence differs from A216503 since this sequence gives the total number of solutions to the equation x^2 + k*y^2 = n, whereas the sequence A216503 gives the number of distinct values of k for which a solution to the equation x^2 + k*y^2 = n can exist.
%C A216672 Some values of k can clearly have more than one solution.
%C A216672 For example, x^2 + k*y^2 = 33 is satisfiable for
%C A216672 33 = 1^2 + 2*4^2.
%C A216672 33 = 5^2 + 2*2^2.
%C A216672 33 = 3^2 + 6*2^2.
%C A216672 33 = 1^2 + 8*2^2.
%C A216672 33 = 5^2 + 8*1^2.
%C A216672 33 = 4^2 + 17*1^2.
%C A216672 33 = 3^2 + 24*1^2.
%C A216672 33 = 2^2 + 29*1^2.
%C A216672 33 = 1^2 + 32*1^2.
%C A216672 So for this sequence a(33) = 9.
%C A216672 On the other hand, for the sequence A216503, there exist only 7 different values of k for which a solution to the equation mentioned above exists.
%C A216672 So A216503(33) = 7.
%H A216672 T. D. Noe, <a href="/A216672/b216672.txt">Table of n, a(n) for n = 1..1000</a>
%t A216672 nn = 100; t = Table[0, {nn}]; Do[n = x^2 + k*y^2; If[n <= nn && (k > 1 || k == 1 && x <= y), t[[n]]++], {x, Sqrt[nn]}, {y, Sqrt[nn]}, {k, nn}] (* _T. D. Noe_, Sep 20 2012 *)
%o A216672 (PARI) for(n=1, 100, sol=0; for(k=1, n, for(x=1, n, if((issquare(n-k*x*x)&&n-k*x*x>0&&k>=2)||(issquare(n-x*x)&&n-x*x>0&&k==1&&x*x<=n-x*x), sol++))); print1(sol", ")) /* _V. Raman_, Oct 16 2012 */
%Y A216672 Cf. A216503, A216504, A216505.
%Y A216672 Cf. A217834 (a variant of this sequence, when the order does matter for the equation x^2+y^2 = n, i.e. if the equation x^2+y^2 = n has got two solutions (x, y), (y, x) then they will be counted separately).
%Y A216672 Cf. A216673, A216674, A217834, A217840, A217956.
%K A216672 nonn
%O A216672 1,5
%A A216672 _V. Raman_, Sep 13 2012
%E A216672 Ambiguity in name corrected by _V. Raman_, Oct 16 2012