OFFSET
1,2
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..213
FORMULA
{ k >= 0 : k! mod nextprime(k) > k }.
A360825(a(n)) > a(n).
MAPLE
q:= n-> is(n! mod nextprime(n)>n):
select(q, [$0..20000])[];
PROG
(Python)
from itertools import count, islice
from functools import reduce
from sympy import nextprime
def A360805_gen(startvalue=0): # generator of terms >= startvalue
n = max(startvalue, 0)
m = nextprime(n)
while True:
a = m-1
klist = []
for i in range(m-1, n, -1):
a = a*pow(i, -1, m)%m
if a>i-1:
klist.append(i-1)
yield from sorted(klist)
n, m = m, nextprime(m)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Feb 22 2023
STATUS
approved