Fundamental Solution to Pell's Equation

本文介绍了一种通过外部服务解决佩尔方程的方法,并提供了一个VBScript示例程序,该程序可以为指定范围内的非平方整数n找到佩尔方程X^2-nY^2=1的基本解。

From Wikipedia,

Pell's equation

is any Diophantine equation of the form

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.

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值