Sum of primes in odd positions is prime: Difference between revisions

Content added Content deleted
(Added Perl)
m (→‎{{header|Raku}}: minor tweak to satisfy task spec)
Line 236: Line 236:
my @sums = [\+] @odd;
my @sums = [\+] @odd;


say .fmt('%5d') for grep { .[1].is-prime }, ( @odd Z @sums );</lang>
say .fmt('%5d') for grep { .[1].is-prime }, ( (1,3…*) Z @odd Z @sums );</lang>
{{out}}
{{out}}
<pre>
<pre> 1 2 2
2 2
3 5 7
5 7
11 31 89
27 103 659
31 89
35 149 1181
103 659
67 331 5021
149 1181
91 467 9923
331 5021
95 499 10909
467 9923
99 523 11941
499 10909
119 653 17959
523 11941
143 823 26879</pre>
653 17959
823 26879</pre>


=={{header|REXX}}==
=={{header|REXX}}==