Talk:Amicable pairs: Difference between revisions

Content added Content deleted
(→‎amicable pairs, out of order: added some comments.)
Line 69: Line 69:


::: I think you mean that there was no post-process sorting algorithm used here. In other words, I think are talking about the structure of the algorithm rather than the structure of the data. Nevertheless, a statement such as <code>Do x=1 To 20000</code> generates values for x in a sorted order... --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 01:03, 7 October 2015 (UTC)
::: I think you mean that there was no post-process sorting algorithm used here. In other words, I think are talking about the structure of the algorithm rather than the structure of the data. Nevertheless, a statement such as <code>Do x=1 To 20000</code> generates values for x in a sorted order... --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 01:03, 7 October 2015 (UTC)

:::: The &nbsp; '''do''' &nbsp; loop mentioned above (as used in the REXX program), like you said, generates values of &nbsp; '''x''' &nbsp; in a sorted order, but does not do any sorting of data (amicable numbers). &nbsp; However, what the &nbsp; '''do''' &nbsp; loop does, in reality, is generating values for &nbsp; '''x''' &nbsp; in numerical order, where &nbsp; '''y''' &nbsp; is coupled to the value of &nbsp; '''x''' &nbsp; (where &nbsp; '''x''' is the first part of the amicable pair, and &nbsp; '''y''' &nbsp; is the second part). &nbsp; However, the &nbsp; '''sigma''' &nbsp; of &nbsp; '''x''' &nbsp; most likely isn't known at this time, so the value of &nbsp; '''x''' &nbsp; isn't displayed until the &nbsp; '''sigma''' &nbsp; of &nbsp; '''y''' &nbsp; is computed, thus, the values of &nbsp; '''x''' &nbsp; are shown out of order, even though one would think that the values of &nbsp; '''x''' &nbsp; should appear in numerical order. &nbsp; -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 01:58, 7 October 2015 (UTC)

<!-- Like baseball, the runner on 1st can't run to 2nd until the runner on 2nd advances to 3rd. Apologies for the similarity to the Abbot and Costello routine. --!>