Iccanobif primes: Difference between revisions

added Arturo
(added Arturo)
Line 70:
2 3 5 31 43 773 7951 64901 52057 393121
</pre>
 
=={{header|Arturo}}==
 
<syntaxhighlight lang="arturo">summarize: function [n :string][
;; description: « returns a summary of a numeric string
s: size n
if s > 20 -> n: ((take n 10)++"...")++drop n s-10
n ++ ~" (|s| digits)"
]
 
[a b count]: [0 1 0]
print "First 27 Iccanobif primes:"
while -> count < 27 [
if prime? to :integer r: <= reverse ~"|a|" [
print [pad ~"|count+1|" 2 "->" summarize r]
inc 'count
]
[a b]: @[b a+b]
]</syntaxhighlight>
 
{{out}}
 
<pre>First 27 Iccanobif primes:
1 -> 2 (1 digits)
2 -> 3 (1 digits)
3 -> 5 (1 digits)
4 -> 31 (2 digits)
5 -> 43 (2 digits)
6 -> 773 (3 digits)
7 -> 7951 (4 digits)
8 -> 64901 (5 digits)
9 -> 52057 (5 digits)
10 -> 393121 (6 digits)
11 -> 56577108676171 (14 digits)
12 -> 9406476074...3258103531 (21 digits)
13 -> 5237879497...9575442761 (37 digits)
14 -> 9026258083...2307801963 (40 digits)
15 -> 1990033567...3266446403 (80 digits)
16 -> 7784113736...3685331923 (104 digits)
17 -> 3772258590...2830756131 (137 digits)
18 -> 7573619389...4714305761 (330 digits)
19 -> 1789033684...5235035913 (406 digits)
20 -> 9232716310...6047302507 (409 digits)
21 -> 5042015781...7362214481 (503 digits)
22 -> 3051101247...1330018201 (888 digits)
23 -> 4681854704...4645856321 (1020 digits)
24 -> 8710134785...8865227391 (1122 digits)
25 -> 1745165602...1843652461 (1911 digits)
26 -> 4898934056...4215909399 (1947 digits)
27 -> 1274692768...7994940101 (2283 digits)</pre>
 
=={{header|jq}}==
1,532

edits