where n is a nonsquare integer and x and y are integers.
We can calculate the x,y for certain n with the following codes:
It returns:
Fundamental Solution to Pell's Equation X^2-1001Y^2=1 was:
-------------------------------------------------------
X=1060905
Y=33532
Fundamental Solution to Pell's Equation X^2-1002Y^2=1 was:
-------------------------------------------------------
X=206869247
Y=6535248
Fundamental Solution to Pell's Equation X^2-1003Y^2=1 was:
-------------------------------------------------------
X=9026
Y=285
Fundamental Solution to Pell's Equation X^2-1004Y^2=1 was:
-------------------------------------------------------
X=27009633024199
Y=852416459730
Fundamental Solution to Pell's Equation X^2-1005Y^2=1 was:
-------------------------------------------------------
X=2950149761
Y=93059568
Fundamental Solution to Pell's Equation X^2-1006Y^2=1 was:
-------------------------------------------------------
X=14125267563780214605455
Y=445346140255574921748
Fundamental Solution to Pell's Equation X^2-1007Y^2=1 was:
-------------------------------------------------------
X=476
Y=15
Fundamental Solution to Pell's Equation X^2-1008Y^2=1 was:
-------------------------------------------------------
X=127
Y=4
Fundamental Solution to Pell's Equation X^2-1009Y^2=1 was:
-------------------------------------------------------
X=583201
Y=18360
Fundamental Solution to Pell's Equation X^2-1010Y^2=1 was:
-------------------------------------------------------
X=3395619
Y=106846
Fundamental Solution to Pell's Equation X^2-1011Y^2=1 was:
-------------------------------------------------------
X=8426
Y=265
Fundamental Solution to Pell's Equation X^2-1012Y^2=1 was:
-------------------------------------------------------
X=3222617399
Y=101302110
Fundamental Solution to Pell's Equation X^2-1013Y^2=1 was:
-------------------------------------------------------
X=309159979019115849
Y=9713562669309460
Fundamental Solution to Pell's Equation X^2-1014Y^2=1 was:
-------------------------------------------------------
X=4656965
Y=146246
Fundamental Solution to Pell's Equation X^2-1015Y^2=1 was:
-------------------------------------------------------
X=352871
Y=11076
Fundamental Solution to Pell's Equation X^2-1016Y^2=1 was:
-------------------------------------------------------
X=255
Y=8
Fundamental Solution to Pell's Equation X^2-1017Y^2=1 was:
-------------------------------------------------------
X=2900932297217
Y=90965584992
Fundamental Solution to Pell's Equation X^2-1018Y^2=1 was:
-------------------------------------------------------
X=15155578752298003
Y=475005498176334
Fundamental Solution to Pell's Equation X^2-1019Y^2=1 was:
-------------------------------------------------------
X=6089923321730
Y=190776436539
Fundamental Solution to Pell's Equation X^2-1020Y^2=1 was:
-------------------------------------------------------
X=511
Y=16
Fundamental Solution to Pell's Equation X^2-1021Y^2=1 was:
-------------------------------------------------------
X=198723867690977573219668252231077415636351801801
Y=6219237759214762827187409503019432615976684540
Fundamental Solution to Pell's Equation X^2-1022Y^2=1 was:
-------------------------------------------------------
X=1023
Y=32
Fundamental Solution to Pell's Equation X^2-1023Y^2=1 was:
-------------------------------------------------------
X=32
Y=1
No Fundamental Solution was found to Pell's Equation X^2-1024Y^2=1.