OFFSET
1,3
COMMENTS
Original definition: a(n) is the least common multiple of p-1 computed over all primes p for which p-1 is a divisor of n-1; a(1) = 1.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
FORMULA
MAPLE
f:= proc(n)
if n::even then return 1 fi;
ilcm(op(select(d -> isprime(d+1), numtheory:-divisors(n-1))));
end proc:
f(1):= 1:
map(f, [$1..200]); # Robert Israel, Aug 30 2021
MATHEMATICA
{1}~Join~Array[CarmichaelLambda@ Denominator@ BernoulliB@ # &, 96] (* Michael De Vlieger, Jul 22 2021 *)
PROG
(PARI) A346467(n) = if(1==n, n, my(m=1); fordiv(n-1, d, if(isprime(1+d), m = lcm(m, d))); (m));
(PARI) apply( {A346467(n)=if(n>1, lcm([d|d<-divisors(n-1), isprime(d+1)]), 1)}, [1..99]) \\ M. F. Hasler, Nov 23 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen and Thomas Ordowski, Jul 22 2021
STATUS
approved