← Complete problem index

PROJECT EULER · #0486

Palindrome-containing Strings

Statement only · UnsolvedOriginal problem ↗

Let F5(n) be the number of strings s such that:

  • s consists only of '0's and '1's,
  • s has length at most n, and
  • s contains a palindromic substring of length at least 5.

For example, F5(4)=0, F5(5)=8, F5(6)=42 and F5(11)=3844.

Let D(L) be the number of integers n such that 5nL and F5(n) is divisible by 87654321.

For example, D(107)=0 and D(5109)=51.

Find D(1018).

Write-up coming later

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