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.

A106594 a(n) = number of primitive solutions to 4n+1 = x^2 + y^2.

This page as a plain text file.
%I A106594 #8 Jun 29 2021 16:28:04
%S A106594 1,0,1,1,0,1,1,0,1,1,0,0,1,0,1,2,0,1,0,0,2,1,0,1,1,0,1,1,0,0,1,0,0,1,
%T A106594 0,2,1,0,1,0,0,1,1,0,1,2,0,1,1,0,2,0,0,0,2,0,1,1,0,1,0,0,0,1,0,2,1,0,
%U A106594 1,1,0,1,1,0,0,2,0,1,1,0,2,0,0,1,0,0,1,1,0,0,2,0,1,2,0,0,1,0,1
%N A106594 a(n) = number of primitive solutions to 4n+1 = x^2 + y^2.
%C A106594 "Primitive" means that x and y are positive and mutually prime.
%H A106594 R. J. Mathar, <a href="/A106594/b106594.txt">Table of n, a(n) for n = 1..10000</a>
%e A106594 E.g. a(16)=2 because 65 = 8^2+1^2 = 7^2+4^2. a(11)=0 because although 45=6^2+3^2, 6 and 3 are not mutually prime. a(2)=0 because although 9=3^2+0^2, 0 is not positive.
%p A106594 A106594 := proc(n)
%p A106594       local a,x,y,fourn;
%p A106594     fourn := 4*n+1 ;
%p A106594     a := 0 ;
%p A106594     for x from 1 do
%p A106594         if x^2 >= fourn then
%p A106594             return a;
%p A106594         else
%p A106594             y := fourn-x^2 ;
%p A106594             if issqr(y) then
%p A106594                 y := sqrt(y) ;
%p A106594                 if y <= x and igcd(x,y) = 1 then
%p A106594                     a := a+1 ;
%p A106594                 end if;
%p A106594             end if;
%p A106594         end if;
%p A106594     end do:
%p A106594 end proc: # _R. J. Mathar_, Sep 21 2013
%t A106594 Table[Length[If[CoprimeQ[#[[1]],#[[2]]],#,Nothing]&/@Union[Sort/@ ({#[[1,2]],#[[2,2]]}&/@FindInstance[{4 n+1==x^2+y^2,x>0,y>0},{x,y}, Integers,10])]],{n,100}] (* _Harvey P. Dale_, Jun 29 2021 *)
%Y A106594 Cf. A106602, A193138.
%K A106594 easy,nonn
%O A106594 1,16
%A A106594 _Colin Mallows_, May 10 2005