login
A255933
a(n) is the largest integer m such that s/(m!-1) is an integer, where s is the sum of all previous terms; a(1)=1.
3
1, 2, 2, 3, 2, 3, 2, 3, 2, 3, 4, 2, 2, 2, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 4, 5, 2, 2, 2, 3, 2, 3, 4, 2, 2, 2, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 4, 2, 2, 5, 2, 3, 2, 3, 4, 2, 2, 2, 2, 3, 2
OFFSET
1,2
COMMENTS
For all n>1, a(n) exists and is at least 2, since 2 gives a denominator (2!-1) = 1, thus an integer.
The sequence of partial sums is: 1, 3, 5, 8, 10, 13, 15, 18, 20, 23, 27, 29, 31, 33, 35, 38, ... = A392027.
The record values occur at n = 1, 2, 4, 11, 49, 286, 1997, ... = A392028.
EXAMPLE
a(5) = 2 since (1+2+2+3)/(m!-1) = 8/(2!-1) = 8, an integer.
a(6) = 3 since (1+2+2+3+2)/(m!-1) = 10/(3!-1) = 2, an integer.
MATHEMATICA
Module[{s = 1, k = 2, m}, Join[{s}, Table[While[k! - 1 <= s, k++]; m = k; While[!Divisible[s, m! - 1], m--]; s += m; m, {n, 2, 100}]]] (* Paolo Xausa, Dec 27 2025 *)
PROG
(PARI) lista(nn) = {v = [1]; s = 1; print1(s, ", "); for (n=2, nn, k = 2; while(k!-1 <= s, k++); until (type(s/(k!-1)) == "t_INT", k--); s += k; print1(k, ", "); v = concat(v, k); ); } \\ Michel Marcus, Mar 11 2015
(Python)
from itertools import islice
def A255933_gen(): # generator of terms
an = s = k = factk = 1
while True:
yield an
while factk <= s: k += 1; factk *= k
m, factm = k, factk
while s%(factm-1): factm //= m; m -= 1
an, s = m, s+m
print(list(islice(A255933_gen(), 107))) # Michael S. Branicky, Dec 28 2025
CROSSREFS
Sequence in context: A163178 A219545 A029374 * A340805 A343556 A319396
KEYWORD
nonn
AUTHOR
Neri Gionata, Mar 11 2015
STATUS
approved