Self numbers: Difference between revisions
m
→{{header|Phix}}: updated comments inline with AppleScrpt entry, and removed an over-eagerly inserted 7&0
m (→first 50 self numbers: added/changed whitespace and comments.) |
m (→{{header|Phix}}: updated comments inline with AppleScrpt entry, and removed an over-eagerly inserted 7&0) |
||
Line 903:
-- This connection with significant digit change means every ten blocks form a higher-order block, every ten
-- of these a higher-order-still block, and so on.
--
-- The code below appears to be good up to the last self number before 10^12 — ie. 999,999,999,997, which is
-- returned as the 97,777,777,792nd such number. After this, instead of zero-length shorter runs, the actual
-- pattern apparently starts again with a single run of 10, like the one at the beginning.
--
integer startIndex, endIndex, counter
Line 932 ⟶ 936:
if doneAfterAdding(11,9) then return output end if
-- If necessary,
if counter
-- The highest-order blocks whose ends this
-- The difference between equivalently positioned numbers in these blocks is
-- The figures for successively lower-order blocks
atom indexDiff =
numericDiff =
while indexDiff>=98 and counter!=startIndex do
if counter+indexDiff < startIndex then
|