Talk:Law of cosines - triples: Difference between revisions

Reply re discrepancy in Python results.
(Perhaps try removing the mutation ?)
(Reply re discrepancy in Python results.)
Line 132:
: (8, 15, 13), (16, 30, 26), (24, 45, 39), (32, 60, 52) etc ... up to (4704, 8820, 7644) (all of which, as far as I can see match the pattern ((a^2) + (b^2)) - (a * b) == c ^ 2) [[User:Hout|Hout]] ([[User talk:Hout|talk]]) 20:05, 26 September 2018 (UTC)
:: PS I notice that you are braver than me and mutating the referent of the name '''c2'''. Is it possible that an earlier mutation is (in a subset of cases) shadowing a later test ? You have ''c2 -= ab'' and then ''c2 += 2 * ab'' [[User:Hout|Hout]] ([[User talk:Hout|talk]]) 20:18, 26 September 2018 (UTC)
 
:::Yep, that's the reason for the discrepancy, Hout :)
 
:::I just ran it through my Go version and there's apparently 588 cases where both (a*a + b*b) and (a*a + b*b -a*b) are perfect squares. So they are being filtered out by the 90° case.
 
:::As 18394 - 588 = 17806 that explains Paddy's results. --[[User:PureFox|PureFox]] ([[User talk:PureFox|talk]]) 21:20, 26 September 2018 (UTC)
9,476

edits