A371531 a(n) is the multiplicative order of A053669(n) modulo n.
1, 1, 2, 2, 4, 2, 3, 2, 6, 4, 10, 2, 12, 6, 4, 4, 8, 6, 18, 4, 6, 5, 11, 2, 20, 3, 18, 6, 28, 4, 5, 8, 10, 16, 12, 6, 36, 18, 12, 4, 20, 6, 14, 10, 12, 11, 23, 4, 21, 20, 8, 6, 52, 18, 20, 6, 18, 28, 58, 4, 60, 30, 6, 16, 12, 10, 66, 16, 22, 12, 35, 6, 9, 18, 20
Offset: 1
Keywords
Programs
-
Mathematica
a[n_] := Module[{p = 2}, While[Divisible[n, p], p = NextPrime[p]]; MultiplicativeOrder[p, n]]; Array[a, 75] (* Amiram Eldar, Mar 26 2024 *)
-
PARI
f(n) = forprime(p=2, , if(n%p, return(p))); \\ A053669 a(n) = znorder(Mod(f(n), n)); \\ Michel Marcus, Mar 26 2024
-
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)])