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.

A217840 Total number of solutions to the equation x^2 + k*y^2 = n with x >= 0, y >= 0, k > 0, or 0 if the number is infinite. Order matters for the equation x^2 + y^2 = n.

This page as a plain text file.
%I A217840 #49 Jan 16 2019 04:14:17
%S A217840 0,2,2,0,4,3,3,5,0,5,4,6,7,4,4,0,8,7,6,9,7,6,5,8,0,7,8,10,10,6,7,11,
%T A217840 10,9,6,0,12,7,7,13,13,7,9,11,14,8,7,13,0,11,9,17,13,12,9,12,14,11,9,
%U A217840 12,16,8,11,0,17,10,11,17,13,11,9,19,19,11,11,18,13,9,12,18,0,13,10,18,20,11,10,18,19,15,13,15,15,12,10,18,22,12,16,0
%N A217840 Total number of solutions to the equation x^2 + k*y^2 = n with x >= 0, y >= 0, k > 0, or 0 if the number is infinite. Order matters for the equation x^2 + y^2 = n.
%C A217840 If the equation x^2 + y^2 = n has two solutions (x, y), (y, x) then they will be counted differently.
%C A217840 No solutions can exist for the values of k > n.
%C A217840 a(n) is the same as A216673(n) when n is not the sum of two positive squares.
%C A217840 But when n is the sum of two positive squares, the ordered pairs for the equation x^2 + y^2 = n count.
%C A217840 For example,
%C A217840 10 = 3^2 + 1^2.
%C A217840 10 = 1^2 + 3^2.
%C A217840 10 = 2^2 + 6*1^2.
%C A217840 10 = 1^2 + 9*1^2.
%C A217840 10 = 0^2 + 10*1^2.
%C A217840 So a(10) = 5. On the other hand, for the sequence A216673, the ordered pair 3^2 + 1^2 and 1^2 + 3^2 will be counted as the same, and so A216673(10) = 4.
%H A217840 Andrew Howroyd, <a href="/A217840/b217840.txt">Table of n, a(n) for n = 1..1000</a>
%F A217840 a(n) = 0 if n is a square, otherwise a(n) = Sum_{k = 0..sqrt(n)} A046951(n-k^2). - _Charlie Neder_, Jan 15 2019
%o A217840 (PARI) for(n=1, 100, sol=0; for(k=1, n, for(x=0, n, if((issquare(n-k*x*x)&&n-k*x*x>=0), sol++))); if(issquare(n),print1(0", "),print1(sol", "))) /* _V. Raman_, Oct 16 2012 */
%Y A217840 Cf. A216503, A216504, A216505.
%Y A217840 Cf. A216673 (a variant of this sequence, when the order does not matter for the equation x^2 + y^2 = n, i.e., if the equation x^2 + y^2 = n has two solutions (x, y), (y, x) then they will be counted as the same).
%Y A217840 Cf. A216672, A216673, A216674, A217834, A217956.
%Y A217840 Cf. A046951.
%K A217840 nonn
%O A217840 1,2
%A A217840 _V. Raman_, Oct 16 2012