Valeriy 79d9012432 fix(curriculum): quotes in tests (#18828)
* fix(curriculum): tests quotes

* fix(curriculum): fill seed-teardown

* fix(curriculum): fix tests and remove unneeded seed-teardown
2018-10-20 23:32:47 +05:30

1.1 KiB

id, challengeType, title
id challengeType title
5900f3e41000cf542c50fef6 5 Problem 119: Digit power sum

Description

The number 512 is interesting because it is equal to the sum of its digits raised to some power: 5 + 1 + 2 = 8, and 83 = 512. Another example of a number with this property is 614656 = 284. We shall define an to be the nth term of this sequence and insist that a number must contain at least two digits to have a sum. You are given that a2 = 512 and a10 = 614656. Find a30.

Instructions

Tests

tests:
  - text: <code>euler119()</code> should return 248155780267521.
    testString: assert.strictEqual(euler119(), 248155780267521, '<code>euler119()</code> should return 248155780267521.');

Challenge Seed

function euler119() {
  // Good luck!
  return true;
}

euler119();

Solution

// solution required