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.

A243847 a(n) = |{0 < k < n: prime(k) is a primitive root modulo prime(n) and also a primitive root modulo prime(2*n)}|.

Original entry on oeis.org

0, 0, 1, 1, 1, 1, 2, 2, 2, 1, 1, 2, 3, 1, 5, 2, 1, 1, 3, 5, 2, 3, 2, 3, 5, 4, 4, 7, 1, 5, 5, 7, 7, 6, 8, 6, 6, 5, 6, 3, 5, 4, 8, 6, 4, 5, 6, 6, 12, 8, 15, 17, 7, 10, 8, 11, 10, 8, 9, 10, 7, 18, 6, 15, 4, 9, 5, 10, 10, 8
Offset: 1

Views

Author

Zhi-Wei Sun, Jun 12 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 2.
(ii) For any integer n > 4, there is a primitive root 0 < g < prime(n) modulo prime(n) which is also a primitive root modulo prime(n+1).

Examples

			a(3) = 1 since prime(1) = 2 is a primitive root modulo prime(3) = 5 and also a primitive root modulo prime(2*3) = 13. Note that prime(2) = 3 is not a primitive root modulo prime(2*3) = 13 since 3^3 == 1 (mod 13).
		

Crossrefs

Programs

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