2018-09-30 22:01:58 +00:00
---
id: 5900f3e41000cf542c50fef6
title: 'Problem 119: Digit power sum'
2020-11-27 18:02:05 +00:00
challengeType: 5
2019-08-05 16:17:33 +00:00
forumTopicId: 301745
2021-01-13 02:31:00 +00:00
dashedName: problem-119-digit-power-sum
2018-09-30 22:01:58 +00:00
---
2020-11-27 18:02:05 +00:00
# --description--
2021-06-30 12:25:46 +00:00
The number 512 is interesting because it is equal to the sum of its digits raised to some power: $5 + 1 + 2 = 8$, and $8^3 = 512$. Another example of a number with this property is $614656 = 28^4$.
2020-11-27 18:02:05 +00:00
2021-06-30 12:25:46 +00:00
We shall define an to be the $n-th$ term of this sequence and insist that a number must contain at least two digits to have a sum.
2018-09-30 22:01:58 +00:00
2021-06-30 12:25:46 +00:00
You are given that $a_2 = 512$ and $a_{10} = 614656$.
2018-09-30 22:01:58 +00:00
2021-06-30 12:25:46 +00:00
Find $a_{30}$.
2018-09-30 22:01:58 +00:00
2020-11-27 18:02:05 +00:00
# --hints--
2018-09-30 22:01:58 +00:00
2021-06-30 12:25:46 +00:00
`digitPowerSum()` should return `248155780267521` .
2018-09-30 22:01:58 +00:00
2020-11-27 18:02:05 +00:00
```js
2021-06-30 12:25:46 +00:00
assert.strictEqual(digitPowerSum(), 248155780267521);
2018-09-30 22:01:58 +00:00
```
2020-11-27 18:02:05 +00:00
# --seed--
2018-09-30 22:01:58 +00:00
2020-11-27 18:02:05 +00:00
## --seed-contents--
2018-09-30 22:01:58 +00:00
```js
2021-06-30 12:25:46 +00:00
function digitPowerSum() {
2020-09-15 16:57:40 +00:00
2018-09-30 22:01:58 +00:00
return true;
}
2021-06-30 12:25:46 +00:00
digitPowerSum();
2018-09-30 22:01:58 +00:00
```
2020-11-27 18:02:05 +00:00
# --solutions--
2018-09-30 22:01:58 +00:00
```js
// solution required
```