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

Line 26:
 
[[File:My Green Triangle.png]]
 
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.
 
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.
 
The memory required in terms of number of integers is largest at the start of the algorithm, as each hypotenuse except the last can be discarded after obtaining ina1 and ina2. It is less than 3 time the number of rows in integers, though the actual memory required per integer will depend on your language or library.
 
--[[User:Nigel Galloway|Nigel Galloway]] ([[User talk:Nigel Galloway|talk]]) 12:15, 4 May 2013 (UTC)
2,172

edits