← Complete problem index

PROJECT EULER · #1006

Fibonacci Subwords

Statement only · UnsolvedOriginal problem ↗

Starting with two strings S0=0 and S1=01, we define Sn as the concatenation Sn1Sn2 for n2.
For example, S2=010, S3=01001 and S4=01001010.
A string is called a Fibonacci subword if it is a substringcontiguous subsequence of some Sn.

Interestingly, for each positive integer k, there are only k+1 different Fibonacci subwords of length k. We interpret them as decimal numbers (ignoring leading zeros) and let Ψ(k) be the sum of their squares.

For example, the four different Fibonacci subwords of length 3 are 001,010,100,101. Therefore Ψ(3)=12+102+1002+1012=20302.
You are also given Ψ(10)10699667(mod101001001).

Find Ψ(1018)mod101001001.

Write-up coming later

The complete problem is available here. An approach, code, and answer will be added later.