Honaker primes: Difference between revisions

added Arturo
No edit summary
(added Arturo)
Line 151:
Honaker prime 10000 is prime 286069: 4043749
</pre>
 
=={{header|Arturo}}==
 
<syntaxhighlight lang="arturo">honaker?: function [n, pos]->
equal? sum digits n sum digits pos
 
idx: 0
found: 0
 
honakers: []
 
loop 2..∞ 'n [
if prime? n [
idx: idx + 1
 
if honaker? n idx [
found: found + 1
'honakers ++ @[@[found, idx, n]]
]
]
if found = 50 -> break
]
 
loop split.every: 5 honakers 'x ->
print map x 's -> pad as.code s 14</syntaxhighlight>
 
{{out}}
 
<pre> [1 32 131] [2 56 263] [3 88 457] [4 175 1039] [5 176 1049]
[6 182 1091] [7 212 1301] [8 218 1361] [9 227 1433] [10 248 1571]
[11 293 1913] [12 295 1933] [13 323 2141] [14 331 2221] [15 338 2273]
[16 362 2441] [17 377 2591] [18 386 2663] [19 394 2707] [20 397 2719]
[21 398 2729] [22 409 2803] [23 439 3067] [24 446 3137] [25 457 3229]
[26 481 3433] [27 499 3559] [28 508 3631] [29 563 4091] [30 571 4153]
[31 595 4357] [32 599 4397] [33 635 4703] [34 637 4723] [35 655 4903]
[36 671 5009] [37 728 5507] [38 751 5701] [39 752 5711] [40 755 5741]
[41 761 5801] [42 767 5843] [43 779 5927] [44 820 6301] [45 821 6311]
[46 826 6343] [47 827 6353] [48 847 6553] [49 848 6563] [50 857 6653]</pre>
 
=={{header|C++}}==
1,532

edits