首页 > 其他分享 >MathProblem 59 Two primes problem

MathProblem 59 Two primes problem

时间:2022-08-29 20:11:19浏览次数:60  
标签:59 质数 MathProblem Two primes problem

Show that any prime number other than 2 can be expressed as the difference of two squares, where each square is an integer squared.

Solution

任何质数都是奇数。考虑相邻数的平方差:

\[(x+1)^2-x^2=2x+1 \]

所以这些差都是奇数,自然就包括所有的质数。

进一步,考虑两个数 \(a,b\):

\[p=a^2-b^2=(a+b)(a-b) \]

很明显只有一个答案,因为素数 \(p\) 只有一种分解:\(p=1\times p\)

\[a-b=1, a+b=p \]

标签:59,质数,MathProblem,Two,primes,problem
From: https://www.cnblogs.com/xinyu04/p/16637203.html

相关文章

  • Discuz论坛网站favicon图标更改方法 (2014-03-08 11:05:59)
    先制作一个网站的favicon.ico,百度搜索favicon在线制作可以找到很多的网站提供在线制作[推荐:http://www.ico.la/],favicon是ico格式的,你可以把你的图标在线制作什么ico,官方的......
  • MathProblem 52 Two children problem
    Awomanischosenatrandomamongallwomenthathavetwochildren.Sheisaskeddoyouhaveatleastoneboy,andsheanswers'yes.'Whatistheprobabilityh......
  • LeetCode 859. Buddy Strings
    原题链接在这里:https://leetcode.com/problems/buddy-strings/题目:Giventwostrings s and goal,return true ifyoucanswaptwolettersin s sotheresult......
  • [Google] LeetCode 359 Logger Rate Limiter
    Designaloggersystemthatreceivesastreamofmessagesalongwiththeirtimestamps.Eachuniquemessageshouldonlybeprintedatmostevery10seconds(i.e......
  • MathProblem 51 Maximum volume of cone problem
    Youhaveatortillawithradius1andwishtoformacone.Youmaycutoutanywedgeyoulikefromthetortilla.Thepointofthewedgemustbeatthecentero......
  • 《GB27599-2011》PDF下载
    《GB27599-2011化妆品用二氧化钛》PDF下载《GB27599-2011》简介本标准规定了化妆品用二氧化钛的分类、要求、试验方法、检验规则、标志、标签、包装、运输和贮存;本标......
  • MathProblem 44 Coin toss problem #1
    Youaregivenaninitialprizeofonedollar.Acoinwillbetossedindefinitelyuntilatailsoccurs.Everytimeaheadsistossedyourprizewillbedoubled.......
  • P5911 [POI2004]PRZ——状压dp
    一样,从\(n\le16\)启发用状压dp思路本质上与UVA11825Hackers'Crackdown异曲同工,不过可以通过预处理处理出一组人的集合时间复杂度最坏为\(O(2^{2n})\),当任何一个集合......
  • MathProblem 43 Wall and two houses problem
    Thereisacastlesurroundedbyacircularwall.Thewallhasanorthgateandasouthgate.Ayellowhouselays3milesnorthofthenorthgate.Abluehouse......
  • MathProblem 42 Drunken walk problem #1
    Adrunkisononepointofann-gon,suchthatnisanevennumber.Thedrunkmovesalongtheperimeterofthen-gon.Eachstepstakeshimtoanadjacentpoint......