OFFSET
1,3
MATHEMATICA
a[n_] := Module[{p = 2}, While[Divisible[n, p], p = NextPrime[p]]; MultiplicativeOrder[p, n]]; Array[a, 75] (* Amiram Eldar, Mar 26 2024 *)
PROG
(Python)
from sympy.ntheory.residue_ntheory import n_order
from sympy import nextprime
def a(n):
if n == 1: return 1
if n & 1 == 1: return n_order(2, n)
p = 2
while n % p == 0:
p = nextprime(p)
return n_order(p, n)
print([a(n) for n in range(1, 76)])
(PARI) f(n) = forprime(p=2, , if(n%p, return(p))); \\ A053669
a(n) = znorder(Mod(f(n), n)); \\ Michel Marcus, Mar 26 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Darío Clavijo, Mar 26 2024
STATUS
approved