login
A329983
For any n > 0, define the sequence b(1) = n, b(i+1) = (b(i) * i) mod (b(i) + i); a(n) is the least i such that b(i) = 0, or -1 if 0 is never reached.
1
1, 13, 3, 85, 13, 85, 7, 58, 4, 13, 7, 85, 5, 7, 13, 58, 58, 85, 85, 13, 5, 85, 7, 291, 13, 85, 58, 85, 58, 7, 85, 291, 85, 85, 13, 58, 13, 58, 291, 11, 6, 58, 13, 7, 13, 85, 7, 291, 58, 85, 9, 85, 7, 13, 13, 58, 85, 13, 9, 58, 291, 291, 13, 11
OFFSET
0,2
LINKS
PROG
(Python) def k(a, b):
return ((a*b)%(a+b))
numberList=[]
def repeat(a):
i=1
while a!=0:
a= k(a, i)
i=i+1
numberList.append(i)
for x in range(10000):
repeat(x)
print(numberList)
(PARI) f(m, n) = (m*n) % (m+n);
a(n) = {my(i=1); while (n, n = f(n, i); i++; ); i; } \\ Michel Marcus, Nov 28 2019
CROSSREFS
Cf. A308651.
Sequence in context: A297874 A298137 A155847 * A204594 A204157 A010219
KEYWORD
nonn
AUTHOR
Stefan Gog, Nov 26 2019
STATUS
approved