Anonymous user
Untouchable numbers: Difference between revisions
→{{header|J}}
Line 377:
spds=:([:sum_of_proper_divisors"0(#\@i.-.i.&.:(p:inv))@*:)f. NB. remove primes which contribute 1
</lang>
We may revisit to correct the larger untouchable tallies.
Time (seconds) and space (bytes) on a high end six year old (new in 2015) laptop computer.
<pre>
timespacex'(-.candidates@#)/:~~.spds 10000'
600.285 4.29497e9
</pre>
<pre>
UNTOUCHABLES=:(candidates-.spds) 2000 NB. compute untouchable numbers
Line 400 ⟶ 406:
1884 1888 1894 1896 1920 1922 1944 1956 1958 1960 1962 1972 1986 1992
SBD=:spds 10000 NB. sums of proper divisors of many integers
T=:/:~~.SBD NB. sort the nub
#T NB. leaving this many touchable numbers, which are dense through at least 10000
47269787
U=:(-.~candidates@#)T NB. possible untouchable numbers
head=:
head,:,.L:0;/|:(,.U&I.)10^#\i.5 NB. testing to ten thousand squared
┌──────┬──────────────────────────────────────────┐
|