Fibonacci Entry Points
For a positive integer m, the Fibonacci entry point (or rank of apparition) alpha(m) is the smallest positive k such that m | F_k. Find sum_(m=1)^(10^5) alpha(m).
Problem Statement
This archive keeps the full statement, math, and original media on the page.
A sequence \((a_n)_{n \ge 0}\) starts with \(a_0 = 3\) and for each \(n \ge 0\),
Problem 955: Fibonacci Entry Points
Mathematical Analysis
Pisano Periods and Entry Points
The Fibonacci sequence modulo is periodic; its period is called the Pisano period. The entry point is the position of the first zero in this periodic sequence.
Theorem (Divisibility Properties).
- always exists and .
- if and only if .
- .
Proof of (2). Let . If , then by the matrix identity , we have by induction on . Conversely, if and with , then using , we can show , contradicting minimality unless .
Entry Points for Prime Powers
Theorem (Wall, 1960). For an odd prime :
- divides if (i.e., ).
- divides if (i.e., ).
Theorem (Prime Power Lifting). For prime and :
except possibly for Wall—Sun—Sun primes (none known as of 2025).
Entry Points for Composites
Theorem. For :
Proof. iff both and (by coprimality), iff and , iff .
Concrete Examples
| First zero in | ||
|---|---|---|
| 1 | 1 | |
| 2 | 3 | |
| 3 | 4 | |
| 5 | 5 | |
| 7 | 8 | |
| 10 | 15 | |
| 12 | 12 |
Derivation
Algorithm: Direct Search
For each from 1 to :
- Compute Fibonacci numbers modulo : .
- Find the smallest with .
- This is .
The search terminates because the Pisano period exists, with .
Optimization
For with known factorization :
- Compute for each prime factor.
- Lift: .
- Combine: .
This avoids searching up to for large .
Proof of Correctness
The Fibonacci sequence modulo is deterministic and periodic (pigeonhole on pairs , with at most possible pairs). The first occurrence of is well-defined and equals .
Complexity Analysis
- Direct search: per value, total, where on average. Roughly .
- Factorization-based: per factorization + per prime, giving total.
- Space: per computation (only track current and previous Fibonacci terms).
Answer
Code
Each problem page includes the exact C++ and Python source files from the local archive.
/*
* Problem 955: Fibonacci Entry Points
*
* For each m = 1..10^5, find alpha(m) = smallest k >= 1 with m | F_k.
* Return sum of all alpha(m).
*
* Direct search: iterate F_k mod m until F_k = 0.
* Guaranteed to terminate: Pisano period pi(m) <= 6m.
*
* Complexity: O(N * avg_alpha) ~ O(N^2).
*/
#include <bits/stdc++.h>
using namespace std;
int fibonacci_entry_point(int m) {
if (m == 1) return 1;
int a = 0, b = 1;
for (int k = 1; k <= 6 * m + 1; k++) {
int c = (a + b) % m;
a = b;
b = c;
if (a == 0) return k;
}
return -1; // should not reach
}
int main() {
const int N = 100000;
long long total = 0;
for (int m = 1; m <= N; m++) {
total += fibonacci_entry_point(m);
}
cout << total << endl;
return 0;
}
"""
Problem 955: Fibonacci Entry Points
For each m = 1, ..., 10^5, find alpha(m) = smallest k >= 1 with m | F_k.
Return sum of all alpha(m).
Key properties:
- alpha(m) divides the Pisano period pi(m)
- For coprime a,b: alpha(ab) = lcm(alpha(a), alpha(b))
- alpha(p^a) = p^{a-1} * alpha(p) for primes p
Complexity: O(N * avg_alpha) ~ O(N^2) direct, O(N^{3/2}) with factorization.
"""
from math import gcd
def fibonacci_entry_point(m: int) -> int:
"""Find smallest k >= 1 such that F_k is divisible by m."""
if m == 1:
return 1
a, b = 0, 1
for k in range(1, 6 * m + 2):
a, b = b, (a + b) % m
if a == 0:
return k
raise ValueError(f"Entry point not found for m={m}")
def solve(N: int = 10**5) -> int:
"""Compute sum of alpha(m) for m = 1 to N."""
return sum(fibonacci_entry_point(m) for m in range(1, N + 1))
# --- Compute answer ---
N = 10**5
total = 0
alphas = [0] * (N + 1)
for m in range(1, N + 1):
alphas[m] = fibonacci_entry_point(m)
total += alphas[m]
# Verify known values
assert alphas[1] == 1
assert alphas[2] == 3
assert alphas[3] == 4
assert alphas[5] == 5
assert alphas[7] == 8
print(total)