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, fast forward to last self number before the lowest-order block containing the first number requiredrqd.
if counter!=<startIndex then
-- The highest-order blocks whose ends this is thought to handlehandles correctly contain 979,777,777,778 self numbers.
-- The difference between equivalently positioned numbers in these blocks is 1,000100,000,000,001.
-- The figures for successively lower-order blocks are obtained byhave successively removingfewer 7s and 0s!
atom indexDiff = 977777777789777777778,
numericDiff = 1000000000001100000000001
while indexDiff>=98 and counter!=startIndex do
if counter+indexDiff < startIndex then
7,820

edits