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.

A242242 Least positive primitive root g < prime(n) modulo prime(n) with 2^g - 1 also a primitive root modulo prime(n), or 0 if such a number g does not exist.

Original entry on oeis.org

1, 0, 2, 5, 2, 2, 3, 2, 5, 2, 3, 2, 6, 3, 5, 2, 2, 2, 2, 7, 5, 3, 2, 3, 5, 2, 5, 2, 6, 3, 3, 2, 3, 2, 2, 6, 5, 2, 5, 2, 2, 2, 19, 5, 2, 3, 2, 3, 2, 6, 3, 7, 7, 6, 3, 5, 2, 6, 5, 3, 3, 2, 5, 17, 10, 2, 3, 10, 2, 2
Offset: 1

Views

Author

Zhi-Wei Sun, May 09 2014

Keywords

Comments

Conjecture: a(n) > 0 except for n = 2. In other words, for any prime p > 3, there exists a primitive root 0 < g < p modulo p such that 2^g - 1 is also a primitive root modulo p.

Examples

			a(4) = 5 since both 5 and 2^5 - 1 = 31 are primitive roots modulo prime(4) = 7, but none of 1, 2, 4 and 2^3 - 1 is a primitive root modulo prime(4) = 7.
		

Crossrefs

Programs

  • Mathematica
    f[n_]:=f[n]=2^n-1
    dv[n_]:=Divisors[n]
    Do[Do[If[Mod[f[k],Prime[n]]==0,Goto[aa]];Do[If[Mod[k^(Part[dv[Prime[n]-1],j])-1,Prime[n]]==0,Goto[aa]],{j,1,Length[dv[Prime[n]-1]]-1}];Do[If[rMod[f[k]^(Part[dv[Prime[n]-1],i])-1,Prime[n]]==0,Goto[aa]],{i,1,Length[dv[Prime[n]-1]]-1}];
    Print[n," ",k];Goto[bb];Label[aa];Continue,{k,1,Prime[n]-1}];Label[cc];Print[n," ",0];Label[bb];Continue,{n,1,70}]