Zsigmondy numbers: Difference between revisions

J
m (→‎{{header|Wren}}: Removed some closing blank lines from the output.)
(J)
Line 53:
 
 
=={{header|J}}==
Implementation:<syntaxhighlight lang=J>dp=: -/@:(^/) NB. (a,b) dp n is (a^n)-(b^n)
Zsigmondy=: dp % dp *./@:+. (dp 1 }. i.)</syntaxhighlight>
 
Task examples:<syntaxhighlight lang=J> Zs=: Zsigmondy"1 0&(1x+i.20) NB. first 20 in sequence
Zs 2 1
1 3 7 5 31 3 127 17 73 11 2047 13 8191 43 151 257 131071 57 524287 205
Zs 3 1
2 4 13 10 121 7 1093 82 757 61 88573 73 797161 547 4561 6562 64570081 703 581130733 5905
Zs 4 1
3 5 21 17 341 13 5461 257 4161 205 1398101 241 22369621 3277 49981 65537 5726623061 4033 91625968981 61681
Zs 5 1
4 6 31 26 781 21 19531 626 15751 521 12207031 601 305175781 13021 315121 390626 190734863281 15501 4768371582031 375601
Zs 6 1
5 7 43 37 1555 31 55987 1297 46873 1111 72559411 1261 2612138803 39991 1406371 1679617 3385331888947 46441 121871948002099 1634221
Zs 7 1
6 8 57 50 2801 43 137257 2402 117993 2101 329554457 2353 16148168401 102943 4956001 5764802 38771752331201 117307 1899815864228857 5649505
Zs 3 2
1 5 19 13 211 7 2059 97 1009 55 175099 61 1586131 463 3571 6817 129009091 577 1161737179 4621
Zs 5 3
2 8 49 34 1441 19 37969 706 19729 421 24325489 481 609554401 10039 216001 397186 381405156481 12979 9536162033329 288961
Zs 7 3
4 10 79 58 4141 37 205339 2482 127639 1705 494287399 2041 24221854021 82573 3628081 5771362 58157596211761 109117 2849723505777919 4871281
Zs 7 5
2 12 109 74 6841 39 372709 3026 176149 1661 964249309 1801 47834153641 75139 3162961 6155426 115933787267041 90399 5689910849522509 3949201</syntaxhighlight>
=={{header|Raku}}==
First twenty elements of each.
6,962

edits