P912
projecteuler.net

Where are the Odds?

ℹ️Published on Sunday, 13th October 2024, 11:00 am; Solved by 192;
Difficulty rating: 50%

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$.



Soluzione

Last modified: May 01, 2025. Website built with Franklin.jl and the lovely Julia programming language.