login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A306253 Largest primitive root mod A033948(n). 3
0, 1, 2, 3, 3, 5, 5, 5, 7, 8, 11, 5, 14, 11, 15, 19, 21, 23, 19, 23, 27, 24, 31, 35, 33, 35, 34, 43, 45, 47, 47, 51, 47, 55, 56, 59, 55, 63, 69, 68, 69, 77, 77, 75, 80, 77, 86, 91, 92, 89, 99, 101, 103, 104, 103, 110, 115, 117, 115, 123, 118, 128, 117, 134, 135 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,3

COMMENTS

Let U(k) denote the multiplicative group mod k. a(n) = largest generator for U(A033948(n)). - N. J. A. Sloane, Mar 10 2019

LINKS

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

EXAMPLE

For n=2, U(n) is generated by 1.

For n=14, A033948(14) = 18, and, U(n) is generated by both 5 and 11; here we select the largest generator, 11, so a(14) = 11.

MAPLE

f:= proc(b) local x, t;

  t:= numtheory:-phi(b);

  for x from b-1 by -1 do if igcd(x, b) = 1 and numtheory:-order(x, b)=t then return x fi od

end proc:

f(1):= 0:

cands:= select(t -> t=1 or numtheory:-primroot(t) <> FAIL, [$1..1000]):

map(f, cands); # Robert Israel, Mar 10 2019

PROG

def gcd(x, y):

    # Euclid's Algorithm

    while(y):

        x, y = y, x % y

    return x

roots = []

for n in xrange(2, 140):

    # find U(n)

    un = [i for i in xrange(n, 0, -1) if (gcd(i, n) is 1)]

    # for each element in U(n), check if it's a generator

    order = len(un)

    is_cyclic = False

    for cand in un:

        is_gen = True

        run = 1

        # If it cand^x = 1 for some x < order, it's not a generator

        for _ in xrange(order-1):

            run = (run * cand) % n

            if run == 1:

                is_gen = False

                break

        if is_gen:

            roots.append(cand)

            is_cyclic = True

            break

print "roots:", roots

CROSSREFS

See A306252 for smallest roots and A033948 for the sequence of numbers that have a primitive root.

Sequence in context: A098567 A086162 A036703 * A117629 A081165 A289749

Adjacent sequences:  A306250 A306251 A306252 * A306254 A306255 A306256

KEYWORD

nonn

AUTHOR

Charles Paul, Feb 01 2019

EXTENSIONS

Edited by N. J. A. Sloane, Mar 10 2019.

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 October 20 20:13 EDT 2019. Contains 328272 sequences. (Running on oeis4.)