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.

Showing 1-3 of 3 results.

A242345 Number of primes p < prime(n) with p and 2^p - p both primitive roots modulo prime(n).

Original entry on oeis.org

0, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 2, 2, 1, 4, 4, 7, 1, 2, 1, 1, 1, 6, 4, 1, 4, 2, 6, 3, 7, 1, 3, 7, 4, 6, 1, 5, 6, 9, 12, 7, 5, 6, 4, 11, 2, 3, 6, 12, 6, 18, 13, 3, 14, 13, 14, 15, 4, 9, 6, 3, 13, 8, 12, 5, 12, 6, 6, 20, 8, 14, 19, 8, 5, 5, 22, 20, 6, 18, 6
Offset: 1

Views

Author

Zhi-Wei Sun, May 11 2014

Keywords

Comments

Conjecture: a(n) > 0 for all n > 1. In other words, for any odd prime p, there is a prime q < p such that both q and 2^q - q are primitive roots modulo p.
According to page 377 in Guy's book, Erdős asked whether for any sufficiently large prime p there exists a prime q < p which is a primitive root modulo p.

Examples

			a(4) = 1 since 3 is a prime smaller than prime(4) = 7, and both 3 and 2^3 - 3 = 5 are primitive roots modulo 7.
a(10) = 1 since 2 is a prime smaller than prime(10) = 29, and 2 and 2^2 - 2 are primitive roots modulo 29.
a(36) = 1 since 71 is a prime smaller than prime(36) = 151, and both 71 and 2^(71) - 71 ( == 14 (mod 151)) are primitive roots modulo 151.
		

References

  • R. K. Guy, Unsolved Problems in Number Theory, 3rd Edition, Springer, New York, 2004.

Crossrefs

Programs

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

A242250 Least positive integer g < prime(n) such that g, 2^g - 1 and (g-1)! are all primitive roots modulo prime(n), or 0 if such a number g does not exist.

Original entry on oeis.org

1, 0, 3, 5, 8, 11, 5, 13, 21, 10, 12, 22, 24, 34, 13, 31, 18, 6, 41, 11, 14, 53, 8, 6, 26, 3, 12, 5, 47, 10, 45, 10, 5, 32, 12, 6, 24, 3, 15, 3, 6, 41, 19, 10, 8, 30, 3, 67, 5, 35, 20, 13, 99, 19, 7, 7, 3, 118, 5, 15, 22, 3, 73, 59, 91, 8, 137, 46, 20, 55
Offset: 1

Views

Author

Zhi-Wei Sun, May 09 2014

Keywords

Comments

According to the conjecture in A242248, a(n) should be positive for all n > 2.

Examples

			a(5) = 8 since 8, 2^8 - 1 = 255 and (8-1)! = 5040 are all primitive roots modulo prime(5) = 11 with 255 == 5040 == 2 (mod 11), but none of 1, 2^2 - 1, 3, 4, 5, (6-1)! and (7-1)!
is a primitive root modulo 11.
		

Crossrefs

Programs

  • Mathematica
    f[n_]:=f[n]=2^n-1
    g[n_]:=g[n]=(n-1)!
    rMod[m_,n_]:=rMod[m,n]=Mod[m,n,-n/2]
    dv[n_]:=dv[n]=Divisors[n]
    Do[Do[If[Mod[f[k],Prime[n]]==0,Goto[aa]];Do[If[Mod[k^(Part[dv[Prime[n]-1],i])-1,Prime[n]]==0||Mod[rMod[f[k],Prime[n]]^(Part[dv[Prime[n]-1],i])-1,Prime[n]]==0||Mod[rMod[g[k],Prime[n]]^(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}];Print[n," ",0];Label[bb];Continue,{n,1,70}]

A242266 a(n) = |{0 < g < prime(n): g is a primitive root mod prime(n) with g = sum_{j=1..k} prime(j) for some k > 0}|.

Original entry on oeis.org

0, 1, 1, 1, 1, 1, 2, 2, 3, 2, 1, 3, 2, 2, 3, 3, 2, 3, 3, 1, 3, 2, 3, 3, 5, 2, 2, 6, 2, 4, 1, 3, 2, 3, 5, 2, 2, 2, 6, 6, 6, 7, 2, 6, 4, 4, 4, 5, 6, 5, 6, 3, 1, 3, 7, 9, 9, 2, 5, 2, 2, 6, 4, 5, 6, 6, 4, 3, 8, 3, 6, 6, 7, 5, 6, 9, 8, 6, 4, 4
Offset: 1

Views

Author

Zhi-Wei Sun, May 09 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 1. In other words, for any odd prime p, there is a positive integer k such that the sum of the first k primes is not only a primitive root modulo p but also smaller than p.
(ii) For any n > 1, there is a number k among 1, ..., n such that sum_{j=1..k}(-1)^(k-j)*prime(j) is a primitive root modulo prime(n).
We have verified parts (i) and (ii) for n up to 700000 and 250000 respectively. Note that prime(700000) > 10^7.

Examples

			a(4) = 1 since prime(1) + prime(2) = 2 + 3 = 5 is a primitive root modulo prime(4) = 7 with 5 < 7.
a(7) = 2 since prime(1) = 2 and prime(1) + prime(2) + prime(3) = 2 + 3 + 5 = 10 are not only primitive roots modulo prime(7) = 17 but also smaller than 17.
a(53) = 1 since sum_{j=1..10} prime(j) = 129 is a primitive root modulo prime(53) = 241 with 129 < 241.
		

Crossrefs

Programs

  • Mathematica
    f[0]=0
    f[n_]:=Prime[n]+f[n-1]
    dv[n_]:=Divisors[n]
    Do[m=0;Do[If[f[k]>=Prime[n],Goto[cc]];Do[If[Mod[f[k]^(Part[dv[Prime[n]-1],i]),Prime[n]]==1,Goto[aa]],{i,1,Length[dv[Prime[n]-1]]-1}];m=m+1;Label[aa];Continue,{k,1,n}];Label[cc];Print[n," ",m];Continue,{n,1,80}]
Showing 1-3 of 3 results.