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.

Original entry on oeis.org

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, 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, 6, 12, 12, 8, 14, 22, 10, 8, 28, 10, 6, 18
Offset: 1

Views

Author

Keywords

Comments

The only square in the sequence is a(1) = 9.
It seems nearly certain that all nonsquare composite numbers occur in this sequence.

Crossrefs

Programs

  • Mathematica
    primrootQ[n_, r_] := MultiplicativeOrder[r, n] == EulerPhi[n];
    a[n_] := Module[{p = Prime[n], k = 6}, While[PrimeQ[k] || GCD[k, p] != 1 || !primrootQ[p, k], k++]; k];
    Array[a, 70] (* Jean-François Alcover, Oct 23 2020, after PARI code *)
  • PARI
    isprimroot(n,r)=znorder(Mod(r,n))==eulerphi(n)
    a(n)=my(p=prime(n),k=6);while(isprime(k)||gcd(k,p)!=1||!isprimroot(p,k),k++);k