OFFSET
1,3
LINKS
FORMULA
a(n) = LCM_{p-1|n-1, p|n, p prime} (p-1).
a(n) = p-1 for prime powers n = p^e, e >= 1; a(n) = 1 for any even n = 2k. - M. F. Hasler, Nov 23 2021
EXAMPLE
From M. F. Hasler, Nov 23 2021: (Start)
For n = 2, the only prime factor of n is p = 2, and p-1 = 1 divides n-1 = 1, therefore a(2) = LCM { 1 } = 1.
For n = 35, the prime factors of n are p = 5 and p = 7; but neither 5-1 = 4 nor 7-1 = 6 divides n-1 = 34, therefore a(35) = LCM {} = 1. (End)
PROG
(PARI) A346466(n) = lcm(apply(p->if((n-1)%(p-1), 1, (p-1)), factor(n)[, 1]));
(PARI) A346466(n) = if(1==n, n, my(m=1); fordiv(n-1, d, if(isprime(1+d)&&!(n%(1+d)), m = lcm(m, d))); (m));
(PARI) apply( {A346466(n)=lcm([p-1|p<-factor(n)[, 1], (n-1)%(p-1)==0])}, [1..99]) \\ M. F. Hasler, Nov 23 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Jul 19 2021
STATUS
approved