OFFSET
1,2
COMMENTS
The sequence sometimes decreases, as for example at a(29) = 5186 < 5284 = a(28).
EXAMPLE
PROG
(Python)
from sympy import isprime
l = []
for i in range(2, 185):
if isprime(i):
sum = 0
reminder = 1
for j in range(2, i):
reminder = (reminder * j) % i
sum += reminder
l.append(sum)
print(l)
(Python)
from sympy import prime
def A371035(n):
a, c, p = 0, 1, prime(n)
for m in range(2, p):
c = c*m%p
a += c
return a # Chai Wah Wu, Apr 16 2024
(PARI) a(n) = my(p=prime(n)); sum(m=2, p, m! % p); \\ Michel Marcus, Apr 11 2024
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Alexandre Herrera, Apr 10 2024
STATUS
approved