OFFSET
1,3
COMMENTS
Note that the running product for each a(n) is incrementally computed mod n-1.
MATHEMATICA
a[1] = 1; a[n_] := a[n] = 1 + Mod[Product[a[k], {k, 1, n - 1}], n - 1]; Array[a, 100] (* Amiram Eldar, Aug 22 2020 *)
PROG
(Python)
def f(n):
if n == 1: return 1
a = 1
for k in range(1, n):
a = a * f(k) % (n - 1)
return a + 1
CROSSREFS
KEYWORD
nonn
AUTHOR
Matt Donahoe, Aug 22 2020
STATUS
editing