a^2+b^2+c^2=d^2(0<a<b<c<d) 恰好有44组正整数解
A374805a(n) is the smallest positive integer whose square can be represented as the sum of 3 distinct nonzero squares in exactly n ways, or -1 if no such number exists.
1, 7, 15, 23, 31, 21, 33, 39, 49, 45, 79, 57, 95, 103, 75, 69, 127, 87, 63, 151, 93, 167, 111, 123, 99, 187, 117, 105, 161, 241, 141, 135, 153, 247, 271, 283, 177, 183, 165, 275, 147, 171, 323, 219
若 $a^2+b^2+c^2=d^2(0<a<b<c<d)$ 恰好有44组正整数解,求最小d值。已知d<15000内无解,如何证明不存在这样的d呢?
a :=NestWhile[# + 1 &, 1,Length@Select,0 < #[] < #[] < #[] &] != n &];
Range // Map[{#, a[#]} &] // Column
{1,7}
{2,15}
{3,23}
{4,31}
{5,21}
{6,33}
{7,39}
{8,49}
{9,45}
{10,79}
{11,57}
{12,95}
{13,103}
{14,75}
{15,69}
{16,127}
{17,87}
{18,63}
{19,151}
{20,93}
遍历发现,15000以内,有38个数字无解:
{38,{44,78,174,183,205,210,282,295,330,372,384,404,434,460,468,479,480,509,582,624,652,670,674,678,709,744,745,750,759,782,804,810,839,866,867,897,953,999}} 突然发现,a^2+b^2+c^2=d^2(0<a<b<c<d) 若仅有唯一正整数解,则d=7 或d={9, 11, 13, 14, 17}的$2^k(k >=0)$倍.
{7,9,11,13,14,17,18,22,26,28,34,36,44,52,56,68,72,88,104,112,136,144,176,208,224,272,288,352,416,448,544,576,704,832,896,1088,1152,1408,1664,1792,2176,2304,2816,3328,3584,4352,4608,5632,6656,7168,8704,9216,11264,13312,14336,17408,18432} A004432
Numbers that are the sum of 3 distinct nonzero squares.
14, 21, 26, 29, 30, 35, 38, 41, 42, 45, 46, 49, 50, 53, 54, 56, 59, 61, 62, 65, 66, 69, 70, 74, 75, 77, 78, 81, 83, 84, 86, 89, 90, 91, 93, 94, 98, 101, 104, 105, 106, 107, 109, 110, 113, 114, 115, 116, 117, 118, 120, 121, 122, 125, 126, 129, 131, 133
(list; graph; refs; listen; history; edit; text; internal format)
OFFSET
1,1
COMMENTS
Numbers that can be written as a(n) = x^2 + y^2 + z^2 with 0 < x < y < z.
This is a subsequence (equal to the range) of A024803. As a set, it is the union of A025339 and A024804, subsequences of numbers having exactly one, resp. more than one, such representations. - M. F. Hasler, Jan 25 2013
Conjecture: a number n is a sum of 3 squares, but not a sum of 3 distinct nonzero squares (i.e., is in A004432 but not A000408), if and only if it is of the form 4^j*s, where j >= 0 and s in {1, 2, 3, 5, 6, 9, 10, 11, 13, 17, 18, 19, 22, 25, 27, 33, 34, 37, 43, 51, 57, 58, 67, 73, 82, 85, 97, 99, 102, 123, 130, 163, 177, 187, 193, 267, 627, 697}. - Jeffrey Shallit, Jan 15 2017 如果是本原解,gcd(a,b,c,d)=1,那么是这个数列 https://oeis.org/A097266 我觉得 题目要么 改成 统计 本原解$GCD(a,b,c)=1,0<d$的个数,要么统计 $0<a<=b<=c , 0<d$ 非零解 的个数 比较合适. 我是奇怪 A004432 为什么算到43就不继续了
Numbers that are the sum of 3 distinct nonzero squares. $324^2=x^2 + y^2 + z^2 with 0 < x < y < z$ 有18组解
{{4,112,304},{4,176,272},{24,84,312},{24,120,300},{24,168,276},{32,64,316},{32,196,256},{36,144,288},{64,92,304},{64,164,272},{64,188,256},{80,176,260},{80,220,224},{84,168,264},{92,176,256},{112,164,256},{128,196,224},{160,176,220}}
$1156^2=x^2 + y^2 + z^2 with 0 < x < y < z$ 有34组解
{{4,96,1152},{4,768,864},{68,336,1104},{96,612,976},{96,688,924},{112,324,1104},{112,576,996},{156,240,1120},{156,480,1040},{156,544,1008},{156,752,864},{176,336,1092},{176,672,924},{192,284,1104},{192,796,816},{228,256,1104},{228,576,976},{240,444,1040},{256,480,1020},{256,528,996},{284,768,816},{324,464,1008},{324,528,976},{324,752,816},{336,608,924},{336,768,796},{432,444,976},{432,544,924},{444,688,816},{464,612,864},{480,544,900},{508,576,864},{544,612,816},{576,644,768}} northwolves 发表于 2025-10-4 07:51
遍历发现,15000以内,有38个数字无解:
{38,{44,78,174,183,205,210,282,295,330,372,384,404,434,460,468 ...
根据我这个数据, https://oeis.org/A097266应该是 无解了./ 这个题目如果对于每个d,我们穷举c,b,a,那么复杂度显然是O(d^3), 时间复杂度稍微有点高。
另外一种方法,我们可以先计算一个范围内所有a^2+b^2的和以及计数,然后每次对于给定的d,c,直接查找对应的a^2+b^2出现次数即可。
这个方案的缺点是空间复杂度O(d^2)稍微大了一些,限制了d的可用范围,而且访存会比较慢,也影响了计算速度。
由于a^2+b^2是两个平方数的和,知道了它的因子分解中每个素因子的次数就可以知道a^2+b^2的解的数目,这是另外一种可能的计算方案,缺点是需要计算每个d^2-c^2的所有因子分解方案。而优点是(d^2-c^2)=(d+c)(d-c),我们只需要事先分解所有不超过2d的整数,那么就可以运行时快速给出所有d^2-c^2的因子分解方案,然后根据其是否有模4为3的素因子含奇数次数,以及各模4为1的素因子次数,就可以得到它可以写成a^2+b^2的不同方案数目了。
当然这些方法都有一个问题,也就是得出的结果a,b,c之间可以相等。我们可以早上面计算结果中再扣除2a^2+c^2=d^2的计数即可。
而后面这个计数,只要对每个d,判断d^2-2a^2是否完全平方数即可。
而上面这些计数过程都可以不区分a,b,c大小,最后计算结果除以6即可。