Zsigmondy numbers: Difference between revisions

m (→‎{{header|J}}: browser ignores overflow: scroll; white-space: nowrap on syntaxhighlight tag)
Line 55:
=={{header|J}}==
Implementation:<syntaxhighlight lang=J>dp=: -/@:(^/) NB. (a,b) dp n is (a^n)-(b^n)
Zsigmondy=: dp % dp *(-./@:+,)&.:q: (dp 1 }. i.)</syntaxhighlight>
 
Task examples:<syntaxhighlight lang=J style="width: max-content"> Zs=: Zsigmondy"1 0&(1x+i.20) NB. first 20 in sequence
Zs 2 1
1 3 7 5 31 31 127 17 73 11 2047 13 8191 43 151 257 131071 5719 524287 20541
Zs 3 1
2 41 13 105 121 7 1093 8241 757 61 88573 73 797161 547 4561 65623281 64570081 703 581130733 59051181
Zs 4 1
3 5 217 17 341 13 5461 257 41611387 20541 1398101 241 22369621 3277 49981 65537 5726623061 4033 91625968981 61681
Zs 5 1
4 63 31 2613 781 217 19531 626313 15751 521 12207031 601 305175781 13021 315121 390626195313 190734863281 155015167 4768371582031 375601
Zs 6 1
5 7 43 37 1555311 31 55987 1297 46873 1111 72559411 1261 2612138803 399915713 1406371 1679617 3385331888947 46441 121871948002099 1634221
Zs 7 1
6 81 5719 5025 2801 43 137257 24021201 11799339331 2101 329554457 2353 16148168401 102943 4956001 57648022882401 38771752331201 117307 1899815864228857 56495051129901
Zs 3 2
1 5 19 13 211 7 2059 97 1009 5511 175099 61 1586131 463 3571 6817 129009091 577 1161737179 4621
Zs 5 3
2 81 49 3417 1441 19 37969 706353 19729 421 24325489 481 609554401 10039 216001 397186198593 381405156481 12979 9536162033329 288961
Zs 7 3
4 105 79 5829 4141 37 205339 24821241 127639 1705341 494287399 2041 24221854021 82573 3628081 57713622885681 58157596211761 109117 2849723505777919 4871281
Zs 7 5
2 123 109 7437 6841 3913 372709 30261513 176149 1661 964249309 1801 47834153641 75139 3162961 61554263077713 115933787267041 9039930133 5689910849522509 3949201</syntaxhighlight>
 
=={{header|Raku}}==
6,962

edits