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.

A216505 Number of values of k for which n can be written in the form a^2+k*b^2, a > 0, b > 0, k >= 0.

This page as a plain text file.
%I A216505 #13 Oct 16 2012 11:28:35
%S A216505 1,1,1,2,2,2,2,3,4,3,3,4,5,3,3,5,6,5,5,5,5,5,4,6,8,5,5,6,8,5,6,7,7,7,
%T A216505 5,10,10,6,6,9,11,6,8,9,10,7,6,10,12,7,7,11,11,8,7,10,11,9,8,9,14,7,9,
%U A216505 11,11,8,10,13,11,9,8,15,17,9,9,14,11,8,11,12
%N A216505 Number of values of k for which n can be written in the form a^2+k*b^2, a > 0, b > 0, k >= 0.
%H A216505 T. D. Noe, <a href="/A216505/b216505.txt">Table of n, a(n) for n = 1..1000</a>
%t A216505 Table[cnt = 0; If[IntegerQ[Sqrt[n]], cnt++]; Do[b = 1; found = False; While[q = n - k*b^2; ! found && q > 0, If[IntegerQ[Sqrt[q]], cnt++; found = True]; b++], {k, n}]; cnt, {n, 100}] (* _T. D. Noe_, Sep 11 2012 *)
%o A216505 (PARI) for(n=1, 100, sol=0; for(k=0, n-1, for(x=1, n, if(issquare(n-k*x*x)&&n-k*x*x>0, sol++; break))); print1(sol", ")) /* _V. Raman_, Oct 16 2012 */
%Y A216505 Cf. A001481, A154777, A092572.
%K A216505 nonn
%O A216505 1,4
%A A216505 V. Raman, Sep 07 2012