login
A395741
a(n) is the smallest positive integer m such that m mod k < k/2 for each 1 <= k <= n.
1
1, 2, 4, 4, 12, 12, 36, 72, 72, 72, 192, 192, 1080, 1080, 1080, 3360, 27120, 28800, 65520, 65520, 65520, 65520, 306000, 306000, 306000, 306000, 306000, 388080, 388080, 388080, 3109680, 11592000, 14313600, 14313600, 14313600, 14313600, 14313600, 57002400
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
FORMULA
A003418(A000194(n+1)) <= a(n) <= A003418(n).
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
Cf. A003418.
Sequence in context: A319594 A065449 A130618 * A129882 A129017 A086915
KEYWORD
nonn
AUTHOR
Yifan Xie, May 05 2026
STATUS
approved