找回密码
 欢迎注册
楼主: northwolves

[讨论] a^2+b^2+c^2=d^2(0<a<b<c<d) 恰好有44组正整数解

[复制链接]
发表于 4 天前 | 显示全部楼层
O. Fraser and B. Gordon, On representing a square as the sum of three squares, Amer. Math. Monthly, 76 (1969), 922-923.
这篇文章有人能找到吗?
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 4 天前 | 显示全部楼层

点评

那你前面的规律已经没有问题了。后面就好办了,这个序列可以解决了。  发表于 4 天前

评分

参与人数 1威望 +12 金币 +12 贡献 +12 经验 +12 鲜花 +12 收起 理由
mathe + 12 + 12 + 12 + 12 + 12

查看全部评分

毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 4 天前 | 显示全部楼层
一个类似的问题: A375335 :a(n) is the smallest positive integer whose square can be represented as the sum of n distinct nonzero squares in exactly n ways, or -1 if no such integer exists.

前几项是1, 1, 25, 23, 17. 目前a(5)还未知,即找一个整数n,使$n^2$恰好有5种方式表示为5个互不相同的正整数的平方和。

  1. f[m_] := Length[  Select[PowersRepresentations[m^2, 5, 2], (FreeQ[#, 0] && # == Union[#]) &]]
复制代码


前100项是0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 4, 3, 6, 7, 13, 7, 16, 14, 21, 21, 27, 24, 31, 35, 43, 43, 60, 51, 66, 61, 88, 83, 105, 91, 137, 116, 124, 140, 185, 143, 195, 187, 233, 197, 266, 220, 317, 283, 318, 317, 371, 331, 433, 404, 476, 450, 529, 427, 620, 543, 616, 612, 735, 611, 742, 735, 864, 803, 954, 783, 1080, 905, 1053, 1038, 1269, 1038, 1314, 1222, 1331, 1265, 1545, 1309, 1733, 1521, 1615, 1553, 1951, 1607, 2037, 1834, 2145, 2001, 2216, 1959, 2538

看这个数列的增长速度,似乎也是不存在。

点评

a(10)=25, a(12)=33, a(13)=37, a(14)=38  发表于 4 天前
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 4 天前 | 显示全部楼层
现在根据前面的估计公式,只需要计算到300,000项,就可以确保10000项以内没有找到的都是无解了,由此我们可以提交到A374805中了
  1. (16:15) gp > solve(x=10,10^20,x/8-2*x^0.75-10000)
  2. %23 = 268974.60060487191995397568614516513661
复制代码


代码很简单
  1. #include <vector>
  2. #include <stdio.h>
  3. #include <math.h>
  4. #include <iostream>
  5. #include <gmpxx.h>
  6. #include <map>
  7. #include <vector>
  8. #include <numeric>
  9. #include <algorithm>


  10. #define LUP 300000L
  11. #define LUB 10000
  12. char *notprime;
  13. int *qlist;
  14. int *lp;
  15. int qc;
  16. long c[LUB];

  17. #define ISPRIME(x) (!notprime[x])
  18. #define UNSETPRIME(x) (notprime[x]=1)

  19. struct PF{
  20.      int pi;
  21.      int pc;
  22.      bool operator<(const PF& pf)const{
  23.          if(pi>pf.pi)return true;//sort in reverse order
  24.          if(pi<pf.pi)return false;
  25.          return pc<pf.pc;
  26.      }
  27. };

  28. struct PData{
  29.     int x,y;
  30. };

  31. std::vector<PF> factors[2*LUP];
  32. typedef std::map<long, std::vector<PData> > PMAP;
  33. #define LIMIT 5

  34. void mergefactors(std::vector<PF>& pf1, const std::vector<PF>& pf2)
  35. {
  36.     std::vector<PF> out;
  37.     int i,j;
  38.     for(i=0,j=0;i<pf1.size()&&j<pf2.size();){
  39.         if(pf1[i].pi==pf2[j].pi){
  40.             PF y;
  41.             y.pi=pf1[i].pi;
  42.             y.pc=pf1[i].pc+pf2[j].pc;
  43.             out.push_back(y);
  44.             i++;j++;
  45.         }else if(pf1[i].pi>pf2[j].pi){
  46.             out.push_back(pf1[i]);
  47.             i++;
  48.         }else{
  49.             out.push_back(pf2[j]);
  50.             j++;
  51.         }
  52.     }
  53.     for(;i<pf1.size();i++){
  54.             out.push_back(pf1[i]);
  55.     }
  56.     for(;j<pf2.size();j++){
  57.             out.push_back(pf2[j]);
  58.     }
  59.     pf1=out;
  60. }

  61. void getfactors(long x, std::vector<PF>& pf)
  62. {
  63.     int pc=0;
  64.     int curp=-1;
  65.     if(x==0)return;
  66.     while(lp[x]>=0){
  67.         if(lp[x]==curp){
  68.             pc++;
  69.         }else{
  70.             if(curp>=0){
  71.                    PF y;
  72.                    y.pi=curp;
  73.                    y.pc=pc;
  74.                    pf.push_back(y);
  75.             }
  76.             pc=1;
  77.             curp=lp[x];
  78.         }
  79.         x/=qlist[lp[x]];
  80.     }
  81.     if(pc>0){
  82.         PF y;
  83.         y.pi=curp;
  84.         y.pc=pc;
  85.         pf.push_back(y);
  86.     }
  87. }


  88. void initprime()
  89. {
  90.     qlist=(int *)malloc(2*LUP*sizeof(int));
  91.     lp=(int *)malloc(2*LUP*sizeof(int));
  92.     notprime=(char *)malloc(2*LUP*sizeof(char));
  93.     memset(notprime,0,2*LUP*sizeof(char));
  94.     UNSETPRIME(0);
  95.     UNSETPRIME(1);
  96.     long i,j;
  97.     for(i=2;i<2*LUP;i++){
  98.         if(!ISPRIME(i))continue;
  99.         {
  100.             qlist[qc++]=i;
  101.         }
  102.         for(j=i*i;j<2*LUP;j+=i){
  103.             UNSETPRIME(j);
  104.         }
  105.     }
  106.     for(i=0;i<2*LUP;i++)lp[i]=-1;
  107.     for(i=0;i<qc;i++){
  108.         for(j=qlist[i];j<2*LUP;j+=qlist[i]){
  109.             lp[j]=i;
  110.         }
  111.     }
  112.     for(i=2;i<2*LUP;i++){
  113.         getfactors(i,factors[i]);
  114.     }
  115. }

  116. long getsc(long c, long d)
  117. {
  118.     int i;
  119.     bool is_sqr=1;
  120.     std::vector<PF> pf1, pf2;
  121.     pf1=factors[d+c];
  122.     mergefactors(pf1,factors[d-c]);
  123.     long r=1;
  124.     for(i=0;i<pf1.size();i++){
  125.         long p=qlist[pf1[i].pi];
  126.         if((pf1[i].pc&1)==1)is_sqr=0;
  127.         if(p%4==3&&(pf1[i].pc&1)==1)return 0;
  128.         if(p%4==1){
  129.                 r*=pf1[i].pc+1;
  130.         }
  131.     }
  132.     if(is_sqr)r--;
  133.     return r;
  134. }

  135. long gete2(long x, long y)
  136. {
  137.         std::vector<PF> p1=factors[x-y];
  138.         std::vector<PF>& p2=factors[x+y];
  139.         mergefactors(p1,p2);
  140.         long prod=1;
  141.         for(int i=0;i<p1.size();i++){
  142.                 long pm=qlist[p1[i].pi];
  143.                 if((pm&1)==0)continue;
  144.                 if(pm%4==3){
  145.                         if(p1[i].pc&1)return 0;
  146.                 }else{
  147.                         prod*=p1[i].pc+1;
  148.                 }
  149.         }
  150.         return prod;
  151. }

  152. long gete(long x)
  153. {
  154.         std::vector<PF>& fac=factors[x];
  155.         long prod=1;
  156.         for(int i=0;i<fac.size();i++){
  157.                 long pm = qlist[fac[i].pi];
  158.                 if((pm&1)==0)continue;
  159.                 if(pm%4==3){
  160.                         if(fac[i].pc&1)return 0;
  161.                 }else{
  162.                         prod*=fac[i].pc+1;
  163.                 }
  164.         }
  165.         return prod;
  166. }

  167. std::map<long ,long > rmap;

  168. long getr(long d)
  169. {
  170.         std::vector<PF>& fac=factors[d];
  171.         long prod=1;
  172.         int i;
  173.         for(i=0;i<fac.size();i++){
  174.                 long p=qlist[fac[i].pi];
  175.                 if((p&1)==0)continue;
  176.                 int h;
  177.                 long pm=1;
  178.                 for(h=0;h<fac[i].pc;h++)pm*=p;
  179.                 if(p%4==3){
  180.                         prod*=pm+2*(pm-1)/(p-1);
  181.                 }else{
  182.                         prod*=pm;
  183.                 }
  184.         }
  185.         return prod;
  186. }

  187. long gets(long d)
  188. {
  189.         std::vector<PF>& fac=factors[d];
  190.         long prod=1;
  191.         for(int i=0;i<fac.size();i++){
  192.                 long p=qlist[fac[i].pi];
  193.                 int m=p%8;
  194.                 if(m!=1&&m!=3)continue;
  195.                 prod*=2*fac[i].pc+1;
  196.         }
  197.         return prod;
  198. }

  199. long gett(long d)
  200. {
  201.         std::vector<PF>& fac=factors[d];
  202.         long prod=1;
  203.         for(int i=0;i<fac.size();i++){
  204.                 long p=qlist[fac[i].pi];
  205.                 int m=p%4;
  206.                 if(m!=1)continue;
  207.                 prod*=2*fac[i].pc+1;
  208.         }
  209.         return prod;
  210. }

  211. int main()
  212. {
  213.     long d;
  214.     initprime();
  215.     memset(c,-1,sizeof(c));
  216.     for(d=1;d<LUP;d+=2){
  217.         long r=getr(d);
  218.         long s=gets(d);
  219.         long t=gett(d);
  220.         long f=(r-2*s-2*t+3)/8;
  221.         if(f<LUB&&c[f]<0){
  222.                 c[f]=d;
  223.         }
  224.     }
  225.     for(d=1;d<LUB;d++){
  226.             printf("%ld %ld\n",d,c[d]);
  227.     }
  228.     return 0;
  229. }
复制代码

nums7.out

102.91 KB, 下载次数: 0, 下载积分: 金币 -1 枚, 经验 1 点, 下载 1 次

评分

参与人数 2威望 +20 金币 +20 贡献 +20 经验 +20 鲜花 +20 收起 理由
wayne + 12 + 12 + 12 + 12 + 12 赞一个!
northwolves + 8 + 8 + 8 + 8 + 8 很给力!

查看全部评分

毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 4 天前 | 显示全部楼层
mathe 发表于 2025-10-10 15:27
O. Fraser and B. Gordon, On representing a square as the sum of three squares, Amer. Math. Monthly,  ...

下载下来了.
10.2307@2317949.pdf (291.34 KB, 下载次数: 8)

评分

参与人数 1威望 +8 金币 +8 贡献 +8 经验 +8 鲜花 +8 收起 理由
northwolves + 8 + 8 + 8 + 8 + 8 很给力!

查看全部评分

毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 4 天前 | 显示全部楼层
这个公式很强:(a² + b² + c² + d²)² = (a² + b² - c² - d²)² + (2ac + 2bd)² + (2ad - 2bc)²
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 3 天前 | 显示全部楼层
这个就是欧拉四平方数公式
\((a^2+b^2+c^2+d^2)(x^2+y^2+z^2+w^2)=(ax+by+cz+dw)^2+(ay-bx+cw-dz)^2+(az-bw-cx+dy)^2+(aw+bz-cy-dx)^2\)
其中取\(x=a,y=b,z=-c,w=-d\)

评分

参与人数 2威望 +20 金币 +20 贡献 +20 经验 +20 鲜花 +20 收起 理由
wayne + 12 + 12 + 12 + 12 + 12 赞一个!
northwolves + 8 + 8 + 8 + 8 + 8 是了

查看全部评分

毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
您需要登录后才可以回帖 登录 | 欢迎注册

本版积分规则

小黑屋|手机版|数学研发网 ( 苏ICP备07505100号 )

GMT+8, 2025-10-14 00:37 , Processed in 0.032224 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表