OFFSET
2,2
COMMENTS
A discrete infinite sum that has some rough analogies to the infinite series for exponentials.
FORMULA
a(n) = -1 + Sum_{k=1..n} A062169(n, k). - Vladeta Jovovic, Sep 06 2003
EXAMPLE
a(7) = 2! mod 7 + 3! mod 7 + 4! mod 7 + 5! mod 7 + 6! mod 7 + 7! mod 7 + 8! mod 7 + . . . = 2 mod 7 + 6 mod 7 + 24 mod 7 + 120 mod 7 + 720 mod 7 + 5040 mod 7 + 40320 mod 7 + ... = 2 + 6 + 3 + 1 + 6 + (all further values are zero) = 18.
PROG
(PARI) a(n) = sum(m=2, n, m! % n) \\ Michel Marcus, Jul 23 2013
(Python)
def A086330(n):
a, c = 0, 1
for m in range(2, n):
c = c*m%n
if c==0:
break
a += c
return a # Chai Wah Wu, Apr 16 2024
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Walter Carlini, Aug 31 2003
EXTENSIONS
Corrected and extended by Vladeta Jovovic, Sep 06 2003
STATUS
approved