pharo-llm/pharo-exercism-benchmark huggingface dataset:
"Exercise: Sieve"

sieve: limit
"Your task is to create a program that implements the Sieve of Eratosthenes algorithm to find all prime numbers less than or equal to a given number.
    A prime number is a number larger than 1 that is only divisible by 1 and itself.
    To use the Sieve of Eratosthenes, you first create a list of all the numbers between 2 and your given number.
    Then you repeat the following steps:
    1. Find the next unmarked number in your list (skipping over marked numbers). This is a prime number.
    2. Mark all the multiples of that prime number as not prime.
    You keep repeating these steps until you've gone through every number in your list.
    At the end, all the unmarked numbers are prime."
"(self new sieve: 10) >>> #(2 3 5 7)"
| markedList primes |
    markedList := OrderedCollection withAll: (2 to: limit).
    primes := OrderedCollection new.

    [ markedList notEmpty ] whileTrue: [
        | nextPrime |
        primes add: (nextPrime := markedList removeFirst).
        markedList removeAll: (markedList select: [ :i | i \\ nextPrime = 0 ])
    ].

    ^ primes asArray


"Tests"
testSieve
self assert: (task sieve: 1) equals: #().
  self assert: (task sieve: 2) equals: #(2).
  self assert: (task sieve: 10) equals: #(2 3 5 7).
  self assert: (task sieve: 13) equals: #(2 3 5 7 11 13).
  self assert: (task sieve: 1000) equals: #(2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449 457 461 463 467 479 487 491 499 503 509 521 523 541 547 557 563 569 571 577 587 593 599 601 607 613 617 619 631 641 643 647 653 659 661 673 677 683 691 701 709 719 727 733 739 743 751 757 761 769 773 787 797 809 811 821 823 827 829 839 853 857 859 863 877 881 883 887 907 911 919 929 937 941 947 953 967 971 977 983 991 997).
"Exercise: Etl"

etl: tileDictionary
"Your task is to change the data format of letters and their point values in the game.
    Currently, letters are stored in groups based on their score, in a one-to-many mapping.
    - 1 point: A, E, I, O, U, L, N, R, S, T,
    - 2 points: D, G,
    - 3 points: B, C, M, P,
    - 4 points: F, H, V, W, Y,
    - 5 points: K,
    - 8 points: J, X,
    - 10 points: Q, Z,
    This needs to be changed to store each individual letter with its score in a one-to-one mapping.
    - a is worth 1 point.
    - b is worth 3 points.
    - c is worth 3 points.
    - d is worth 2 points.
    - etc.
    As part of this change, the team has also decided to change the letters to be lower-case rather than upper-case."
"(self new etl: ((Dictionary new) add: ('1'->#('A')); yourself)) >>> ((Dictionary new) add: ('a'->1); yourself)"
"(self new etl: ((Dictionary new) add: ('3'->#('B' 'C')); yourself)) >>> ((Dictionary new) add: ('b'->3); add: ('c'->3); yourself)"
"(self new etl: ((Dictionary new) add: ('2'->#('D')); yourself)) >>> ((Dictionary new) add: ('d'->2); yourself)"
^ tileDictionary associations
    inject: Dictionary new
    into: [:result :scoreLettersPair |
        scoreLettersPair value do: [:letter |
            result at: letter asLowercase put: scoreLettersPair key asNumber].
    result]


"Tests"
testEtl
self assert: (task etl: ((Dictionary new) add: ('1'->#('A' )); yourself)) equals: ((Dictionary new) add: ('a'->1); yourself).
  self assert: (task etl: ((Dictionary new) add: ('1'->#('A' 'E' 'I' 'O' 'U' )); yourself)) equals: ((Dictionary new) add: ('i'->1); add: ('e'->1); add: ('a'->1); add: ('u'->1); add: ('o'->1); yourself).
  self assert: (task etl: ((Dictionary new) add: ('1'->#('A' 'E' )); add: ('2'->#('D' 'G' )); yourself)) equals: ((Dictionary new) add: ('g'->2); add: ('a'->1); add: ('d'->2); add: ('e'->1); yourself).
  self assert: (task etl: ((Dictionary new) add: ('8'->#('J' 'X' )); add: ('4'->#('F' 'H' 'V' 'W' 'Y' )); add: ('2'->#('D' 'G' )); add: ('5'->#('K' )); add: ('3'->#('B' 'C' 'M' 'P' )); add: ('1'->#('A' 'E' 'I' 'O' 'U' 'L' 'N' 'R' 'S' 'T' )); add: ('10'->#('Q' 'Z' )); yourself)) equals: ((Dictionary new) add: ('g'->2); add: ('z'->10); add: ('s'->1); add: ('l'->1); add: ('e'->1); add: ('x'->8); add: ('q'->10); add: ('j'->8); add: ('c'->3); add: ('v'->4); add: ('o'->1); add: ('h'->4); add: ('a'->1); add: ('t'->1); add: ('m'->3); add: ('f'->4); add: ('y'->4); add: ('r'->1); add: ('k'->5); add: ('d'->2); add: ('w'->4); add: ('p'->3); add: ('i'->1); add: ('b'->3); add: ('u'->1); add: ('n'->1); yourself)
"Exercise: SpaceAge"

spaceAge: aPlanet at: aSeconds
"Given an age in seconds, calculate how old someone would be on:
    - Mercury: orbital period 0.2408467 Earth years
    - Venus: orbital period 0.61519726 Earth years
    - Earth: orbital period 1.0 Earth years, 365.25 Earth days, or 31557600 seconds
    - Mars: orbital period 1.8808158 Earth years
    - Jupiter: orbital period 11.862615 Earth years
    - Saturn: orbital period 29.447498 Earth years
    - Uranus: orbital period 84.016846 Earth years
    - Neptune: orbital period 164.79132 Earth years
    Note: The actual length of one complete orbit of the Earth around the sun is closer to 365.256 days (1 sidereal year).
    The Gregorian calendar has, on average, 365.2425 days.
    While not entirely accurate, 365.25 is the value used in this exercise."
"((self new spaceAge: 'Earth' at: 1000000000) roundTo: 0.01) >>> 31.69"
| earthOrbitalPeriod orbitalPeriods |
	earthOrbitalPeriod := 31557600.
	orbitalPeriods := {
        ('Earth' -> earthOrbitalPeriod).
        ('Mercury' -> (earthOrbitalPeriod * 0.2408467)).
        ('Venus' -> (earthOrbitalPeriod * 0.61519726)).
        ('Mars' -> (earthOrbitalPeriod * 1.8808158)).
        ('Jupiter' -> (earthOrbitalPeriod * 11.862615)).
        ('Saturn' -> (earthOrbitalPeriod * 29.447498)).
        ('Uranus' -> (earthOrbitalPeriod * 84.016846)).
        ('Neptune' -> (earthOrbitalPeriod * 164.79132)) }
        asDictionary.
	(orbitalPeriods includesKey: aPlanet) ifFalse: [
		self error: aPlanet asString , ' is not a valid planet' ].
	^ aSeconds / (orbitalPeriods at: aPlanet)


"Tests"
testSpaceAge
self assert: ((task spaceAge: 'Earth' at: 1000000000) roundTo: 1 / 100) asFloat equals: 31.69.
  self assert: ((task spaceAge: 'Mercury' at: 2134835688) roundTo: 1 / 100) asFloat equals: 280.88.
  self assert: ((task spaceAge: 'Venus' at: 189839836) roundTo: 1 / 100) asFloat equals: 9.78.
  self assert: ((task spaceAge: 'Mars' at: 2129871239) roundTo: 1 / 100) asFloat equals: 35.88.
  self assert: ((task spaceAge: 'Jupiter' at: 901876382) roundTo: 1 / 100) asFloat equals: 2.41.
  self assert: ((task spaceAge: 'Saturn' at: 2000000000) roundTo: 1 / 100) asFloat equals: 2.15.
  self assert: ((task spaceAge: 'Uranus' at: 1210123456) roundTo: 1 / 100) asFloat equals: 0.46.
  self assert: ((task spaceAge: 'Neptune' at: 1821023456) roundTo: 1 / 100) asFloat equals: 0.35.
  self
		should: [ task spaceAge: 'Pluto' at: 57843208475 ]
		raise: Error
"Exercise: RomanNumerals"

romanNumerals: anInteger
"Your task is to convert a number from Arabic numerals to Roman numerals.
    For this exercise, we are only concerned about traditional Roman numerals, in which the largest number is MMMCMXCIX (or 3,999)."
"(self new romanNumerals: 1) >>> 'I'"
"(self new romanNumerals: 104) >>> 'CIV'"
"(self new romanNumerals: 1996) >>> 'MCMXCVI'"
| number table |
    number := anInteger.
    ^ String streamContents: [:s |
        table := { (1000 -> 'M'). (900 -> 'CM'). (500 -> 'D'). (400 -> 'CD'). (100 -> 'C'). (90 -> 'XC'). (50 -> 'L'). (40 -> 'XL'). (10 -> 'X'). (9 -> 'IX'). (5 -> 'V'). (4 -> 'IV'). (1 -> 'I') }.
        table do: [:assoc |
            | arabic roman |
            arabic := assoc key.
            roman := assoc value.
            [ number >= arabic ] whileTrue: [
                s << roman.
                number := number - arabic ] ] ]


"Tests"
testRomanNumerals
self assert: (task romanNumerals: 1) equals: 'I'.
  self assert: (task romanNumerals: 2) equals: 'II'.
  self assert: (task romanNumerals: 3) equals: 'III'.
  self assert: (task romanNumerals: 4) equals: 'IV'.
  self assert: (task romanNumerals: 5) equals: 'V'.
  self assert: (task romanNumerals: 6) equals: 'VI'.
  self assert: (task romanNumerals: 9) equals: 'IX'.
  self assert: (task romanNumerals: 27) equals: 'XXVII'.
  self assert: (task romanNumerals: 48) equals: 'XLVIII'.
  self assert: (task romanNumerals: 49) equals: 'XLIX'.
  self assert: (task romanNumerals: 59) equals: 'LIX'.
  self assert: (task romanNumerals: 93) equals: 'XCIII'.
  self assert: (task romanNumerals: 141) equals: 'CXLI'.
  self assert: (task romanNumerals: 163) equals: 'CLXIII'.
  self assert: (task romanNumerals: 402) equals: 'CDII'.
  self assert: (task romanNumerals: 575) equals: 'DLXXV'.
  self assert: (task romanNumerals: 911) equals: 'CMXI'.
  self assert: (task romanNumerals: 1024) equals: 'MXXIV'.
  self assert: (task romanNumerals: 3000) equals: 'MMM'
"Exercise: ReverseString"

reverseString: aString
"Your task is to reverse a given string."
"(self new reverseString: 'stressed') >>> 'desserts'"
"(self new reverseString: 'strops') >>> 'sports'"
"(self new reverseString: 'racecar') >>> 'racecar'"
^ String streamContents: [:stream |
        aString size to: 1 by: -1 do: [:i |
            stream nextPut: (aString at: i) ]]


"Tests"
testReverseString
self assert: (task reverseString: '') equals: ''.
  self assert: (task reverseString: 'robot') equals: 'tobor'.
  self assert: (task reverseString: 'Ramen') equals: 'nemaR'.
  self assert: (task reverseString: 'I''m hungry!') equals: '!yrgnuh m''I'.
  self assert: (task reverseString: 'racecar') equals: 'racecar'
"Exercise: DartsX"

dartsX: x y: y
"Calculate the points scored in a single toss of a Darts game.
    Darts is a game where players throw darts at a target.
    In our particular instance of the game, the target rewards 4 different amounts of points, depending on where the dart lands:
    - If the dart lands outside the target, player earns no points (0 points).
    - If the dart lands in the outer circle of the target, player earns 1 point.
    - If the dart lands in the middle circle of the target, player earns 5 points.
    - If the dart lands in the inner circle of the target, player earns 10 points.
    The outer circle has a radius of 10 units (this is equivalent to the total radius for the entire target), the middle circle a radius of 5 units, and the inner circle a radius of 1. 
    Of course, they are all centered at the same point - that is, the circles are concentric defined by the coordinates (0, 0).
    Given a point in the target (defined by its Cartesian coordinates `x` and `y`, where `x` and `y` are real), calculate the correct score earned by a dart landing at that point."
"(self new dartsX: -9 y: 9) >>> 0"
"(self new dartsX: 0 y: 10) >>> 1"
"(self new dartsX: -5 y: 0) >>> 5"
| distance |
    distance := (x squared + y squared) sqrt.
    distance > 10 ifTrue: [ ^ 0 ].
    distance > 5 ifTrue: [ ^ 1 ].
    distance > 1 ifTrue: [ ^ 5 ].
    ^ 10


"Tests"
testDarts
self assert: (task dartsX: -9 y: 9) equals: 0.
  self assert: (task dartsX: 0 y: 10) equals: 1.
  self assert: (task dartsX: -5 y: 0) equals: 5.
  self assert: (task dartsX: 0 y: -1) equals: 10.
  self assert: (task dartsX: 0 y: 0) equals: 10.
  self assert: (task dartsX: -0.1 y: -0.1) equals: 10.
  self assert: (task dartsX: 0.7 y: 0.7) equals: 10.
  self assert: (task dartsX: 0.8 y: -0.8) equals: 5.
  self assert: (task dartsX: -3.5 y: 3.5) equals: 5.
  self assert: (task dartsX: -3.6 y: -3.6) equals: 1.
  self assert: (task dartsX: -7.0 y: 7.0) equals: 1.
  self assert: (task dartsX: 7.1 y: -7.1) equals: 0.
  self assert: (task dartsX: 0.5 y: -4) equals: 5
"Exercise: CollatzConjecture"

collatzConjecture: n
"The Collatz Conjecture or 3x+1 problem can be summarized as follows:
    Take any positive integer n. If n is even, divide n by 2 to get n / 2.
    If n is odd, multiply n by 3 and add 1 to get 3n + 1.
    Repeat the process indefinitely. The conjecture states that no matter which number you start with, you will always reach 1 eventually.
    Given a number n, return the number of steps required to reach 1."
"(self new collatzConjecture: 1) >>> 0"
"(self new collatzConjecture: 12) >>> 9"
| steps value |
	n <= 0 ifTrue: [
		DomainError signal: 'Only positive numbers are allowed' ].
	steps := 0.
	value := n.
	[ value > 1 ] whileTrue: [
			steps := steps + 1.
			value := value even
				         ifTrue: [ value // 2 ]
				         ifFalse: [ 3 * value + 1 ] ].
	^ steps


"Tests"
testCollatzConjecture
self assert: (task collatzConjecture: 1) equals: 0.
  self assert: (task collatzConjecture: 16) equals: 4.
  self assert: (task collatzConjecture: 12) equals: 9.
  self assert: (task collatzConjecture: 1000000) equals: 152.
  self
    should: [ task collatzConjecture: 0 ]
    raise: Error.
  self
    should: [ task collatzConjecture: -15 ]
    raise: Error
"Exercise: Leap"

leap: aYear
"Your task is to determine whether a given year is a leap year.
    A leap year (in the Gregorian calendar) occurs:
    - In every year that is evenly divisible by 4.
    - Unless the year is evenly divisible by 100, in which case it's only a leap year if the year is also evenly divisible by 400"
"(self new leap: 1997) >>> false"
"(self new leap: 1996) >>> true"
"(self new leap: 1900) >>> false"
"(self new leap: 2000) >>> true"
^ (aYear isDivisibleBy: 4)
        and: [ (aYear isDivisibleBy: 400)
                or: [ (aYear isDivisibleBy: 100) not ] ]


"Tests"
testLeap
self assert: (task leap: 2015) equals: false.
  self assert: (task leap: 1970) equals: false.
  self assert: (task leap: 1996) equals: true.
  self assert: (task leap: 2100) equals: false.
  self assert: (task leap: 2000) equals: true.
  self assert: (task leap: 1800) equals: false.
"Exercise: Pangram"

pangram: aString
"Your task is to figure out if a sentence is a pangram.
    A pangram is a sentence using every letter of the alphabet at least once.
    It is case insensitive, so it doesn't matter if a letter is lower-case (e.g. k) or upper-case (e.g. K).
    For this exercise, a sentence is a pangram if it contains each of the 26 letters in the English alphabet."
"(self new pangram: 'the quick brown fox jumps over the lazy dog') >>> true"
| letters |
    letters := aString asLowercase select: [:c | c isLetter].
    ^ letters asSet = Character alphabet asSet


"Tests"
testPangram
self assert: (task pangram: '') equals: false.
  self assert: (task pangram: 'abcdefghijklmnopqrstuvwxyz') equals: true.
  self assert: (task pangram: 'the quick brown fox jumps over the lazy dog') equals: true.
  self assert: (task pangram: 'a quick movement of the enemy will jeopardize five gunboats') equals: false.
  self assert: (task pangram: 'five boxing wizards jump quickly at it') equals: false.
  self assert: (task pangram: 'the_quick_brown_fox_jumps_over_the_lazy_dog') equals: true.
  self assert: (task pangram: 'the 1 quick brown fox jumps over the 2 lazy dogs') equals: true.
  self assert: (task pangram: '7h3 qu1ck brown fox jumps ov3r 7h3 lazy dog') equals: false.
  self assert: (task pangram: '"Five quacking Zephyrs jolt my wax bed."') equals: true.
  self assert: (task pangram: 'the quick brown fox jumps over with lazy FX') equals: false
"Exercise: Raindrops"

raindrops: aNumber
"Your task is to convert a number into its corresponding raindrop sounds.
    If a given number:
    - is divisible by 3, add 'Pling' to the result.
    - is divisible by 5, add 'Plang' to the result.
    - is divisible by 7, add 'Plong' to the result.
    - is not divisible by 3, 5, or 7, the result should be the number as a string."
"(self new raindrops: 28) >>> 'Plong'"
"(self new raindrops: 30) >>> 'PlingPlang'"
"(self new raindrops: 34) >>> '34'"
^ String streamContents: [ :stream |
			  {
				  (3 -> 'Pling').
				  (5 -> 'Plang').
				  (7 -> 'Plong') } do: [ :factor |
				  aNumber \\ factor key = 0 ifTrue: [
					  stream nextPutAll: factor value ] ].
			  stream isEmpty ifTrue: [ stream print: aNumber ] ]


"Tests"
testRaindrops
self assert: (task raindrops: 1) equals: '1'.
  self assert: (task raindrops: 3) equals: 'Pling'.
  self assert: (task raindrops: 5) equals: 'Plang'.
  self assert: (task raindrops: 7) equals: 'Plong'.
  self assert: (task raindrops: 6) equals: 'Pling'.
  self assert: (task raindrops: 8) equals: '8'.
  self assert: (task raindrops: 9) equals: 'Pling'.
  self assert: (task raindrops: 10) equals: 'Plang'.
  self assert: (task raindrops: 14) equals: 'Plong'.
  self assert: (task raindrops: 15) equals: 'PlingPlang'.
  self assert: (task raindrops: 21) equals: 'PlingPlong'.
  self assert: (task raindrops: 25) equals: 'Plang'.
  self assert: (task raindrops: 27) equals: 'Pling'.
  self assert: (task raindrops: 35) equals: 'PlangPlong'.
  self assert: (task raindrops: 49) equals: 'Plong'.
  self assert: (task raindrops: 52) equals: '52'.
  self assert: (task raindrops: 105) equals: 'PlingPlangPlong'.
  self assert: (task raindrops: 3125) equals: 'Plang'
"Exercise: Grains"

grains: arg
"Calculate the number of grains of wheat on a chessboard given that the number on each square doubles.
    There once was a wise servant who saved the life of a prince.
    The king promised to pay whatever the servant could dream up.
    Knowing that the king loved chess, the servant told the king he would like to have grains of wheat.
    One grain on the first square of a chess board, with the number of grains doubling on each successive square.
    There are 64 squares on a chessboard (where square 1 has one grain, square 2 has two grains, and so on).
    Write code that shows:
    - how many grains were on a given square, and
    - the total number of grains on the chessboard (if `arg` is #total)"
"(self new grains: 1) >>> 1"
"(self new grains: 2) >>> 2"
arg = #total ifTrue: [
        ^ (1 to: 64) sum: [:i | 2 raisedTo: i - 1 ]
    ].

    ((arg isKindOf: Integer) and: [ arg between: 1 and: 64 ]) ifFalse: [
        ^ Error signal: 'square must be between 1 and 64'
    ].

    ^ 2 raisedTo: arg - 1


"Tests"
testGrains
self assert: (task grains: 1) equals: 1.
  self assert: (task grains: 2) equals: 2.
  self assert: (task grains: 3) equals: 4.
  self assert: (task grains: 4) equals: 8.
  self assert: (task grains: 16) equals: 32768.
  self assert: (task grains: 32) equals: 2147483648.
  self assert: (task grains: 64) equals: 9223372036854775808.

  self
    should: [ task grains: 0 ]
    raise: Error.

  self
    should: [ task grains: -1 ]
    raise: Error.

  self
    should: [ task grains: 65 ]
    raise: Error.

  self assert: (task grains: #total) equals: 18446744073709551615
"Exercise: SecretHandshake"

secretHandshake: anInteger
"Your task is to convert a number between 1 and 31 to a sequence of actions in the secret handshake.
    The sequence of actions is chosen by looking at the rightmost five digits of the number once it's been converted to binary. Start at the right-most digit and move left.
    The actions for each number place are:
    00001 = wink
    00010 = double blink
    00100 = close your eyes
    01000 = jump
    10000 = Reverse the order of the operations in the secret handshake."
"(self new secretHandshake: 9) >>> #('wink' 'jump')"
"(self new secretHandshake: 26) >>> #('jump' 'double blink')"
| result |
    result := OrderedCollection new.
    (anInteger allMask: 2r1) ifTrue: [ result add: 'wink' ].
    (anInteger allMask: 2r10) ifTrue: [ result add: 'double blink' ].
    (anInteger allMask: 2r100) ifTrue: [ result add: 'close your eyes' ].
    (anInteger allMask: 2r1000) ifTrue: [ result add: 'jump' ].
    result := result asArray.
    ^ (anInteger allMask: 2r10000)
        ifTrue: [ result reversed ]
        ifFalse: [ result ]


"Tests"
testSecretHandshake
self assert: (task secretHandshake: 1) equals: #('wink').
  self assert: (task secretHandshake: 2) equals: #('double blink').
  self assert: (task secretHandshake: 4) equals: #('close your eyes').
  self assert: (task secretHandshake: 8) equals: #('jump').
  self assert: (task secretHandshake: 3) equals: #('wink' 'double blink').
  self assert: (task secretHandshake: 19) equals: #('double blink' 'wink').
  self assert: (task secretHandshake: 24) equals: #('jump').
  self assert: (task secretHandshake: 16) equals: #().
  self assert: (task secretHandshake: 15) equals: #('wink' 'double blink' 'close your eyes' 'jump').
  self assert: (task secretHandshake: 31) equals: #('jump' 'close your eyes' 'double blink' 'wink').
  self assert: (task secretHandshake: 0) equals: #()
"Exercise: SumOfMultiples"

sumOfMultiples: factors limit: level
"Your task is to write the code that calculates the energy points that get awarded to players when they complete a level.
    The points awarded depend on two things:
    - The level (a number) that the player completed.
    - The base value of each magical item collected by the player during that level.
    The energy points are awarded according to the following rules:
    1. For each magical item, take the base value and find all the multiples of that value that are less than the level number.
    2. Combine the sets of numbers.
    3. Remove any duplicates.
    4. Calculate the sum of all the numbers that are left."
"(self new sumOfMultiples: #(3 5) limit: 20) >>> 78"
| sum |
	sum := 0.
	level > 1 ifTrue: [
			1 to: level - 1 do: [ :n |
					(factors anySatisfy: [ :f | f ~= 0 and: [ n isDivisibleBy: f ] ])
						ifTrue: [ sum := sum + n ] ] ].
	^ sum


"Tests"
testSumOfMultiples
self assert: (task sumOfMultiples: #(3 5) limit: 1) equals: 0.
  self assert: (task sumOfMultiples: #(3 5) limit: 4) equals: 3.
  self assert: (task sumOfMultiples: #(3) limit: 7) equals: 9.
  self assert: (task sumOfMultiples: #(3 5) limit: 10) equals: 23.
  self assert: (task sumOfMultiples: #(3 5) limit: 100) equals: 2318.
  self assert: (task sumOfMultiples: #(3 5) limit: 1000) equals: 233168.
  self assert: (task sumOfMultiples: #(7 13 17) limit: 20) equals: 51.
  self assert: (task sumOfMultiples: #(4 6) limit: 15) equals: 30.
  self assert: (task sumOfMultiples: #(5 6 8) limit: 150) equals: 4419.
  self assert: (task sumOfMultiples: #(5 25) limit: 51) equals: 275.
  self assert: (task sumOfMultiples: #(43 47) limit: 10000) equals: 2203160.
  self assert: (task sumOfMultiples: #(1) limit: 100) equals: 4950.
  self assert: (task sumOfMultiples: #() limit: 10000) equals: 0.
  self assert: (task sumOfMultiples: #(0) limit: 1) equals: 0.
  self assert: (task sumOfMultiples: #(3 0) limit: 4) equals: 3.
  self assert: (task sumOfMultiples: #(2 3 5 7 11) limit: 10000) equals: 39614537