fix(challenge-md): Fix quotes that failed in the transform
This commit is contained in:
committed by
mrugesh mohapatra
parent
392b28fa55
commit
a859035023
@ -21,13 +21,13 @@ Find the sum of all the multiples of 3 or 5 below the provided parameter value <
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>multiplesOf3and5(1000)</code> should return 233168.
|
||||
testString: 'assert.strictEqual(multiplesOf3and5(1000), 233168, ''<code>multiplesOf3and5(1000)</code> should return 233168.'');'
|
||||
testString: 'assert.strictEqual(multiplesOf3and5(1000), 233168, "<code>multiplesOf3and5(1000)</code> should return 233168.");'
|
||||
- text: <code>multiplesOf3and5(49)</code> should return 543.
|
||||
testString: 'assert.strictEqual(multiplesOf3and5(49), 543, ''<code>multiplesOf3and5(49)</code> should return 543.'');'
|
||||
testString: 'assert.strictEqual(multiplesOf3and5(49), 543, "<code>multiplesOf3and5(49)</code> should return 543.");'
|
||||
- text: <code>multiplesOf3and5(19564)</code> should return 89301183.
|
||||
testString: 'assert.strictEqual(multiplesOf3and5(19564), 89301183, ''<code>multiplesOf3and5(19564)</code> should return 89301183.'');'
|
||||
testString: 'assert.strictEqual(multiplesOf3and5(19564), 89301183, "<code>multiplesOf3and5(19564)</code> should return 89301183.");'
|
||||
- text: Your function is not returning the correct result using our tests values.
|
||||
testString: 'assert.strictEqual(multiplesOf3and5(8456), 16687353, ''Your function is not returning the correct result using our tests values.'');'
|
||||
testString: 'assert.strictEqual(multiplesOf3and5(8456), 16687353, "Your function is not returning the correct result using our tests values.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -21,13 +21,13 @@ Find the sum of all the primes below n.
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>primeSummation(17)</code> should return 41.
|
||||
testString: 'assert.strictEqual(primeSummation(17), 41, ''<code>primeSummation(17)</code> should return 41.'');'
|
||||
testString: 'assert.strictEqual(primeSummation(17), 41, "<code>primeSummation(17)</code> should return 41.");'
|
||||
- text: <code>primeSummation(2001)</code> should return 277050.
|
||||
testString: 'assert.strictEqual(primeSummation(2001), 277050, ''<code>primeSummation(2001)</code> should return 277050.'');'
|
||||
testString: 'assert.strictEqual(primeSummation(2001), 277050, "<code>primeSummation(2001)</code> should return 277050.");'
|
||||
- text: <code>primeSummation(140759)</code> should return 873608362.
|
||||
testString: 'assert.strictEqual(primeSummation(140759), 873608362, ''<code>primeSummation(140759)</code> should return 873608362.'');'
|
||||
testString: 'assert.strictEqual(primeSummation(140759), 873608362, "<code>primeSummation(140759)</code> should return 873608362.");'
|
||||
- text: <code>primeSummation(2000000)</code> should return 142913828922.
|
||||
testString: 'assert.strictEqual(primeSummation(2000000), 142913828922, ''<code>primeSummation(2000000)</code> should return 142913828922.'');'
|
||||
testString: 'assert.strictEqual(primeSummation(2000000), 142913828922, "<code>primeSummation(2000000)</code> should return 142913828922.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -22,7 +22,7 @@ By finding the first arrangement to contain over 1012 = 1,000,000,000,000 discs
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler100()</code> should return 756872327473.
|
||||
testString: 'assert.strictEqual(euler100(), 756872327473, ''<code>euler100()</code> should return 756872327473.'');'
|
||||
testString: 'assert.strictEqual(euler100(), 756872327473, "<code>euler100()</code> should return 756872327473.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -40,7 +40,7 @@ Find the sum of FITs for the BOPs.
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler101()</code> should return 37076114526.
|
||||
testString: 'assert.strictEqual(euler101(), 37076114526, ''<code>euler101()</code> should return 37076114526.'');'
|
||||
testString: 'assert.strictEqual(euler101(), 37076114526, "<code>euler101()</code> should return 37076114526.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -26,7 +26,7 @@ NOTE: The first two examples in the file represent the triangles in the example
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler102()</code> should return 228.
|
||||
testString: 'assert.strictEqual(euler102(), 228, ''<code>euler102()</code> should return 228.'');'
|
||||
testString: 'assert.strictEqual(euler102(), 228, "<code>euler102()</code> should return 228.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -28,7 +28,7 @@ NOTE: This problem is related to Problem 105 and Problem 106.
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler103()</code> should return 20313839404245.
|
||||
testString: 'assert.strictEqual(euler103(), 20313839404245, ''<code>euler103()</code> should return 20313839404245.'');'
|
||||
testString: 'assert.strictEqual(euler103(), 20313839404245, "<code>euler103()</code> should return 20313839404245.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -23,7 +23,7 @@ Given that Fk is the first Fibonacci number for which the first nine digits AND
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler104()</code> should return 329468.
|
||||
testString: 'assert.strictEqual(euler104(), 329468, ''<code>euler104()</code> should return 329468.'');'
|
||||
testString: 'assert.strictEqual(euler104(), 329468, "<code>euler104()</code> should return 329468.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -25,7 +25,7 @@ NOTE: This problem is related to Problem 103 and Problem 106.
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler105()</code> should return 73702.
|
||||
testString: 'assert.strictEqual(euler105(), 73702, ''<code>euler105()</code> should return 73702.'');'
|
||||
testString: 'assert.strictEqual(euler105(), 73702, "<code>euler105()</code> should return 73702.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -26,7 +26,7 @@ NOTE: This problem is related to Problem 103 and Problem 105.
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler106()</code> should return 21384.
|
||||
testString: 'assert.strictEqual(euler106(), 21384, ''<code>euler106()</code> should return 21384.'');'
|
||||
testString: 'assert.strictEqual(euler106(), 21384, "<code>euler106()</code> should return 21384.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -35,7 +35,7 @@ Using network.txt (right click and 'Save Link/Target As...'), a 6K text file con
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler107()</code> should return 259679.
|
||||
testString: 'assert.strictEqual(euler107(), 259679, ''<code>euler107()</code> should return 259679.'');'
|
||||
testString: 'assert.strictEqual(euler107(), 259679, "<code>euler107()</code> should return 259679.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -24,7 +24,7 @@ What is the least value of <var>n</var> for which the number of distinct solutio
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>diophantineOne()</code> should return 180180.
|
||||
testString: 'assert.strictEqual(diophantineOne(), 180180, ''<code>diophantineOne()</code> should return 180180.'');'
|
||||
testString: 'assert.strictEqual(diophantineOne(), 180180, "<code>diophantineOne()</code> should return 180180.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -66,7 +66,7 @@ How many distinct ways can a player checkout with a score less than 100?
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler109()</code> should return 38182.
|
||||
testString: 'assert.strictEqual(euler109(), 38182, ''<code>euler109()</code> should return 38182.'');'
|
||||
testString: 'assert.strictEqual(euler109(), 38182, "<code>euler109()</code> should return 38182.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -44,9 +44,9 @@ What is the greatest product of four adjacent numbers in the same direction (up,
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>largestGridProduct(grid)</code> should return 70600674.
|
||||
testString: 'assert.strictEqual(largestGridProduct(grid), 70600674, ''<code>largestGridProduct(grid)</code> should return 70600674.'');'
|
||||
testString: 'assert.strictEqual(largestGridProduct(grid), 70600674, "<code>largestGridProduct(grid)</code> should return 70600674.");'
|
||||
- text: <code>largestGridProduct(testGrid)</code> should return 14169081.
|
||||
testString: 'assert.strictEqual(largestGridProduct(testGrid), 14169081, ''<code>largestGridProduct(testGrid)</code> should return 14169081.'');'
|
||||
testString: 'assert.strictEqual(largestGridProduct(testGrid), 14169081, "<code>largestGridProduct(testGrid)</code> should return 14169081.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -23,7 +23,7 @@ What is the least value of <var>n</var> for which the number of distinct solutio
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>diophantineTwo</code> should return 9350130049860600.
|
||||
testString: 'assert.strictEqual(diophantineTwo(), 9350130049860600, ''<code>diophantineTwo()</code> should return 9350130049860600.'');'
|
||||
testString: 'assert.strictEqual(diophantineTwo(), 9350130049860600, "<code>diophantineTwo()</code> should return 9350130049860600.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -72,7 +72,7 @@ Find the sum of all S(10, d).
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler111()</code> should return 612407567715.
|
||||
testString: 'assert.strictEqual(euler111(), 612407567715, ''<code>euler111()</code> should return 612407567715.'');'
|
||||
testString: 'assert.strictEqual(euler111(), 612407567715, "<code>euler111()</code> should return 612407567715.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -25,7 +25,7 @@ Find the least number for which the proportion of bouncy numbers is exactly 99%.
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler112()</code> should return 1587000.
|
||||
testString: 'assert.strictEqual(euler112(), 1587000, ''<code>euler112()</code> should return 1587000.'');'
|
||||
testString: 'assert.strictEqual(euler112(), 1587000, "<code>euler112()</code> should return 1587000.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -24,7 +24,7 @@ How many numbers below a googol (10100) are not bouncy?
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler113()</code> should return 51161058134250.
|
||||
testString: 'assert.strictEqual(euler113(), 51161058134250, ''<code>euler113()</code> should return 51161058134250.'');'
|
||||
testString: 'assert.strictEqual(euler113(), 51161058134250, "<code>euler113()</code> should return 51161058134250.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -123,7 +123,7 @@ NOTE: Although the example above does not lend itself to the possibility, in gen
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler114()</code> should return 16475640049.
|
||||
testString: 'assert.strictEqual(euler114(), 16475640049, ''<code>euler114()</code> should return 16475640049.'');'
|
||||
testString: 'assert.strictEqual(euler114(), 16475640049, "<code>euler114()</code> should return 16475640049.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -26,7 +26,7 @@ For m = 50, find the least value of n for which the fill-count function first ex
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler115()</code> should return 168.
|
||||
testString: 'assert.strictEqual(euler115(), 168, ''<code>euler115()</code> should return 168.'');'
|
||||
testString: 'assert.strictEqual(euler115(), 168, "<code>euler115()</code> should return 168.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -93,7 +93,7 @@ NOTE: This is related to Problem 117.
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler116()</code> should return 20492570929.
|
||||
testString: 'assert.strictEqual(euler116(), 20492570929, ''<code>euler116()</code> should return 20492570929.'');'
|
||||
testString: 'assert.strictEqual(euler116(), 20492570929, "<code>euler116()</code> should return 20492570929.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -101,7 +101,7 @@ NOTE: This is related to Problem 116.
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler117()</code> should return 100808458960497.
|
||||
testString: 'assert.strictEqual(euler117(), 100808458960497, ''<code>euler117()</code> should return 100808458960497.'');'
|
||||
testString: 'assert.strictEqual(euler117(), 100808458960497, "<code>euler117()</code> should return 100808458960497.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -21,7 +21,7 @@ How many distinct sets containing each of the digits one through nine exactly on
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler118()</code> should return 44680.
|
||||
testString: 'assert.strictEqual(euler118(), 44680, ''<code>euler118()</code> should return 44680.'');'
|
||||
testString: 'assert.strictEqual(euler118(), 44680, "<code>euler118()</code> should return 44680.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -23,7 +23,7 @@ Find a30.
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler119()</code> should return 248155780267521.
|
||||
testString: 'assert.strictEqual(euler119(), 248155780267521, ''<code>euler119()</code> should return 248155780267521.'');'
|
||||
testString: 'assert.strictEqual(euler119(), 248155780267521, "<code>euler119()</code> should return 248155780267521.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -31,15 +31,15 @@ What is the value of the first triangle number to have over <code>n</code> divis
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>divisibleTriangleNumber(5)</code> should return 28.
|
||||
testString: 'assert.strictEqual(divisibleTriangleNumber(5), 28, ''<code>divisibleTriangleNumber(5)</code> should return 28.'');'
|
||||
testString: 'assert.strictEqual(divisibleTriangleNumber(5), 28, "<code>divisibleTriangleNumber(5)</code> should return 28.");'
|
||||
- text: <code>divisibleTriangleNumber(23)</code> should return 630.
|
||||
testString: 'assert.strictEqual(divisibleTriangleNumber(23), 630, ''<code>divisibleTriangleNumber(23)</code> should return 630.'');'
|
||||
testString: 'assert.strictEqual(divisibleTriangleNumber(23), 630, "<code>divisibleTriangleNumber(23)</code> should return 630.");'
|
||||
- text: <code>divisibleTriangleNumber(167)</code> should return 1385280.
|
||||
testString: 'assert.strictEqual(divisibleTriangleNumber(167), 1385280, ''<code>divisibleTriangleNumber(167)</code> should return 1385280.'');'
|
||||
testString: 'assert.strictEqual(divisibleTriangleNumber(167), 1385280, "<code>divisibleTriangleNumber(167)</code> should return 1385280.");'
|
||||
- text: <code>divisibleTriangleNumber(374)</code> should return 17907120.
|
||||
testString: 'assert.strictEqual(divisibleTriangleNumber(374), 17907120, ''<code>divisibleTriangleNumber(374)</code> should return 17907120.'');'
|
||||
testString: 'assert.strictEqual(divisibleTriangleNumber(374), 17907120, "<code>divisibleTriangleNumber(374)</code> should return 17907120.");'
|
||||
- text: <code>divisibleTriangleNumber(500)</code> should return 76576500.
|
||||
testString: 'assert.strictEqual(divisibleTriangleNumber(500), 76576500, ''<code>divisibleTriangleNumber(500)</code> should return 76576500.'');'
|
||||
testString: 'assert.strictEqual(divisibleTriangleNumber(500), 76576500, "<code>divisibleTriangleNumber(500)</code> should return 76576500.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -22,7 +22,7 @@ For 3 ≤ a ≤ 1000, find ∑ rmax.
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler120()</code> should return 333082500.
|
||||
testString: 'assert.strictEqual(euler120(), 333082500, ''<code>euler120()</code> should return 333082500.'');'
|
||||
testString: 'assert.strictEqual(euler120(), 333082500, "<code>euler120()</code> should return 333082500.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -23,7 +23,7 @@ Find the maximum prize fund that should be allocated to a single game in which f
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler121()</code> should return 2269.
|
||||
testString: 'assert.strictEqual(euler121(), 2269, ''<code>euler121()</code> should return 2269.'');'
|
||||
testString: 'assert.strictEqual(euler121(), 2269, "<code>euler121()</code> should return 2269.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -27,7 +27,7 @@ For 1 ≤ k ≤ 200, find ∑ m(k).
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler122()</code> should return 1582.
|
||||
testString: 'assert.strictEqual(euler122(), 1582, ''<code>euler122()</code> should return 1582.'');'
|
||||
testString: 'assert.strictEqual(euler122(), 1582, "<code>euler122()</code> should return 1582.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -23,7 +23,7 @@ Find the least value of n for which the remainder first exceeds 1010.
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler123()</code> should return 21035.
|
||||
testString: 'assert.strictEqual(euler123(), 21035, ''<code>euler123()</code> should return 21035.'');'
|
||||
testString: 'assert.strictEqual(euler123(), 21035, "<code>euler123()</code> should return 21035.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -62,7 +62,7 @@ If rad(n) is sorted for 1 ≤ n ≤ 100000, find E(10000).
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler124()</code> should return 21417.
|
||||
testString: 'assert.strictEqual(euler124(), 21417, ''<code>euler124()</code> should return 21417.'');'
|
||||
testString: 'assert.strictEqual(euler124(), 21417, "<code>euler124()</code> should return 21417.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -22,7 +22,7 @@ Find the sum of all the numbers less than 108 that are both palindromic and can
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler125()</code> should return 2906969179.
|
||||
testString: 'assert.strictEqual(euler125(), 2906969179, ''<code>euler125()</code> should return 2906969179.'');'
|
||||
testString: 'assert.strictEqual(euler125(), 2906969179, "<code>euler125()</code> should return 2906969179.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -27,7 +27,7 @@ Find the least value of n for which C(n) = 1000.
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler126()</code> should return 18522.
|
||||
testString: 'assert.strictEqual(euler126(), 18522, ''<code>euler126()</code> should return 18522.'');'
|
||||
testString: 'assert.strictEqual(euler126(), 18522, "<code>euler126()</code> should return 18522.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -32,7 +32,7 @@ Find ∑c for c < 120000.
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler127()</code> should return 18407904.
|
||||
testString: 'assert.strictEqual(euler127(), 18407904, ''<code>euler127()</code> should return 18407904.'');'
|
||||
testString: 'assert.strictEqual(euler127(), 18407904, "<code>euler127()</code> should return 18407904.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -29,7 +29,7 @@ Find the 2000th tile in this sequence.
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler128()</code> should return 14516824220.
|
||||
testString: 'assert.strictEqual(euler128(), 14516824220, ''<code>euler128()</code> should return 14516824220.'');'
|
||||
testString: 'assert.strictEqual(euler128(), 14516824220, "<code>euler128()</code> should return 14516824220.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -23,7 +23,7 @@ Find the least value of n for which A(n) first exceeds one-million.
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler129()</code> should return 1000023.
|
||||
testString: 'assert.strictEqual(euler129(), 1000023, ''<code>euler129()</code> should return 1000023.'');'
|
||||
testString: 'assert.strictEqual(euler129(), 1000023, "<code>euler129()</code> should return 1000023.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -121,9 +121,9 @@ Work out the first ten digits of the sum of the following one-hundred 50-digit n
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>largeSum(testNums)</code> should return 8348422521.
|
||||
testString: 'assert.strictEqual(largeSum(testNums), 8348422521, ''<code>largeSum(testNums)</code> should return 8348422521.'');'
|
||||
testString: 'assert.strictEqual(largeSum(testNums), 8348422521, "<code>largeSum(testNums)</code> should return 8348422521.");'
|
||||
- text: <code>largeSum(fiftyDigitNums)</code> should return 5537376230.
|
||||
testString: 'assert.strictEqual(largeSum(fiftyDigitNums), 5537376230, ''<code>largeSum(fiftyDigitNums)</code> should return 5537376230.'');'
|
||||
testString: 'assert.strictEqual(largeSum(fiftyDigitNums), 5537376230, "<code>largeSum(fiftyDigitNums)</code> should return 5537376230.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -24,7 +24,7 @@ Find the sum of the first twenty-five composite values of n for whichGCD(n, 10)
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler130()</code> should return 149253.
|
||||
testString: 'assert.strictEqual(euler130(), 149253, ''<code>euler130()</code> should return 149253.'');'
|
||||
testString: 'assert.strictEqual(euler130(), 149253, "<code>euler130()</code> should return 149253.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -23,7 +23,7 @@ How many primes below one million have this remarkable property?
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler131()</code> should return 173.
|
||||
testString: 'assert.strictEqual(euler131(), 173, ''<code>euler131()</code> should return 173.'');'
|
||||
testString: 'assert.strictEqual(euler131(), 173, "<code>euler131()</code> should return 173.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -22,7 +22,7 @@ Find the sum of the first forty prime factors of R(109).
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler132()</code> should return 843296.
|
||||
testString: 'assert.strictEqual(euler132(), 843296, ''<code>euler132()</code> should return 843296.'');'
|
||||
testString: 'assert.strictEqual(euler132(), 843296, "<code>euler132()</code> should return 843296.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -23,7 +23,7 @@ Find the sum of all the primes below one-hundred thousand that will never be a f
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler133()</code> should return 453647705.
|
||||
testString: 'assert.strictEqual(euler133(), 453647705, ''<code>euler133()</code> should return 453647705.'');'
|
||||
testString: 'assert.strictEqual(euler133(), 453647705, "<code>euler133()</code> should return 453647705.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -22,7 +22,7 @@ Find ∑ S for every pair of consecutive primes with 5 ≤ p1 ≤ 1000000.
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler134()</code> should return 18613426663617120.
|
||||
testString: 'assert.strictEqual(euler134(), 18613426663617120, ''<code>euler134()</code> should return 18613426663617120.'');'
|
||||
testString: 'assert.strictEqual(euler134(), 18613426663617120, "<code>euler134()</code> should return 18613426663617120.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -23,7 +23,7 @@ How many values of n less than one million have exactly ten distinct solutions?
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler135()</code> should return 4989.
|
||||
testString: 'assert.strictEqual(euler135(), 4989, ''<code>euler135()</code> should return 4989.'');'
|
||||
testString: 'assert.strictEqual(euler135(), 4989, "<code>euler135()</code> should return 4989.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -23,7 +23,7 @@ How many values of n less than fifty million have exactly one solution?
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler136()</code> should return 2544559.
|
||||
testString: 'assert.strictEqual(euler136(), 2544559, ''<code>euler136()</code> should return 2544559.'');'
|
||||
testString: 'assert.strictEqual(euler136(), 2544559, "<code>euler136()</code> should return 2544559.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -41,7 +41,7 @@ Find the 15th golden nugget.
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler137()</code> should return 1120149658760.
|
||||
testString: 'assert.strictEqual(euler137(), 1120149658760, ''<code>euler137()</code> should return 1120149658760.'');'
|
||||
testString: 'assert.strictEqual(euler137(), 1120149658760, "<code>euler137()</code> should return 1120149658760.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -25,7 +25,7 @@ Find ∑ L for the twelve smallest isosceles triangles for which h = b ± 1 and
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler138()</code> should return 1118049290473932.
|
||||
testString: 'assert.strictEqual(euler138(), 1118049290473932, ''<code>euler138()</code> should return 1118049290473932.'');'
|
||||
testString: 'assert.strictEqual(euler138(), 1118049290473932, "<code>euler138()</code> should return 1118049290473932.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -25,7 +25,7 @@ Given that the perimeter of the right triangle is less than one-hundred million,
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler139()</code> should return 10057761.
|
||||
testString: 'assert.strictEqual(euler139(), 10057761, ''<code>euler139()</code> should return 10057761.'');'
|
||||
testString: 'assert.strictEqual(euler139(), 10057761, "<code>euler139()</code> should return 10057761.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -27,15 +27,15 @@ NOTE: Once the chain starts the terms are allowed to go above one million.
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>longestCollatzSequence(14)</code> should return 9.
|
||||
testString: 'assert.strictEqual(longestCollatzSequence(14), 9, ''<code>longestCollatzSequence(14)</code> should return 9.'');'
|
||||
testString: 'assert.strictEqual(longestCollatzSequence(14), 9, "<code>longestCollatzSequence(14)</code> should return 9.");'
|
||||
- text: <code>longestCollatzSequence(5847)</code> should return 3711.
|
||||
testString: 'assert.strictEqual(longestCollatzSequence(5847), 3711, ''<code>longestCollatzSequence(5847)</code> should return 3711.'');'
|
||||
testString: 'assert.strictEqual(longestCollatzSequence(5847), 3711, "<code>longestCollatzSequence(5847)</code> should return 3711.");'
|
||||
- text: <code>longestCollatzSequence(46500)</code> should return 35655.
|
||||
testString: 'assert.strictEqual(longestCollatzSequence(46500), 35655, ''<code>longestCollatzSequence(46500)</code> should return 35655.'');'
|
||||
testString: 'assert.strictEqual(longestCollatzSequence(46500), 35655, "<code>longestCollatzSequence(46500)</code> should return 35655.");'
|
||||
- text: <code>longestCollatzSequence(54512)</code> should return 52527.
|
||||
testString: 'assert.strictEqual(longestCollatzSequence(54512), 52527, ''<code>longestCollatzSequence(54512)</code> should return 52527.'');'
|
||||
testString: 'assert.strictEqual(longestCollatzSequence(54512), 52527, "<code>longestCollatzSequence(54512)</code> should return 52527.");'
|
||||
- text: <code>longestCollatzSequence(1000000)</code> should return 837799.
|
||||
testString: 'assert.strictEqual(longestCollatzSequence(1000000), 837799, ''<code>longestCollatzSequence(1000000)</code> should return 837799.'');'
|
||||
testString: 'assert.strictEqual(longestCollatzSequence(1000000), 837799, "<code>longestCollatzSequence(1000000)</code> should return 837799.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -32,7 +32,7 @@ Find the sum of the first thirty golden nuggets.
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler140()</code> should return 5673835352990.
|
||||
testString: 'assert.strictEqual(euler140(), 5673835352990, ''<code>euler140()</code> should return 5673835352990.'');'
|
||||
testString: 'assert.strictEqual(euler140(), 5673835352990, "<code>euler140()</code> should return 5673835352990.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -24,7 +24,7 @@ Find the sum of all progressive perfect squares below one trillion (1012).
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler141()</code> should return 878454337159.
|
||||
testString: 'assert.strictEqual(euler141(), 878454337159, ''<code>euler141()</code> should return 878454337159.'');'
|
||||
testString: 'assert.strictEqual(euler141(), 878454337159, "<code>euler141()</code> should return 878454337159.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -20,7 +20,7 @@ Find the smallest x + y + z with integers x > y > z > 0 such that x + y, x − y
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler142()</code> should return 1006193.
|
||||
testString: 'assert.strictEqual(euler142(), 1006193, ''<code>euler142()</code> should return 1006193.'');'
|
||||
testString: 'assert.strictEqual(euler142(), 1006193, "<code>euler142()</code> should return 1006193.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -25,7 +25,7 @@ Find the sum of all distinct values of p + q + r ≤ 120000 for Torricelli trian
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler143()</code> should return 30758397.
|
||||
testString: 'assert.strictEqual(euler143(), 30758397, ''<code>euler143()</code> should return 30758397.'');'
|
||||
testString: 'assert.strictEqual(euler143(), 30758397, "<code>euler143()</code> should return 30758397.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -29,7 +29,7 @@ How many times does the beam hit the internal surface of the white cell before e
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler144()</code> should return 354.
|
||||
testString: 'assert.strictEqual(euler144(), 354, ''<code>euler144()</code> should return 354.'');'
|
||||
testString: 'assert.strictEqual(euler144(), 354, "<code>euler144()</code> should return 354.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -24,7 +24,7 @@ How many reversible numbers are there below one-billion (109)?
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler145()</code> should return 608720.
|
||||
testString: 'assert.strictEqual(euler145(), 608720, ''<code>euler145()</code> should return 608720.'');'
|
||||
testString: 'assert.strictEqual(euler145(), 608720, "<code>euler145()</code> should return 608720.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -22,7 +22,7 @@ What is the sum of all such integers n below 150 million?
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler146()</code> should return 676333270.
|
||||
testString: 'assert.strictEqual(euler146(), 676333270, ''<code>euler146()</code> should return 676333270.'');'
|
||||
testString: 'assert.strictEqual(euler146(), 676333270, "<code>euler146()</code> should return 676333270.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -31,7 +31,7 @@ How many different rectangles could be situated within 47x43 and smaller grids?
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler147()</code> should return 846910284.
|
||||
testString: 'assert.strictEqual(euler147(), 846910284, ''<code>euler147()</code> should return 846910284.'');'
|
||||
testString: 'assert.strictEqual(euler147(), 846910284, "<code>euler147()</code> should return 846910284.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
id: 5900f4021000cf542c50ff14
|
||||
challengeType: 5
|
||||
title: 'Problem 148: Exploring Pascal''s triangle'
|
||||
title: 'Problem 148: Exploring Pascal"s triangle'
|
||||
---
|
||||
|
||||
## Description
|
||||
@ -93,7 +93,7 @@ Find the number of entries which are not divisible by 7 in the first one billion
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler148()</code> should return 2129970655314432.
|
||||
testString: 'assert.strictEqual(euler148(), 2129970655314432, ''<code>euler148()</code> should return 2129970655314432.'');'
|
||||
testString: 'assert.strictEqual(euler148(), 2129970655314432, "<code>euler148()</code> should return 2129970655314432.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -36,7 +36,7 @@ Finally, find the greatest sum of (any number of) adjacent entries in any direct
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler149()</code> should return 52852124.
|
||||
testString: 'assert.strictEqual(euler149(), 52852124, ''<code>euler149()</code> should return 52852124.'');'
|
||||
testString: 'assert.strictEqual(euler149(), 52852124, "<code>euler149()</code> should return 52852124.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -24,11 +24,11 @@ How many such routes are there through a given <code>gridSize</code>?
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>latticePaths(4)</code> should return 70.
|
||||
testString: 'assert.strictEqual(latticePaths(4), 70, ''<code>latticePaths(4)</code> should return 70.'');'
|
||||
testString: 'assert.strictEqual(latticePaths(4), 70, "<code>latticePaths(4)</code> should return 70.");'
|
||||
- text: <code>latticePaths(9)</code> should return 48620.
|
||||
testString: 'assert.strictEqual(latticePaths(9), 48620, ''<code>latticePaths(9)</code> should return 48620.'');'
|
||||
testString: 'assert.strictEqual(latticePaths(9), 48620, "<code>latticePaths(9)</code> should return 48620.");'
|
||||
- text: <code>latticePaths(20)</code> should return 137846528820.
|
||||
testString: 'assert.strictEqual(latticePaths(20), 137846528820, ''<code>latticePaths(20)</code> should return 137846528820.'');'
|
||||
testString: 'assert.strictEqual(latticePaths(20), 137846528820, "<code>latticePaths(20)</code> should return 137846528820.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -22,7 +22,7 @@ Our triangular array is then formed using the pseudo-random numbers thus:
|
||||
|
||||
s1
|
||||
s2 s3
|
||||
s4 s5 s6
|
||||
s4 s5 s6
|
||||
|
||||
s7 s8 s9 s10
|
||||
...
|
||||
@ -45,7 +45,7 @@ Find the smallest possible sub-triangle sum.
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler150()</code> should return -271248680.
|
||||
testString: 'assert.strictEqual(euler150(), -271248680, ''<code>euler150()</code> should return -271248680.'');'
|
||||
testString: 'assert.strictEqual(euler150(), -271248680, "<code>euler150()</code> should return -271248680.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -27,7 +27,7 @@ Give your answer rounded to six decimal places using the format x.xxxxxx .
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler151()</code> should return 0.464399.
|
||||
testString: 'assert.strictEqual(euler151(), 0.464399, ''<code>euler151()</code> should return 0.464399.'');'
|
||||
testString: 'assert.strictEqual(euler151(), 0.464399, "<code>euler151()</code> should return 0.464399.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -24,7 +24,7 @@ How many ways are there to write the number 1/2 as a sum of inverse squares usin
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler152()</code> should return 301.
|
||||
testString: 'assert.strictEqual(euler152(), 301, ''<code>euler152()</code> should return 301.'');'
|
||||
testString: 'assert.strictEqual(euler152(), 301, "<code>euler152()</code> should return 301.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -28,7 +28,7 @@ If for example we divide 5 by 1+2i we can simplify in the following manner:
|
||||
|
||||
Multiply numerator and denominator by the complex conjugate of 1+2i: 1−2i.
|
||||
|
||||
The result is
|
||||
The result is
|
||||
.
|
||||
|
||||
So 1+2i is a divisor of 5.
|
||||
@ -64,7 +64,7 @@ What is ∑ s(n) for 1 ≤ n ≤ 108?
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler153()</code> should return 17971254122360636.
|
||||
testString: 'assert.strictEqual(euler153(), 17971254122360636, ''<code>euler153()</code> should return 17971254122360636.'');'
|
||||
testString: 'assert.strictEqual(euler153(), 17971254122360636, "<code>euler153()</code> should return 17971254122360636.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
id: 5900f4071000cf542c50ff19
|
||||
challengeType: 5
|
||||
title: 'Problem 154: Exploring Pascal''s pyramid'
|
||||
title: 'Problem 154: Exploring Pascal"s pyramid'
|
||||
---
|
||||
|
||||
## Description
|
||||
@ -11,7 +11,7 @@ A triangular pyramid is constructed using spherical balls so that each ball rest
|
||||
Then, we calculate the number of paths leading from the apex to each position:
|
||||
A path starts at the apex and progresses downwards to any of the three spheres directly below the current position.
|
||||
Consequently, the number of paths to reach a certain position is the sum of the numbers immediately above it (depending on the position, there are up to three numbers above it).
|
||||
The result is Pascal's pyramid and the numbers at each level n are the coefficients of the trinomial expansion
|
||||
The result is Pascal's pyramid and the numbers at each level n are the coefficients of the trinomial expansion
|
||||
(x + y + z)n.
|
||||
How many coefficients in the expansion of (x + y + z)200000 are multiples of 1012?
|
||||
</section>
|
||||
@ -27,7 +27,7 @@ How many coefficients in the expansion of (x + y + z)200000 are multiples of 101
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler154()</code> should return 479742450.
|
||||
testString: 'assert.strictEqual(euler154(), 479742450, ''<code>euler154()</code> should return 479742450.'');'
|
||||
testString: 'assert.strictEqual(euler154(), 479742450, "<code>euler154()</code> should return 479742450.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -9,7 +9,7 @@ title: 'Problem 155: Counting Capacitor Circuits'
|
||||
An electric circuit uses exclusively identical capacitors of the same value C.
|
||||
|
||||
The capacitors can be connected in series or in parallel to form sub-units, which can then be connected in series or in parallel with other capacitors or other sub-units to form larger sub-units, and so on up to a final circuit.
|
||||
Using this simple procedure and up to n identical capacitors, we can make circuits having a range of different total capacitances. For example, using up to n=3 capacitors of 60 F each, we can obtain the following 7 distinct total capacitance values:
|
||||
Using this simple procedure and up to n identical capacitors, we can make circuits having a range of different total capacitances. For example, using up to n=3 capacitors of 60 F each, we can obtain the following 7 distinct total capacitance values:
|
||||
|
||||
If we denote by D(n) the number of distinct total capacitance values we can obtain when using up to n equal-valued capacitors and the simple procedure described above, we have: D(1)=1, D(2)=3, D(3)=7 ...
|
||||
Find D(18).
|
||||
@ -29,7 +29,7 @@ whereas when connecting them in series, the overall capacitance is given by:
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler155()</code> should return 3857447.
|
||||
testString: 'assert.strictEqual(euler155(), 3857447, ''<code>euler155()</code> should return 3857447.'');'
|
||||
testString: 'assert.strictEqual(euler155(), 3857447, "<code>euler155()</code> should return 3857447.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -52,7 +52,7 @@ Note: if, for some n, f(n,d)=n
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler156()</code> should return 21295121502550.
|
||||
testString: 'assert.strictEqual(euler156(), 21295121502550, ''<code>euler156()</code> should return 21295121502550.'');'
|
||||
testString: 'assert.strictEqual(euler156(), 21295121502550, "<code>euler156()</code> should return 21295121502550.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -42,7 +42,7 @@ How many solutions has this equation for 1 ≤ n ≤ 9?
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler157()</code> should return 53490.
|
||||
testString: 'assert.strictEqual(euler157(), 53490, ''<code>euler157()</code> should return 53490.'');'
|
||||
testString: 'assert.strictEqual(euler157(), 53490, "<code>euler157()</code> should return 53490.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -8,11 +8,11 @@ title: 'Problem 158: Exploring strings for which only one character comes lexico
|
||||
<section id='description'>
|
||||
Taking three different letters from the 26 letters of the alphabet, character strings of length three can be formed.
|
||||
Examples are 'abc', 'hat' and 'zyx'.
|
||||
When we study these three examples we see that for 'abc' two characters come lexicographically after its neighbour to the left.
|
||||
When we study these three examples we see that for 'abc' two characters come lexicographically after its neighbour to the left.
|
||||
For 'hat' there is exactly one character that comes lexicographically after its neighbour to the left. For 'zyx' there are zero characters that come lexicographically after its neighbour to the left.
|
||||
In all there are 10400 strings of length 3 for which exactly one character comes lexicographically after its neighbour to the left.
|
||||
We now consider strings of n ≤ 26 different characters from the alphabet.
|
||||
For every n, p(n) is the number of strings of length n for which exactly one character comes lexicographically after its neighbour to the left.
|
||||
We now consider strings of n ≤ 26 different characters from the alphabet.
|
||||
For every n, p(n) is the number of strings of length n for which exactly one character comes lexicographically after its neighbour to the left.
|
||||
What is the maximum value of p(n)?
|
||||
</section>
|
||||
|
||||
@ -27,7 +27,7 @@ What is the maximum value of p(n)?
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler158()</code> should return 409511334375.
|
||||
testString: 'assert.strictEqual(euler158(), 409511334375, ''<code>euler158()</code> should return 409511334375.'');'
|
||||
testString: 'assert.strictEqual(euler158(), 409511334375, "<code>euler158()</code> should return 409511334375.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -6,7 +6,7 @@ title: 'Problem 159: Digital root sums of factorisations'
|
||||
|
||||
## Description
|
||||
<section id='description'>
|
||||
A composite number can be factored many different ways.
|
||||
A composite number can be factored many different ways.
|
||||
For instance, not including multiplication by one, 24 can be factored in 7 distinct ways:
|
||||
|
||||
24 = 2x2x2x3
|
||||
@ -17,8 +17,8 @@ For instance, not including multiplication by one, 24 can be factored in 7 disti
|
||||
24 = 2x12
|
||||
24 = 24
|
||||
|
||||
Recall that the digital root of a number, in base 10, is found by adding together the digits of that number,
|
||||
and repeating that process until a number is arrived at that is less than 10.
|
||||
Recall that the digital root of a number, in base 10, is found by adding together the digits of that number,
|
||||
and repeating that process until a number is arrived at that is less than 10.
|
||||
Thus the digital root of 467 is 8.
|
||||
We shall call a Digital Root Sum (DRS) the sum of the digital roots of the individual factors of our number.
|
||||
The chart below demonstrates all of the DRS values for 24.
|
||||
@ -45,7 +45,7 @@ Find ∑mdrs(n) for 1 < n < 1,000,000.
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler159()</code> should return 14489159.
|
||||
testString: 'assert.strictEqual(euler159(), 14489159, ''<code>euler159()</code> should return 14489159.'');'
|
||||
testString: 'assert.strictEqual(euler159(), 14489159, "<code>euler159()</code> should return 14489159.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -21,11 +21,11 @@ What is the sum of the digits of the number 2<sup><code>exponent</code></sup>?
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>powerDigitSum(15)</code> should return 26.
|
||||
testString: 'assert.strictEqual(powerDigitSum(15), 26, ''<code>powerDigitSum(15)</code> should return 26.'');'
|
||||
testString: 'assert.strictEqual(powerDigitSum(15), 26, "<code>powerDigitSum(15)</code> should return 26.");'
|
||||
- text: <code>powerDigitSum(128)</code> should return 166.
|
||||
testString: 'assert.strictEqual(powerDigitSum(128), 166, ''<code>powerDigitSum(128)</code> should return 166.'');'
|
||||
testString: 'assert.strictEqual(powerDigitSum(128), 166, "<code>powerDigitSum(128)</code> should return 166.");'
|
||||
- text: <code>powerDigitSum(1000)</code> should return 1366.
|
||||
testString: 'assert.strictEqual(powerDigitSum(1000), 1366, ''<code>powerDigitSum(1000)</code> should return 1366.'');'
|
||||
testString: 'assert.strictEqual(powerDigitSum(1000), 1366, "<code>powerDigitSum(1000)</code> should return 1366.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -25,7 +25,7 @@ Find f(1,000,000,000,000)
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler160()</code> should return 16576.
|
||||
testString: 'assert.strictEqual(euler160(), 16576, ''<code>euler160()</code> should return 16576.'');'
|
||||
testString: 'assert.strictEqual(euler160(), 16576, "<code>euler160()</code> should return 16576.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -34,7 +34,7 @@ In how many ways can a 9 by 12 grid be tiled in this way by triominoes?
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler161()</code> should return 20574308184277972.
|
||||
testString: 'assert.strictEqual(euler161(), 20574308184277972, ''<code>euler161()</code> should return 20574308184277972.'');'
|
||||
testString: 'assert.strictEqual(euler161(), 20574308184277972, "<code>euler161()</code> should return 20574308184277972.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -27,7 +27,7 @@ Give your answer as a hexadecimal number.
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler162()</code> should return 3D58725572C62302.
|
||||
testString: 'assert.strictEqual(euler162(), 3D58725572C62302, ''<code>euler162()</code> should return 3D58725572C62302.'');'
|
||||
testString: 'assert.strictEqual(euler162(), 3D58725572C62302, "<code>euler162()</code> should return 3D58725572C62302.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -27,7 +27,7 @@ Find T(36).
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler163()</code> should return 343047.
|
||||
testString: 'assert.strictEqual(euler163(), 343047, ''<code>euler163()</code> should return 343047.'');'
|
||||
testString: 'assert.strictEqual(euler163(), 343047, "<code>euler163()</code> should return 343047.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -20,7 +20,7 @@ How many 20 digit numbers n (without any leading zero) exist such that no three
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler164()</code> should return 378158756814587.
|
||||
testString: 'assert.strictEqual(euler164(), 378158756814587, ''<code>euler164()</code> should return 378158756814587.'');'
|
||||
testString: 'assert.strictEqual(euler164(), 378158756814587, "<code>euler164()</code> should return 378158756814587.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -6,7 +6,7 @@ title: 'Problem 165: Intersections'
|
||||
|
||||
## Description
|
||||
<section id='description'>
|
||||
A segment is uniquely defined by its two endpoints. By considering two line segments in plane geometry there are three possibilities:
|
||||
A segment is uniquely defined by its two endpoints. By considering two line segments in plane geometry there are three possibilities:
|
||||
the segments have zero points, one point, or infinitely many points in common.
|
||||
Moreover when two segments have exactly one point in common it might be the case that that common point is an endpoint of either one of the segments or of both. If a common point of two segments is not an endpoint of either of the segments it is an interior point of both segments.
|
||||
We will call a common point T of two segments L1 and L2 a true intersection point of L1 and L2 if T is the only common point of L1 and L2 and T is an interior point of both segments.
|
||||
@ -37,7 +37,7 @@ How many distinct true intersection points are found among the 5000 line segment
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler165()</code> should return 2868868.
|
||||
testString: 'assert.strictEqual(euler165(), 2868868, ''<code>euler165()</code> should return 2868868.'');'
|
||||
testString: 'assert.strictEqual(euler165(), 2868868, "<code>euler165()</code> should return 2868868.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -32,7 +32,7 @@ In how many ways can you fill a 4x4 grid with the digits d, 0 ≤ d ≤ 9 so tha
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler166()</code> should return 7130034.
|
||||
testString: 'assert.strictEqual(euler166(), 7130034, ''<code>euler166()</code> should return 7130034.'');'
|
||||
testString: 'assert.strictEqual(euler166(), 7130034, "<code>euler166()</code> should return 7130034.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -25,7 +25,7 @@ Find ∑U(2,2n+1)k for 2 ≤ n ≤10, where k = 1011.
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler167()</code> should return 3916160068885.
|
||||
testString: 'assert.strictEqual(euler167(), 3916160068885, ''<code>euler167()</code> should return 3916160068885.'');'
|
||||
testString: 'assert.strictEqual(euler167(), 3916160068885, "<code>euler167()</code> should return 3916160068885.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -23,7 +23,7 @@ Find the last 5 digits of the sum of all integers n, 10 < n < 10100, that have t
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler168()</code> should return 59206.
|
||||
testString: 'assert.strictEqual(euler168(), 59206, ''<code>euler168()</code> should return 59206.'');'
|
||||
testString: 'assert.strictEqual(euler168(), 59206, "<code>euler168()</code> should return 59206.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -26,7 +26,7 @@ What is f(1025)?
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler169()</code> should return 178653872807.
|
||||
testString: 'assert.strictEqual(euler169(), 178653872807, ''<code>euler169()</code> should return 178653872807.'');'
|
||||
testString: 'assert.strictEqual(euler169(), 178653872807, "<code>euler169()</code> should return 178653872807.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -7,7 +7,7 @@ title: 'Problem 17: Number letter counts'
|
||||
## Description
|
||||
<section id='description'>
|
||||
If the numbers 1 to 5 are written out in words: one, two, three, four, five, then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total.
|
||||
If all the numbers from 1 to given <code>limit</code> inclusive were written out in words, how many letters would be used?
|
||||
If all the numbers from 1 to given <code>limit</code> inclusive were written out in words, how many letters would be used?
|
||||
<b>NOTE:</b> Do not count spaces or hyphens. For example, 342 (three hundred and forty-two) contains 23 letters and 115 (one hundred and fifteen) contains 20 letters. The use of "and" when writing out numbers is in compliance with British usage.
|
||||
</section>
|
||||
|
||||
@ -22,11 +22,11 @@ If all the numbers from 1 to given <code>limit</code> inclusive were written out
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>numberLetterCounts(5)</code> should return 19.
|
||||
testString: 'assert.strictEqual(numberLetterCounts(5), 19, ''<code>numberLetterCounts(5)</code> should return 19.'');'
|
||||
testString: 'assert.strictEqual(numberLetterCounts(5), 19, "<code>numberLetterCounts(5)</code> should return 19.");'
|
||||
- text: <code>numberLetterCounts(150)</code> should return 1903.
|
||||
testString: 'assert.strictEqual(numberLetterCounts(150), 1903, ''<code>numberLetterCounts(150)</code> should return 1903.'');'
|
||||
testString: 'assert.strictEqual(numberLetterCounts(150), 1903, "<code>numberLetterCounts(150)</code> should return 1903.");'
|
||||
- text: <code>numberLetterCounts(1000)</code> should return 21124.
|
||||
testString: 'assert.strictEqual(numberLetterCounts(1000), 21124, ''<code>numberLetterCounts(1000)</code> should return 21124.'');'
|
||||
testString: 'assert.strictEqual(numberLetterCounts(1000), 21124, "<code>numberLetterCounts(1000)</code> should return 21124.");'
|
||||
|
||||
```
|
||||
|
||||
@ -59,7 +59,7 @@ numberLetterCounts(5);
|
||||
```js
|
||||
function numberLetterCounts(limit) {
|
||||
const dictionary = {
|
||||
0: '',
|
||||
0: ",
|
||||
1: 'one',
|
||||
2: 'two',
|
||||
3: 'three',
|
||||
@ -90,7 +90,7 @@ function numberLetterCounts(limit) {
|
||||
1000: 'onethousand'
|
||||
};
|
||||
|
||||
let numString = '';
|
||||
let numString = ";
|
||||
|
||||
function convertToString(num) {
|
||||
// check dictionary for number
|
||||
@ -101,7 +101,7 @@ function numberLetterCounts(limit) {
|
||||
const tens = Math.floor((num / 10) % 10) * 10;
|
||||
const remainder = num % 10;
|
||||
|
||||
let tempStr = '';
|
||||
let tempStr = ";
|
||||
|
||||
if (hundreds === 0) {
|
||||
tempStr += dictionary[tens] + dictionary[remainder];
|
||||
|
@ -29,7 +29,7 @@ What is the largest 0 to 9 pandigital 10-digit concatenated product of an intege
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler170()</code> should return 9857164023.
|
||||
testString: 'assert.strictEqual(euler170(), 9857164023, ''<code>euler170()</code> should return 9857164023.'');'
|
||||
testString: 'assert.strictEqual(euler170(), 9857164023, "<code>euler170()</code> should return 9857164023.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -24,7 +24,7 @@ Find the last nine digits of the sum of all n, 0 < n < 1020, such that f(n) is a
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler171()</code> should return 142989277.
|
||||
testString: 'assert.strictEqual(euler171(), 142989277, ''<code>euler171()</code> should return 142989277.'');'
|
||||
testString: 'assert.strictEqual(euler171(), 142989277, "<code>euler171()</code> should return 142989277.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -20,7 +20,7 @@ How many 18-digit numbers n (without leading zeros) are there such that no digit
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler172()</code> should return 227485267000992000.
|
||||
testString: 'assert.strictEqual(euler172(), 227485267000992000, ''<code>euler172()</code> should return 227485267000992000.'');'
|
||||
testString: 'assert.strictEqual(euler172(), 227485267000992000, "<code>euler172()</code> should return 227485267000992000.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -24,7 +24,7 @@ Using up to one million tiles how many different square laminae can be formed?
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler173()</code> should return 1572729.
|
||||
testString: 'assert.strictEqual(euler173(), 1572729, ''<code>euler173()</code> should return 1572729.'');'
|
||||
testString: 'assert.strictEqual(euler173(), 1572729, "<code>euler173()</code> should return 1572729.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -26,7 +26,7 @@ What is ∑ N(n) for 1 ≤ n ≤ 10?
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler174()</code> should return 209566.
|
||||
testString: 'assert.strictEqual(euler174(), 209566, ''<code>euler174()</code> should return 209566.'');'
|
||||
testString: 'assert.strictEqual(euler174(), 209566, "<code>euler174()</code> should return 209566.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -6,7 +6,7 @@ title: 'Problem 175: Fractions involving the number of different ways a number c
|
||||
|
||||
## Description
|
||||
<section id='description'>
|
||||
Define f(0)=1 and f(n) to be the number of ways to write n as a sum of powers of 2 where no power occurs more than twice.
|
||||
Define f(0)=1 and f(n) to be the number of ways to write n as a sum of powers of 2 where no power occurs more than twice.
|
||||
|
||||
For example, f(10)=5 since there are five different ways to express 10:10 = 8+2 = 8+1+1 = 4+4+2 = 4+2+2+1+1 = 4+4+1+1
|
||||
|
||||
@ -29,7 +29,7 @@ Give your answer as comma separated integers, without any whitespaces.
|
||||
```yml
|
||||
tests:
|
||||
- text: '<code>euler175()</code> should return 1, 13717420, 8.'
|
||||
testString: 'assert.strictEqual(euler175(), 1, 13717420, 8, ''<code>euler175()</code> should return 1, 13717420, 8.'');'
|
||||
testString: 'assert.strictEqual(euler175(), 1, 13717420, 8, "<code>euler175()</code> should return 1, 13717420, 8.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -21,7 +21,7 @@ Find the smallest integer that can be the length of a cathetus of exactly 47547
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler176()</code> should return 96818198400000.
|
||||
testString: 'assert.strictEqual(euler176(), 96818198400000, ''<code>euler176()</code> should return 96818198400000.'');'
|
||||
testString: 'assert.strictEqual(euler176(), 96818198400000, "<code>euler176()</code> should return 96818198400000.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -25,7 +25,7 @@ Note: In your calculations you may assume that a calculated angle is integral if
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler177()</code> should return 129325.
|
||||
testString: 'assert.strictEqual(euler177(), 129325, ''<code>euler177()</code> should return 129325.'');'
|
||||
testString: 'assert.strictEqual(euler177(), 129325, "<code>euler177()</code> should return 129325.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -6,7 +6,7 @@ title: 'Problem 178: Step Numbers'
|
||||
|
||||
## Description
|
||||
<section id='description'>
|
||||
Consider the number 45656.
|
||||
Consider the number 45656.
|
||||
It can be seen that each pair of consecutive digits of 45656 has a difference of one.
|
||||
A number for which every pair of consecutive digits has a difference of one is called a step number.
|
||||
A pandigital number contains every decimal digit from 0 to 9 at least once.
|
||||
@ -25,7 +25,7 @@ How many pandigital step numbers less than 1040 are there?
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler178()</code> should return 126461847755.
|
||||
testString: 'assert.strictEqual(euler178(), 126461847755, ''<code>euler178()</code> should return 126461847755.'');'
|
||||
testString: 'assert.strictEqual(euler178(), 126461847755, "<code>euler178()</code> should return 126461847755.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -20,7 +20,7 @@ Find the number of integers 1 < n < 107, for which n and n + 1 have the same num
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler179()</code> should return 986262.
|
||||
testString: 'assert.strictEqual(euler179(), 986262, ''<code>euler179()</code> should return 986262.'');'
|
||||
testString: 'assert.strictEqual(euler179(), 986262, "<code>euler179()</code> should return 986262.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -25,9 +25,9 @@ Find the maximum total from top to bottom of the triangle below:
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>maximumPathSumI(testTriangle)</code> should return 23.
|
||||
testString: 'assert.strictEqual(maximumPathSumI(testTriangle), 23, ''<code>maximumPathSumI(testTriangle)</code> should return 23.'');'
|
||||
testString: 'assert.strictEqual(maximumPathSumI(testTriangle), 23, "<code>maximumPathSumI(testTriangle)</code> should return 23.");'
|
||||
- text: <code>maximumPathSumI(numTriangle)</code> should return 1074.
|
||||
testString: 'assert.strictEqual(maximumPathSumI(numTriangle), 1074, ''<code>maximumPathSumI(numTriangle)</code> should return 1074.'');'
|
||||
testString: 'assert.strictEqual(maximumPathSumI(numTriangle), 1074, "<code>maximumPathSumI(numTriangle)</code> should return 1074.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -28,7 +28,7 @@ Find u + v.
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler180()</code> should return 285196020571078980.
|
||||
testString: 'assert.strictEqual(euler180(), 285196020571078980, ''<code>euler180()</code> should return 285196020571078980.'');'
|
||||
testString: 'assert.strictEqual(euler180(), 285196020571078980, "<code>euler180()</code> should return 285196020571078980.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -23,7 +23,7 @@ In how many ways can sixty black objects B and forty white objects W be thus gr
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler181()</code> should return 83735848679360670.
|
||||
testString: 'assert.strictEqual(euler181(), 83735848679360670, ''<code>euler181()</code> should return 83735848679360670.'');'
|
||||
testString: 'assert.strictEqual(euler181(), 83735848679360670, "<code>euler181()</code> should return 83735848679360670.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -34,7 +34,7 @@ Find the sum of all values of e, 1<e<φ(1009,3643) and gcd(e,φ)=1, so that the
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler182()</code> should return 399788195976.
|
||||
testString: 'assert.strictEqual(euler182(), 399788195976, ''<code>euler182()</code> should return 399788195976.'');'
|
||||
testString: 'assert.strictEqual(euler182(), 399788195976, "<code>euler182()</code> should return 399788195976.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -35,7 +35,7 @@ Find ΣD(N) for 5 ≤ N ≤ 10000.
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler183()</code> should return 48861552.
|
||||
testString: 'assert.strictEqual(euler183(), 48861552, ''<code>euler183()</code> should return 48861552.'');'
|
||||
testString: 'assert.strictEqual(euler183(), 48861552, "<code>euler183()</code> should return 48861552.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -26,7 +26,7 @@ How many triangles are there containing the origin in the interior and having al
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler184()</code> should return 1725323624056.
|
||||
testString: 'assert.strictEqual(euler184(), 1725323624056, ''<code>euler184()</code> should return 1725323624056.'');'
|
||||
testString: 'assert.strictEqual(euler184(), 1725323624056, "<code>euler184()</code> should return 1725323624056.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -57,7 +57,7 @@ Find the unique 16-digit secret sequence.
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler185()</code> should return 4640261571849533.
|
||||
testString: 'assert.strictEqual(euler185(), 4640261571849533, ''<code>euler185()</code> should return 4640261571849533.'');'
|
||||
testString: 'assert.strictEqual(euler185(), 4640261571849533, "<code>euler185()</code> should return 4640261571849533.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -32,7 +32,7 @@ The Prime Minister's phone number is 524287. After how many successful calls, no
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler186()</code> should return 2325629.
|
||||
testString: 'assert.strictEqual(euler186(), 2325629, ''<code>euler186()</code> should return 2325629.'');'
|
||||
testString: 'assert.strictEqual(euler186(), 2325629, "<code>euler186()</code> should return 2325629.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -25,7 +25,7 @@ How many composite integers, n < 108, have precisely two, not necessarily distin
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler187()</code> should return 17427258.
|
||||
testString: 'assert.strictEqual(euler187(), 17427258, ''<code>euler187()</code> should return 17427258.'');'
|
||||
testString: 'assert.strictEqual(euler187(), 17427258, "<code>euler187()</code> should return 17427258.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -25,7 +25,7 @@ Find the last 8 digits of 1777↑↑1855.
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler188()</code> should return 95962097.
|
||||
testString: 'assert.strictEqual(euler188(), 95962097, ''<code>euler188()</code> should return 95962097.'');'
|
||||
testString: 'assert.strictEqual(euler188(), 95962097, "<code>euler188()</code> should return 95962097.");'
|
||||
|
||||
```
|
||||
|
||||
|
@ -11,7 +11,7 @@ Consider the following configuration of 64 triangles:
|
||||
|
||||
|
||||
We wish to colour the interior of each triangle with one of three colours: red, green or blue, so that no two neighbouring triangles have the same colour. Such a colouring shall be called valid. Here, two triangles are said to be neighbouring if they share an edge.
|
||||
Note: if they only share a vertex, then they are not neighbours.
|
||||
Note: if they only share a vertex, then they are not neighbours.
|
||||
|
||||
For example, here is a valid colouring of the above grid:
|
||||
|
||||
@ -32,7 +32,7 @@ How many distinct valid colourings are there for the above configuration?
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler189()</code> should return 10834893628237824.
|
||||
testString: 'assert.strictEqual(euler189(), 10834893628237824, ''<code>euler189()</code> should return 10834893628237824.'');'
|
||||
testString: 'assert.strictEqual(euler189(), 10834893628237824, "<code>euler189()</code> should return 10834893628237824.");'
|
||||
|
||||
```
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user