Pairs with common factors: Difference between revisions

Added Quackery.
m (Remove draft tag. Draft for over a year, multiple implementations, little controversy)
(Added Quackery.)
Line 974:
</pre>
 
=={{header|Quackery}}==
 
<code>totient</code> is defined at [[Totient function#Quackery]].
 
<syntaxhighlight lang="Quackery"> [] 0
1000 times
[ i^ 1+ totient +
i^ 1+ dup 1 - * 2 / 1+
over -
swap dip join ]
drop
dup -1 peek swap
100 split drop
say "First 100 terms:"
[] swap witheach
[ number$ nested join ]
60 wrap$
cr cr say "1000th term: " echo</syntaxhighlight>
 
{{out}}
 
<pre>First 100 terms:
0 0 0 1 1 4 4 7 9 14 14 21 21 28 34 41 41 52 52 63 71 82 82
97 101 114 122 137 137 158 158 173 185 202 212 235 235 254
268 291 291 320 320 343 363 386 386 417 423 452 470 497 497
532 546 577 597 626 626 669 669 700 726 757 773 818 818 853
877 922 922 969 969 1006 1040 1079 1095 1148 1148 1195 1221
1262 1262 1321 1341 1384 1414 1461 1461 1526 1544 1591 1623
1670 1692 1755 1755 1810 1848 1907
 
1000th term: 195309</pre>
 
=={{header|Raku}}==
1,496

edits