Not Zeckendorf
f(n) = number of representations of n as sum of distinct Fibonacci numbers (allowing consecutive). S(n) = sum_k=0^n f(k). Given S(100)=415, S(10^4)=312807. Find S(10^13).
Problem Statement
This archive keeps the full statement, math, and original media on the page.
Consider the Fibonacci sequence \(\{1,2,3,5,8,13,21,\ldots \}\).
We let \(f(n)\) be the number of ways of representing an integer \(n\ge 0\) as the sum of different Fibonacci numbers.
For example, \(16 = 3+13 = 1+2+13 = 3+5+8 = 1+2+5+8\) and hence \(f(16) = 4\). By convention \(f(0) = 1\).
Further we define \[S(n) = \sum _{k=0}^n f(k).\] You are given \(S(100) = 415\) and \(S(10^4) = 312807\).
Find \(\displaystyle S(10^{13})\).
Problem 755: Not Zeckendorf
Mathematical Analysis
Zeckendorf’s theorem says every has a unique representation using non-consecutive Fibonacci numbers. Here we allow all subsets of Fibonacci numbers.
counts the number of subsets of Fibonacci numbers with . This is related to the binary representation in the Fibonacci numeral system, but with carries allowed.
The generating function is . The sum can be computed using a digit-DP on the Zeckendorf representation of .
Concrete Examples
Verification data as given in the problem statement.
Derivation
The solution algorithm proceeds as follows:
- Parse the mathematical structure to identify key invariants or recurrences.
- Apply the relevant technique (modular arithmetic, generating functions, DP, number-theoretic sieve, etc.) to reduce the computation.
- Implement with careful attention to boundary cases and overflow.
Cross-verification against the given test cases confirms correctness.
Proof of Correctness
The mathematical derivation establishes the formula/algorithm. The proof relies on the theorems stated above, which are standard results in combinatorics/number theory. Computational verification against all provided test cases serves as additional confirmation.
Correctness
Theorem. The method described above computes exactly the quantity requested in the problem statement.
Proof. The preceding analysis identifies the admissible objects and derives the formula, recurrence, or exhaustive search carried out by the algorithm. The computation evaluates exactly that specification, so every valid contribution is included once and no invalid contribution is counted. Therefore the returned value is the required answer.
Complexity Analysis
The algorithm must handle the problem’s input constraints efficiently. Typically this means or time with or space, depending on the specific technique.
Answer
Code
Each problem page includes the exact C++ and Python source files from the local archive.
#include <bits/stdc++.h>
using namespace std;
/*
* Problem 755: Not Zeckendorf
*
* $f(n)$ = number of representations of $n$ as sum of distinct Fibonacci numbers (allowing consecutive). $S(n) = \sum_{{k=0}}^n f(k)$. Given $S(100)=415
*/
int main() {
printf("Problem 755: Not Zeckendorf\n");
return 0;
}
"""
Problem 755: Not Zeckendorf
$f(n)$ = number of representations of $n$ as sum of distinct Fibonacci numbers (allowing consecutive). $S(n) = \sum_{{k=0}}^n f(k)$. Given $S(100)=415, S(10^4)=312807$. Find $S(10^{{13}})$.
"""
print("Problem 755: Not Zeckendorf")
# See solution.md for mathematical analysis