Arithmetic numbers: Difference between revisions

Added Quackery.
(Added 11l)
(Added Quackery.)
Line 1,878:
user 1m13.952s
sys 0m0.005s</pre>
 
=={{header|Quackery}}==
 
<code>factors</code> is defined at [[Factors of an integer#Quackery]].
<code>isprime</code> is defined at [[Primality by trial division#Quackery]].
 
<syntaxhighlight lang="Quackery"> [ factors
0 over witheach +
swap size mod 0 = ] is arithmetic ( n --> b )
 
[ temp put [] 1
[ over size temp share < while
dup arithmetic if
[ tuck join swap ]
1+
again ]
drop
temp release ] is arithmetics ( n --> [ )
 
say "First 100 arithmetic numbers:"
cr
100 arithmetics echo
cr cr
say "1000th arithmetic number: "
1000 arithmetics
dup -1 peek
echo cr
say "Composites in first 1000: "
behead drop
0 swap witheach
[ isprime not + ]
echo
cr cr
say "10000th arithmetic number: "
10000 arithmetics
dup -1 peek
echo cr
say "Composites in first 10000: "
behead drop
0 swap witheach
[ isprime not + ]
echo
cr</syntaxhighlight>
 
{{out}}
 
<pre>First 100 arithmetic numbers:
[ 1 3 5 6 7 11 13 14 15 17 19 20 21 22 23 27 29 30 31 33 35 37 38 39 41 42 43 44 45 46 47 49 51 53 54 55 56 57 59 60 61 62 65 66 67 68 69 70 71 73 77 78 79 83 85 86 87 89 91 92 93 94 95 96 97 99 101 102 103 105 107 109 110 111 113 114 115 116 118 119 123 125 126 127 129 131 132 133 134 135 137 138 139 140 141 142 143 145 147 149 ]
 
1000th arithmetic number: 1361
Composites in first 1000: 782
 
10000th arithmetic number: 12953
Composites in first 10000: 8458
</pre>
 
 
=={{header|Raku}}==
1,462

edits