cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A263984 Least composite primitive root of n-th prime.

This page as a plain text file.
%I A263984 #19 Oct 19 2021 02:51:31
%S A263984 9,8,8,10,6,6,6,10,10,8,12,15,6,12,10,8,6,6,12,21,14,6,6,6,10,8,6,6,6,
%T A263984 6,6,6,6,12,8,6,6,12,10,8,6,10,21,10,8,6,22,6,6,6,6,14,14,6,6,10,8,6,
%U A263984 6,12,12,8,14,22,10,8,28,10,6,18
%N A263984 Least composite primitive root of n-th prime.
%C A263984 The only square in the sequence is a(1) = 9.
%C A263984 It seems nearly certain that all nonsquare composite numbers occur in this sequence.
%H A263984 Amiram Eldar, <a href="/A263984/b263984.txt">Table of n, a(n) for n = 1..10000</a>
%t A263984 primrootQ[n_, r_] := MultiplicativeOrder[r, n] == EulerPhi[n];
%t A263984 a[n_] := Module[{p = Prime[n], k = 6}, While[PrimeQ[k] || GCD[k, p] != 1 || !primrootQ[p, k], k++]; k];
%t A263984 Array[a, 70] (* _Jean-François Alcover_, Oct 23 2020, after PARI code *)
%o A263984 (PARI) isprimroot(n,r)=znorder(Mod(r,n))==eulerphi(n)
%o A263984 a(n)=my(p=prime(n),k=6);while(isprime(k)||gcd(k,p)!=1||!isprimroot(p,k),k++);k
%Y A263984 Cf. A001918, A002233, A122028.
%K A263984 nonn
%O A263984 1,1
%A A263984 _Franklin T. Adams-Watters_, Oct 31 2015