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.

A130226 Smallest integer x satisfying the Pell equation x^2-k*y^2=-1 for the values of k given in A031396.

This page as a plain text file.
%I A130226 #29 Apr 24 2024 13:21:51
%S A130226 0,1,2,3,18,4,5,70,6,32,7,182,99,29718,8,1068,43,9,378,500,5604,10,
%T A130226 4005,8890182,776,11,682,57,1744,12,113582,4832118,13,1118,1111225770,
%U A130226 68,1764132,14,3141,251,15,1710,23156,71011068,4443,16,6072,82,1407
%N A130226 Smallest integer x satisfying the Pell equation x^2-k*y^2=-1 for the values of k given in A031396.
%H A130226 Ray Chandler, <a href="/A130226/b130226.txt">Table of n, a(n) for n = 1..10000</a>
%H A130226 K. Lakshmi and R. Someshwari, <a href="https://www.ijeter.everscience.org/Manuscripts/Volume-4/Issue-7/Vol-4-issue-7-M-02.pdf">On The Negative Pell Equation y^2 = 72x^2 - 23</a>, International Journal of Emerging Technologies in Engineering Research (IJETER), Volume 4, Issue 7, July (2016).
%H A130226 R. Suganya and D. Maheswari, <a href="http://dx.doi.org/10.22457/jmi.v11a9">On the Negative Pellian Equation y^2 = 110 * x^2 - 29</a>, Journal of Mathematics and Informatics, Vol. 11 (2017), pp. 63-71.
%H A130226 S. Vidhyalakshmi, V. Krithika, and K. Agalya, <a href="http://www.ijeter.everscience.org/Manuscripts/Volume-4/Issue-2/Vol-4-issue-2-M-04.pdf">On The Negative Pell Equation y^2 = 72x^2 - 8</a>, International Journal of Emerging Technologies in Engineering Research (IJETER) Volume 4, Issue 2, February (2016).
%e A130226 a(5)=18 because A031396(5)=13, and the solution to x^2-13y^2=-1 with smallest possible x has x=18.
%p A130226 A130226 := proc(m)
%p A130226     local xm,x ,i,xmo,y2;
%p A130226     xm := [] ; # x^2-m*y^2=-1 (mod m) requires x in xm[]
%p A130226     for x from 0 to m-1 do
%p A130226         if modp(x^2,m) = modp(-1,m) then
%p A130226             xm := [op(xm),x] ;
%p A130226         end if;
%p A130226     end do:
%p A130226     for i from 0 do
%p A130226         for xmo in xm do
%p A130226             x := i*m+xmo ;
%p A130226             y2 := (x^2+1)/m ;
%p A130226             if issqr(y2) then
%p A130226                 return x ;
%p A130226             end if;
%p A130226         end do:
%p A130226     end do:
%p A130226 end proc:
%p A130226 L := BFILETOLIST("b031396.txt") ;
%p A130226 n := 1:
%p A130226 for m in L do
%p A130226     printf("%d %d\n",n,A130226(m)) ;
%p A130226     n := n+1 ;
%p A130226 end do: # _R. J. Mathar_, Oct 19 2014
%t A130226 terms = 1000;
%t A130226 a031396 = Cases[Import["https://oeis.org/A031396/b031396.txt", "Table"], {_, _}][[;; terms, 2]];
%t A130226 sol[n_] := Solve[x > 0 && y > 0 && x^2 - n y^2 == -1, {x, y}, Integers];
%t A130226 a[1] = 0; a[n_] := a[n] = x /. sol[a031396[[n]]] /. C[1] -> 0 // First // Simplify // Quiet;
%t A130226 Table[Print[n, " ", a031396[[n]], " ", a[n]]; a[n], {n, 1, terms}] (* _Jean-François Alcover_, Apr 05 2020 *)
%Y A130226 Cf. A094048.
%K A130226 nonn
%O A130226 1,3
%A A130226 _Colin Barker_, Aug 05 2007