zoukankan      html  css  js  c++  java
  • Fundamental Solution to Pell's Equation

    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.

  • 相关阅读:
    数据结构与算法_20 _ 散列表(下):为什么散列表和链表经常会一起使用?
    数据结构与算法_19 _ 散列表(中):如何打造一个工业级水平的散列表?
    数据结构与算法_17 _ 跳表:为什么Redis一定要用跳表来实现有序集合?
    数据结构与算法_18 _ 散列表(上):Word文档中的单词拼写检查功能是如何实现的?
    数据结构与算法_16 _ 二分查找(下):如何快速定位IP对应的省份地址
    数据结构与算法_15 _ 二分查找(上):如何用最省内存的方式实现快速查找功能
    线程池ThreadPoolExecutor源码详解
    用信鸽来解释 HTTPS
    并发集合类之图解CopyOnWriteArrayList
    认识RabbitMQ从这篇文章开始
  • 原文地址:https://www.cnblogs.com/fengju/p/6336199.html
Copyright © 2011-2022 走看看