Search Problems   RSS Feed
projecteuler.net

Where are the Odds?

 Published on Sunday, 13th October 2024, 11:00 am and solved by 289
Difficulty: Level 22 [57%]

Problem 912

Let $s_n$ be the $n$-th positive integer that does not contain three consecutive ones in its binary representation.
For example, $s_1 = 1$ and $s_7 = 8$.

Define $F(N)$ to be the sum of $n^2$ for all $n\leq N$ where $s_n$ is odd. You are given $F(10)=199$.

Find $F(10^{16})$ giving your answer modulo $10^9+7$.



Copied to Clipboard