Skip to content

Commit 38228e0

Browse files
committed
Document Euler problem 1
1 parent b91954a commit 38228e0

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

euler/prob001-cspencer.pl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
=begin pod
2+
3+
=head1 Project Euler Problem 1
4+
5+
=head1 AUTHOR: cspence
6+
7+
=head1 DESCRIPTION
8+
9+
If we list all the natural numbers below 10 that are multiples of 3 or 5, we
10+
get 3, 5, 6 and 9. The sum of these multiples is 23.
11+
12+
Find the sum of all the multiples of 3 or 5 below 1000.
13+
14+
Expected answer: 233168
15+
16+
=end pod
17+
118
use v6;
219

320
(1..^1000).grep({ ! ($^a % 3 and $^a % 5) }).reduce({ $^a + $^b }).say;

0 commit comments

Comments
 (0)