OFFSET
1,2
COMMENTS
Define the following operation: For a nonnegative integer V, pick an integer 1 <= j <= n, and replace V with j * round(V/j). a(n) is the largest integer that can be reached by a finite number of operations, starting from 1.
Problem 2 of the 2026 European Girls' Mathematical Olympiad (EGMO) proves that for any m >= 2, there exists an integer N such that for any n >= N, a(n) is divisible by m. In fact, N = m*(m - 1) satisfies the condition.
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..65
Art of Problem Solving, European Girls' Mathematical Olympiad 2026 Problem 2
Yifan Xie, Python program
FORMULA
a(n+1) >= a(n). - Michael S. Branicky, May 11 2026
EXAMPLE
For n = 5, a(5) = 12 because 12 mod 1 = 0 < 1/2, 12 mod 2 = 0 < 2/2, 12 mod 3 = 0 < 3/2, 12 mod 4 = 0 < 4/2, 12 mod 5 = 2 < 5/2, and numbers less than 12 do not satisfy the conditions.
MATHEMATICA
a[n_]:=Module[{m=1}, While[!AllTrue[Range[n], Mod[m, #]<#/2 &], m++]; m]; Array[a, 30] (* Stefano Spezia, May 09 2026 *)
PROG
(Python) # See links.
(Python)
from itertools import count
def a(n): return next(m for m in count(1) if all(m%k < (k+1)>>1 for k in range(1, n+1)))
print([a(n) for n in range(1, 31)]) # Michael S. Branicky, May 09 2026
(Python) # faster for initial segment of sequence
from itertools import count, islice
def agen(): # generator of terms
an = 1
for n in count(2):
yield an
an = next(m for m in count(an) if all(m%k < (k+1)>>1 for k in range(1, n+1)))
print(list(islice(agen(), 30))) # Michael S. Branicky, May 09 2026
(PARI) isok(m, n) = if (#select(x->x>=0, vector(n, k, (m % k) - k/2)), 0, 1);
a(n) = my(m=1); while(!isok(m, n), m++); m; \\ Michel Marcus, May 09 2026
CROSSREFS
KEYWORD
nonn
AUTHOR
Yifan Xie, May 05 2026
STATUS
approved
