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.

A249021 Value x in the solution of x^2-D*y^2=-1 as D runs through A003654.

This page as a plain text file.
%I A249021 #6 Oct 19 2014 13:30:52
%S A249021 7,38,117,18,268,515,70,882,32,182,99,29718,2072,1068,43,2943,378,500,
%T A249021 5604,4030,4005,8890182,776,5357,57,1744,6948,113582,4832118,8827,
%U A249021 1118,1111225770,68,1764132,11018,3141,251,13545,1710,23156,71011068,16432,6072,82,1407,8920484118,1063532,19703
%N A249021 Value x in the solution of x^2-D*y^2=-1 as D runs through A003654.
%C A249021 The pair (x,y) is taken from the numerator of the earliest (lowest order) convergent to the continued fraction of sqrt(D) that satisfies the "non-Pell" equation.
%p A249021 A249021 := proc(n)
%p A249021     local dis,cf,o,q,x,y ;
%p A249021     dis := A003654(n) ;
%p A249021     cf := numtheory[cfrac](sqrt(dis),'periodic','quotients') ;
%p A249021     for o from 1 do
%p A249021         q := numtheory[nthconver](cf,o) ;
%p A249021         x := numer(q) ;
%p A249021         y := denom(q) ;
%p A249021         if x^2-dis*y^2 = -1 then
%p A249021             return x ;
%p A249021         end if;
%p A249021     end do:
%p A249021 end proc:
%p A249021 seq(A249021(n),n=1..50) ;
%Y A249021 Cf. A130226.
%K A249021 nonn
%O A249021 1,1
%A A249021 _R. J. Mathar_, Oct 19 2014