login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A103310 Largest prime primitive root of n that is less than n, or 0 if none exists. 6
0, 0, 0, 2, 3, 3, 5, 5, 0, 5, 7, 7, 0, 11, 5, 0, 0, 11, 11, 13, 0, 0, 19, 19, 0, 23, 19, 23, 0, 19, 0, 17, 0, 0, 31, 0, 0, 19, 29, 0, 0, 29, 0, 29, 0, 0, 43, 43, 0, 47, 47, 0, 0, 41, 47, 0, 0, 0, 47, 47, 0, 59, 53, 0, 0, 0, 0, 61, 0, 0, 0, 67, 0, 59, 61, 0, 0, 0, 0, 59, 0, 59, 71, 79, 0, 0, 73 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,4

LINKS

Robert Israel, Table of n, a(n) for n = 0..10000

Eric Weisstein's World of Mathematics, Primitive Root.

MAPLE

hasproot:= proc(n)

  if n::odd then nops(numtheory:-factorset(n))=1

  else padic:-ordp(n, 2)=1 and nops(numtheory:-factorset(n/2))=1

  fi

end proc;

hasproot(2):= true: hasproot(4):= true:

f:= proc(n) local p, t;

  if not hasproot(n) then return 0 fi;

  t:= numtheory:-phi(n);

  p:= prevprime(n);

  while not numtheory:-order(p, n)=t do

    if p = 2 then return 0 fi;

    p:= prevprime(p);

  od;

  p

end proc:

f(0):= 0: f(1):= 0: f(2):= 0:

map(f, [$0..100]); # Robert Israel, Sep 08 2020

CROSSREFS

Cf. A001918, A046144, A046145, A046146, A103309.

Sequence in context: A158745 A175108 A265145 * A046146 A081768 A273493

Adjacent sequences:  A103307 A103308 A103309 * A103311 A103312 A103313

KEYWORD

easy,nonn

AUTHOR

Harry J. Smith, Jan 29 2005

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 1 20:39 EST 2021. Contains 341741 sequences. (Running on oeis4.)