Talk:9 billion names of God the integer: Difference between revisions

Line 18:
==The One True Triangle, Three Triangles in One Eternal Trinity==
[[File:ThreeTrianglesInOneEternalTrinity.png]]
:Clearly the 1's are symetricalsymetric, and can be found easily as G(n,1), G(n,n-C<2).
:The grey triangle is symetric (seeand can be found by index to ina1 (see below).
:The vertical edge of the green triangle is ina1 in [http://rosettacode.org/wiki/9_billion_names_of_God_the_integer#Full_Solution Ruby Full Solution] and is the horizontal edge of the grey triangle.
:The horizontal edge of the green triangle is ina2 in [http://rosettacode.org/wiki/9_billion_names_of_God_the_integer#Full_Solution Ruby Full Solution].
Line 29:
Solving consecutive hypotenuses for the green triangle starting with the longest and moving in does this easily. ina1 and ina2 may be obtained by taking the first and last entry in each vector calculated.
 
3 + sum over ina1 + sum over ina2 is the sum of row n. For rows less than n/2 it is available in ina1.
 
Technically I could solve the task simply by summing ina2 as we go, but saving ina1, ina2 and the last calculated hypoternuse is all that is required to stop and restart the algorithm at any point.
2,172

edits