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-10 of 12 results. Next

A239957 a(n) = |{0 < g < prime(n): g is a primitive root modulo prime(n) of the form k^2 + 1}|.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Apr 23 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 0. In other words, every prime p has a primitive root 0 < g < p of the form k^2 + 1, where k is an integer.
(ii) If p > 3 is a prime not equal to 13, then p has a primitive root 0 < g < p which is of the form k^2 - 1, where k is a positive integer.
See also A239963 for a similar conjecture.

Examples

			a(6) = 1 since 1^2 + 1 = 2 is a primitive root modulo prime(6) = 13.
a(11) = 1 since 4^2 + 1 = 17 is a primitive root modulo prime(11) = 31.
a(20) = 1 since 8^2 + 1 = 65 is a primitive root modulo prime(20) = 71.
a(22) = 1 since 6^2 + 1 = 37 is a primitive root modulo prime(22) = 79.
a(36) = 1 since 9^2 + 1 = 82 is a primitive root modulo prime(36) = 151.
		

Crossrefs

Programs

  • Mathematica
    f[k_]:=k^2+1
    dv[n_]:=Divisors[n]
    Do[m=0;Do[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,0,Sqrt[Prime[n]-2]}];Print[n," ",m];Continue,{n,1,80}]
  • PARI
    ispr(n, p)=my(f=factor(p-1)[, 1], m=Mod(n, p)); for(i=1, #f, if(m^(p\f[i])==1, return(0))); m^(p-1)==1
    a(n)=my(p=prime(n)); sum(k=0, sqrtint(p-2), ispr(k^2+1, p)) \\ Charles R Greathouse IV, May 01 2014

A236308 Number of primes q < prime(n)/2 such that the Catalan number C(q) is a primitive root modulo prime(n).

Original entry on oeis.org

0, 0, 1, 1, 1, 1, 1, 1, 4, 2, 1, 4, 1, 3, 3, 5, 5, 5, 2, 4, 5, 4, 10, 4, 7, 7, 4, 7, 4, 9, 5, 6, 10, 9, 7, 5, 5, 12, 12, 13, 12, 4, 10, 7, 13, 4, 7, 10, 18, 9, 14, 13, 9, 9, 15, 17, 16, 8, 9, 12, 10, 19, 13, 10, 14, 14, 13, 6, 18, 18, 14, 24, 13, 16, 9, 22, 20, 12, 23, 15
Offset: 1

Views

Author

Zhi-Wei Sun, Apr 21 2014

Keywords

Comments

Conjecture: a(n) > 0 for all n > 2. In other words, for any prime p > 3, there exists a prime q < p/2 such that the Catalan number C(q) = binomial(2q, q)/(q+1) is a primitive root modulo p.
We have verified this for all n = 3, ..., 2*10^5.

Examples

			a(13) = 1 since C(7) = 429 is a primitive root modulo prime(13) = 41.
		

Crossrefs

Programs

  • Mathematica
    f[k_]:=CatalanNumber[Prime[k]]
    dv[n_]:=Divisors[n]
    Do[m=0;Do[If[Mod[f[k],Prime[n]]==0,Goto[aa],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,PrimePi[(Prime[n]-1)/2]}];Print[n," ",m];Continue,{n,1,80}]

A237112 Number of primes p < prime(n)/2 with p! a primitive root modulo prime(n).

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Apr 22 2014

Keywords

Comments

Conjecture: a(n) > 0 for all n > 4. In other words, for any prime p > 7, there exists a prime q < p/2 such that q! is a primitive root modulo p.
See also A236306 for a similar conjecture.

Examples

			a(7) = 1 since 3 is a prime smaller than prime(7)/2 = 17/2 and 3! = 6 is a primitive root modulo prime(7) = 17.
a(9) = 1 since  5 is a prime smaller than prime(9)/2 = 23/2 and 5! = 120 is a primitive root modulo prime(9) = 23.
		

Crossrefs

Programs

  • Mathematica
    f[k_]:=(Prime[k])!
    dv[n_]:=Divisors[n]
    Do[m=0;Do[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,PrimePi[(Prime[n]-1)/2]}];Print[n," ",m];Continue,{n,1,70}]

A237121 Number of primes p < prime(n)/2 such that P(p) is a primitive root modulo prime(n), where P(.) is the partition function given by A000041.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Apr 22 2014

Keywords

Comments

Conjecture: a(n) > 0 for all n > 2. In other words, for any prime p > 3, there is a prime q < p/2 with P(q) = A000041(q) a primitive root modulo p.

Examples

			a(14) = 1 since 3 is a prime smaller than prime(14)/2 = 43/2 and P(3) = 3 is a primitive root modulo prime(14) = 43.
		

Crossrefs

Programs

  • Mathematica
    f[k_]:=PartitionsP[Prime[k]]
    dv[n_]:=Divisors[n]
    Do[m=0;Do[If[Mod[f[k],Prime[n]]==0,Goto[aa],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,PrimePi[(Prime[n]-1)/2]}];Print[n," ",m];Continue,{n,1,70}]

A239963 Number of triangular numbers below prime(n) which are also primitive roots modulo prime(n).

Original entry on oeis.org

1, 0, 1, 1, 1, 1, 3, 3, 3, 4, 2, 1, 3, 2, 3, 3, 3, 3, 1, 3, 3, 4, 5, 5, 3, 5, 4, 9, 3, 7, 6, 4, 7, 3, 9, 3, 7, 5, 10, 9, 10, 9, 5, 10, 7, 7, 2, 5, 8, 6, 8, 7, 6, 6, 12, 10, 8, 9, 7, 10, 8, 11, 6, 6, 12, 14, 8, 7, 16, 5, 11, 10, 9, 6, 14, 14, 11, 8, 14, 7
Offset: 1

Views

Author

Zhi-Wei Sun, Apr 23 2014

Keywords

Comments

Conjecture: a(n) > 0 for all n > 2. In other words, for any prime p > 3, there is a primitive root 0 < g < p of the form k*(k+1)/2, where k is a positive integer.

Examples

			a(5) = 1 since the triangular number 3*4/2 = 6 is a primitive root modulo prime(5) = 11.
a(12) = 1 since the triangular number 5*6/2 = 15 is a primitive root modulo prime(12) = 37.
a(19) = 1 since the triangular number 7*8/2 = 28 is a primitive root modulo prime(19) = 67.
		

Crossrefs

Programs

  • Mathematica
    f[k_]:=f[k]=k(k+1)/2
    dv[n_]:=dv[n]=Divisors[n]
    Do[m=0;Do[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,(Sqrt[8Prime[n]-7]-1)/2}];Print[n," ",m];Continue,{n,1,80}]

A241568 a(n) = |{0 < k < prime(n)/2: k is not only a quadratic nonresidue modulo prime(n) but also a Fibonacci number}|.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Apr 25 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 2. In other words, for any prime p > 3, there is a Fibonacci number among 1, ..., (p-1)/2 which is a quadratic nonresidue modulo p.
(ii) For any n > 2, there is a prime q < prime(n) such that the q-th Fibonacci number is a quadratic nonresidue modulo prime(n).
(iii) For any odd prime p, there is a Lucas number (i.e., a term of A000032) smaller than p which is a quadratic nonresidue modulo p.
We have checked part (i) for all primes p < 3*10^9, part (ii) for n up to 10^8, and part (iii) for the first 10^7 primes.
See also A241604 for a sequence related to part (i) of the conjecture.

Examples

			a(3) = 1 since F(3) = 2 is a quadratic nonresidue modulo prime(3) = 5, where F(n) denotes the n-th Fibonacci number.
a(4) = 1 since F(4) = 3 is a quadratic nonresidue modulo prime(4) = 7.
a(5) = 1 since F(3) = 2 is a quadratic nonresidue modulo prime(5) = 11.
a(9) = 1 since F(5) = 5 is a quadratic nonresidue modulo prime(9) = 23.
		

Crossrefs

Programs

  • Mathematica
    f[k_]:=Fibonacci[k]
    Do[m=0;Do[If[f[k]>Prime[n]/2,Goto[aa]];If[JacobiSymbol[f[k],Prime[n]]==-1,m=m+1];Continue,{k,2,(Prime[n]+1)/2}]; Label[aa];Print[n," ",m];Continue,{n,1,80}]

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}]

A242248 a(n) = |{0 < g < prime(n): g, 2^g - 1 and (g-1)! are all primitive roots modulo prime(n)}|.

Original entry on oeis.org

1, 0, 1, 1, 1, 1, 3, 1, 1, 2, 1, 2, 2, 1, 6, 2, 10, 3, 2, 3, 5, 2, 10, 12, 3, 6, 7, 15, 3, 9, 3, 8, 18, 5, 18, 3, 7, 7, 24, 20, 26, 4, 13, 10, 15, 5, 4, 3, 35, 5, 19, 19, 3, 19, 36, 37, 38, 5, 10, 15, 16, 34, 7, 16, 6, 36, 4, 4, 44, 14
Offset: 1

Views

Author

Zhi-Wei Sun, May 09 2014

Keywords

Comments

Conjecture: a(n) > 0 for all n > 2. In other words, for any prime p > 3, there exists a positive primitive root g < p modulo p such that 2^g - 1 and (g-1)! are also primitive roots modulo p.
We have verified this for all primes p with 3 < p < 10^6.

Examples

			a(4) = 1 since 5, 2^5 - 1 = 31 and (5-1)! = 24 are all primitive roots modulo prime(4) = 7.
a(6) = 1 since 11, 2^(11) - 1 = 2047 and (11-1)! = 3628800 are all primitive roots modulo prime(6) = 13. Note that both 2047 and 3628800 are congruent to 6 modulo 13.
a(14) = 1 since 34, 2^(34) - 1 and (34-1)! are all primititive roots modulo prime(14) = 43. Note that 2^(34) - 1 == 20 (mod 43) and 33! == -14 (mod 43).
		

Crossrefs

Programs

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

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}]

A237594 Number of primes p < prime(n)/2 such that the Bell number B(p) is a primitive root modulo prime(n).

Original entry on oeis.org

0, 0, 1, 1, 2, 1, 2, 3, 1, 1, 2, 4, 2, 4, 6, 5, 7, 3, 4, 3, 4, 2, 12, 7, 3, 5, 4, 9, 5, 6, 4, 5, 12, 6, 7, 5, 9, 6, 12, 11, 13, 7, 7, 7, 14, 5, 5, 14, 14, 8, 13, 11, 7, 10, 19, 17, 16, 8, 11, 7, 7, 23, 11, 12, 10, 22, 14, 8, 22, 11, 20, 22, 13, 13, 15, 24, 27, 14, 18, 18
Offset: 1

Views

Author

Zhi-Wei Sun, Apr 22 2014

Keywords

Comments

Conjecture: a(n) > 0 for all n > 2. In other words, for any prime p > 3, there exists a prime q < p/2 such that the Bell number B(q) is a primitive root modulo p.

Examples

			a(9) = 1 since 3 is a prime smaller than prime(9)/2 = 23/2 and B(3) = 5 is a primitive root modulo prime(9) = 23.
		

Crossrefs

Programs

  • Mathematica
    f[k_]:=BellB[Prime[k]]
    dv[n_]:=Divisors[n]
    Do[m=0;Do[If[Mod[f[k],Prime[n]]==0,Goto[aa],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,PrimePi[(Prime[n]-1)/2]}];Print[n," ",m];Continue,{n,1,80}]
Showing 1-10 of 12 results. Next