login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

A247176
Largest number of maximal order mod n.
3
0, 1, 2, 3, 3, 5, 5, 7, 5, 7, 8, 11, 11, 5, 13, 13, 14, 11, 15, 17, 19, 19, 21, 23, 23, 19, 23, 23, 27, 23, 24, 29, 29, 31, 33, 31, 35, 33, 37, 37, 35, 31, 34, 41, 43, 43, 45, 43, 47, 47, 46, 45, 51, 47, 53, 53, 53, 55, 56, 53, 59, 55, 61, 61, 63, 61, 63, 65, 67, 67, 69, 67
OFFSET
1,3
EXAMPLE
a(18) = 11 because the largest possible order mod 18 is 6, and because 16, 15, 14, and 12 are not coprime to 18, and the orders of 17 and 13 to mod 18 are 2 and 3, not the largest possible order, and the order of 11 to mod 18 is 6, so a(18) = 11.
MATHEMATICA
prms={}; f[n_] = Block[If[MultiplicativeOrder[p, n]=CarmichaelLambda[n], Join[prms, p]]; prms[-1]]; Array[f, 128]
PROG
(PARI) carmichaellambda(n)=lcm(znstar(n)[2]);
for(i=1, 128, p=0; for(q=1, i-1, if(gcd(q, i)==1&&znorder(Mod(q, i))==carmichaellambda(i), p=q)); print1(p", "))
CROSSREFS
Cf. A002322 (orders), same as A046146 for n with primitive roots, A071894 (for primes).
Sequence in context: A340192 A363321 A112823 * A325163 A348538 A185075
KEYWORD
nonn,easy
AUTHOR
Eric Chen, Nov 29 2014
EXTENSIONS
a(68) corrected by Eric Chen, Jun 01 2015
STATUS
approved