login
A253387
A "mod sequence" where a(n) is the eventual constant value attained by the sequence defined as b(1) = n, b(m) = (Sum_{k=1..m-1} b(k)) mod m.
2
97, 97, 1, 1, 2, 2, 2, 2, 316, 316, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 12, 12, 4, 4, 4, 4, 12, 12, 11, 11, 11, 11, 316, 316, 11, 11, 316, 316, 316, 316, 6, 6, 316, 316, 316, 316, 316, 316, 316, 316, 97, 97, 316, 316, 316, 316, 13, 13, 316, 316, 13
OFFSET
1,1
COMMENTS
The necessary and sufficient condition for the constant value a(n) to be attained by the sequence b(m) is: Sum_{k=1..m-1} b(k) = b(m)*(m + 1). - Lechoslaw Ratajczak, Sep 15 2025
LINKS
Lechoslaw Ratajczak, Table of n, a(n) for n = 1..1000 (terms 1..448 from Jean-François Alcover)
EXAMPLE
a(5) = 2, because the b sequence is 5, 1, 0, 2, 3, 5, 2, 2, 2, 2, 2, ...
PROG
(Maxima) (a(n):=(s:n, b:0, for m:2 unless s=b*(m+1) do (b:mod(s, m), s:s+b), b),
makelist(a(n), n, 1, 100)); /* Lechoslaw Ratajczak, Sep 15 2025 */
(PARI) a(n) = my(s=n, m=2, b=0); while(s!=b*(m+1), b=s % m; s += b; m++); b \\ Andrew Howroyd, Sep 15 2025
CROSSREFS
Sequence in context: A126146 A112667 A106419 * A074482 A130765 A111326
KEYWORD
sign
AUTHOR
STATUS
approved