Sum of primes in odd positions is prime: Difference between revisions
Content added Content deleted
SqrtNegInf (talk | contribs) (Added Perl) |
SqrtNegInf (talk | contribs) 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 |
||
3 5 7 |
|||
11 31 89 |
|||
⚫ | |||
31 89 |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
=={{header|REXX}}== |
=={{header|REXX}}== |