45 lines
1.1 KiB
Markdown
45 lines
1.1 KiB
Markdown
---
|
||
id: 5900f3d51000cf542c50fee6
|
||
title: 'Problem 104: Pandigital Fibonacci ends'
|
||
challengeType: 5
|
||
forumTopicId: 301728
|
||
dashedName: problem-104-pandigital-fibonacci-ends
|
||
---
|
||
|
||
# --description--
|
||
|
||
The Fibonacci sequence is defined by the recurrence relation:
|
||
|
||
$F_n = F_{n − 1} + F_{n − 2}$, where $F_1 = 1$ and $F_2 = 1$
|
||
|
||
It turns out that $F_{541}$, which contains 113 digits, is the first Fibonacci number for which the last nine digits are 1 - 9 pandigital (contain all the digits 1 to 9, but not necessarily in order). And $F_{2749}$, which contains 575 digits, is the first Fibonacci number for which the first nine digits are 1 - 9 pandigital.
|
||
|
||
Given that $F_k$ is the first Fibonacci number for which the first nine digits AND the last nine digits are 1 - 9 pandigital, find `k`.
|
||
|
||
# --hints--
|
||
|
||
`pandigitalFibonacciEnds()` should return `329468`.
|
||
|
||
```js
|
||
assert.strictEqual(pandigitalFibonacciEnds(), 329468);
|
||
```
|
||
|
||
# --seed--
|
||
|
||
## --seed-contents--
|
||
|
||
```js
|
||
function pandigitalFibonacciEnds() {
|
||
|
||
return true;
|
||
}
|
||
|
||
pandigitalFibonacciEnds();
|
||
```
|
||
|
||
# --solutions--
|
||
|
||
```js
|
||
// solution required
|
||
```
|