Self numbers: Difference between revisions
m
→{{header|Phix}}: oops, put test back (got same results, but only because start==end)
m (→{{header|Phix}}: spotted another unnecessary test (counter!=startIndex), hoisted some loops into doneAfterAdding) |
m (→{{header|Phix}}: oops, put test back (got same results, but only because start==end)) |
||
Line 924:
if doneAfterAdding(11,9) then return output end if
--
-- The highest-order blocks whose ends this is thought to handle correctly contain 97,777,777,778 self numbers.
-- The difference between equivalently positioned numbers in these blocks is 1,000,000,000,001.
-- The figures for successively lower-order blocks are obtained by successively removing 7s and 0s!
atom
numericDiff = 1000000000001
▲ while indexDiff>=98 and counter!=startIndex do
if counter+indexDiff
numericDiff = floor(numericDiff/10) + 1
else▼
currentSelf += numericDiff
end if▼
end
-- Sequencing loop, per lowest-order block.
while true do
|