Talk:Special pythagorean triplet: Difference between revisions

From Rosetta Code
Content added Content deleted
(Some observation)
 
(Some observations)
Line 4: Line 4:
if i<sup>2</sup>-g<sup>2</sup> is greater than n<sup>2</sup> then there can be no solution for this n with a smaller g
if i<sup>2</sup>-g<sup>2</sup> is greater than n<sup>2</sup> then there can be no solution for this n with a smaller g
--[[User:Nigel Galloway|Nigel Galloway]] ([[User talk:Nigel Galloway|talk]]) 14:11, 31 August 2021 (UTC)
--[[User:Nigel Galloway|Nigel Galloway]] ([[User talk:Nigel Galloway|talk]]) 14:11, 31 August 2021 (UTC)

Isn't the task to print out abc?
Also, isn't using Euclid's formula (as in the XPL0 solution) going to be faster - less values to try ? --[[User:Tigerofdarkness|Tigerofdarkness]] ([[User talk:Tigerofdarkness|talk]]) 17:34, 31 August 2021 (UTC)

Revision as of 17:35, 31 August 2021

For those paying "attention to timings" and more importantly for those paying attention to other comments I have made on these Euler tasks about filling RC with solutions worse than I would expect from a schoolboy with a pencil, considering n2+g2=i2 and n+g+i=1000 n<g<i note the following:

the largest value n can take is 332 with g=333 and i=335
the smallest value of i2-g2 is when g=(999-n)/2 and i=1000-g
if i2-g2 is greater than n2 then there can be no solution for this n with a smaller g

--Nigel Galloway (talk) 14:11, 31 August 2021 (UTC)

Isn't the task to print out abc? Also, isn't using Euclid's formula (as in the XPL0 solution) going to be faster - less values to try ? --Tigerofdarkness (talk) 17:34, 31 August 2021 (UTC)