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 13 results. Next

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

Original entry on oeis.org

1, 2, 2, 5, 2, 2, 5, 2, 5, 2, 17, 2, 17, 5, 5, 2, 2, 2, 2, 65, 5, 37, 2, 26, 5, 2, 5, 2, 10, 5, 65, 2, 5, 2, 2, 82, 5, 2, 5, 2, 2, 2, 101, 5, 2, 170, 2, 5, 2, 10, 5, 26, 37, 26, 5, 5, 2, 26, 5, 26, 5, 2, 5, 17, 10, 2, 37, 10, 2, 2, 5, 26, 10, 2, 2, 5, 2, 5, 17, 26
Offset: 1

Views

Author

Zhi-Wei Sun, Apr 23 2014

Keywords

Comments

According to the conjecture in A239957, a(n) should be always positive.

Examples

			a(4) = 5 since 2^2 + 1 = 5 is a primitive root modulo prime(4) = 7, but neither 0^1 + 1 = 1 nor 1^1 + 1 = 2 is a primitive root modulo prime(4) = 7.
		

Crossrefs

Programs

  • Mathematica
    f[k_]:=k^2+1
    dv[n_]:=Divisors[n]
    Do[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}];Print[n," ",k^2+1];Goto[bb];Label[aa];Continue,{k,0,Sqrt[Prime[n]-2]}];Print[n," ",0];Label[bb];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));for(k=0,sqrtint(p-2),if(ispr(k^2+1,p), return(k^2+1)));0 \\ Charles R Greathouse IV, May 01 2014

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

A241504 a(n) = |{0 < g < prime(n): g is not only a primitive root modulo prime(n) but also a partition number given by A000041}|.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Apr 24 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 0. In other words, any prime p has a primitive root g < p which is also a partition number.
(ii) Any prime p > 3 has a primitive root g < p which is also a strict partition number (i.e., a term of A000009).
We have checked part (i) for all primes p < 2*10^7, and part (ii) for all primes p < 5*10^6. See also A241516.

Examples

			a(92) = 1 since p(13) = 101 is a primitive root modulo prime(92) = 479, where p(.) is the partition function (A000041).
a(493) = 1 since p(20) = 627 is a primitive root modulo prime(493) = 3529.
a(541) = 1 since p(20) = 627 is a primitive root modulo prime(541) = 3911.
a(1146) = 1 since p(27) = 3010 is a primitive root modulo prime(1146) = 9241.
a(1951) = 1 since p(35) = 14883 is a primitive root modulo prime(1951) = 16921.
a(2380) = 1 since p(36) = 17977 is a primitive root modulo prime(2380) = 21169.
a(5629) = 1 since p(20) = 627 is a primitive root modulo prime(5629) = 55441.
		

Crossrefs

Programs

  • Mathematica
    f[k_]:=PartitionsP[k]
    dv[n_]:=Divisors[n]
    Do[m=0;Do[If[f[k]>Prime[n]-1,Goto[bb]];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,Prime[n]-1}];Label[bb];Print[n," ",m];Continue,{n,1,80}]

A241516 Least positive primitive root g < prime(n) modulo prime(n) which is also a partition number given by A000041, or 0 if such a number g does not exist.

Original entry on oeis.org

1, 2, 2, 3, 2, 2, 3, 2, 5, 2, 3, 2, 7, 3, 5, 2, 2, 2, 2, 7, 5, 3, 2, 3, 5, 2, 5, 2, 11, 3, 3, 2, 3, 2, 2, 7, 5, 2, 5, 2, 2, 2, 22, 5, 2, 3, 2, 3, 2, 7, 3, 7, 7, 11, 3, 5, 2, 15, 5, 3, 3, 2, 5, 22, 15, 2, 3, 15, 2, 2, 3, 7, 11, 2, 2, 5, 2, 5, 3, 22
Offset: 1

Views

Author

Zhi-Wei Sun, Apr 24 2014

Keywords

Comments

According to the conjecture in A241504, a(n) should be always positive.

Examples

			a(4) = 3 since 3 = A000041(3) is a primitive root modulo prime(4) = 7, but neither 1 = A000041(1) nor 2 = A000041(2) is.
		

Crossrefs

Programs

  • Mathematica
    f[k_]:=PartitionsP[k]
    dv[n_]:=Divisors[n]
    Do[Do[If[f[k]>Prime[n]-1,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}];Print[n," ",PartitionsP[k]];Goto[bb];Label[aa];Continue,{k,1,Prime[n]-1}];Label[cc];Print[Prime[n]," ",0];Label[bb];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}]

A241492 a(n) = |{0 < g < prime(n): g is a primitive root modulo prime(n) and g is a product of two consecutive integers}|.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Apr 23 2014

Keywords

Comments

Conjecture: a(n) > 0 for all n > 4. In other words, any prime p > 7 has a primitive root g < p of the form k*(k+1).
We have verified this for all n = 5, ..., 2*10^5.
See also A239957 and A239963 for similar conjectures. Clearly, for any prime p > 3, one of the three numbers 1*2, 2*3, 3*4 is a quadratic residue modulo p.

Examples

			a(9) = 1 since 4*5 = 20 is a primitive root modulo prime(9) = 23.
a(10) = 1 since 1*2 = 2 is a primitive root modulo prime(10) = 29.
a(11) = 1 since 3*4 = 12 is a primitive root modulo prime(11) = 31.
		

Crossrefs

Programs

  • Mathematica
    f[k_]:=f[k]=k(k+1)
    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[4*Prime[n]-3]-1)/2}];Print[n," ",m];Continue,{n,1,80}]

A305030 Number of pairs {k, m} with 0 <= k <= m such that binomial(2k,k) + binomial(2m,m) is not only a primitive root modulo prime(n) but also smaller than prime(n).

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, May 24 2018

Keywords

Comments

Conjecture 1: a(n) > 0 for all n > 1. In other words, any odd prime p has a primitive root g < p which is the sum of two central binomial coefficients.
Conjecture 2: Each odd prime p has a primitive root g < p which is the sum of two Catalan numbers.
We have verified Conjecture 1 for all odd primes p < 10^9.

Examples

			a(2) = 1 with binomial(2*0,0) + binomial(2*0,0) = 2 a primitive root modulo prime(2) = 3.
a(3) = 2 with binomial(2*0,0) + binomial(2*0,0) = 2 and binomial(2*0,0) + binomial(2*1,1) = 3 primitive roots modulo prime(3) = 5.
a(4) = 1 with binomial(2*0,0) + binomial(2*1,1) = 3 a primitive root modulo prime(4) = 7.
a(29) = 2 with binomial(2*3,3) + binomial(2*3,3) = 40 and binomial(2*1,1) + binomial(2*4,4) = 72 primitive roots modulo prime(29) = 109.
		

Crossrefs

Programs

  • Mathematica
    p[n_]:=p[n]=Prime[n];
    Dv[n_]:=Dv[n]=Divisors[n];
    gp[g_,p_]:=gp[g,p]=Mod[g,p]>0&&Sum[Boole[PowerMod[g,Dv[p-1][[k]],p]==1],{k,1,Length[Dv[p-1]]-1}]==0;
    tab={};Do[r=0;a=0;Label[aa];If[Binomial[2a,a]>=p[n],Goto[cc]];b=0;Label[bb];If[b>a||Binomial[2b,b]>=p[n]-Binomial[2a,a],a=a+1;Goto[aa]];
    If[gp[Binomial[2a,a]+Binomial[2b,b],p[n]],r=r+1];b=b+1;Goto[bb];Label[cc];tab=Append[tab,r],{n,1,90}];Print[tab]

A241472 a(n) = |{0 < k < sqrt(prime(n)): k^2 + 1 is a quadratic residue modulo prime(n)}|.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Apr 23 2014

Keywords

Comments

a(n) > 0 for all n > 3. In fact, for any prime p > 5 one of 1^2 + 1 = 2, 2^2 + 1 = 5 and 3^2 + 1 = 10 is a quadratic residue modulo p. Similarly, if p > 7 is a prime not equal to 19, then k^2 - 1 is a quadratic residue modulo p for some positive integer k < sqrt(p). In fact, for any prime p > 7, one of 2^2 - 1 = 3, 3^2 - 1 = 8 and 5^2 - 1 = 24 is a quadratic residue modulo p.
See also A239957 for a similar conjecture involving primitive roots modulo primes. Note that a primitive root modulo an odd prime p must be a quadratic nonresidue modulo p.

Examples

			a(6) = 1 since 3^2 + 1 = 10 is a quadratic residue modulo prime(6) = 13.
a(7) = 1 since 1^2 + 1 = 2 is a quadratic residue modulo prime(7) = 17.
a(9) = 1 since 1^2 + 1 = 2 is a quadratic residue modulo prime(9) = 23.
a(10) = 1 since 2^2 + 1 = 5 is a quadratic residue modulo prime(10) = 29.
a(18) = 1 since 2^2 + 1 = 5 is a quadratic residue modulo prime(18) = 61.
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=Sum[If[JacobiSymbol[k^2+1,Prime[n]]==1,1,0],{k,1,Sqrt[Prime[n]-1]}]
    Table[a[n],{n,1,80}]

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

A305048 Number of ordered pairs (k, m) of nonnegative integers such that 5^k + 10^m is not only a primitive root modulo prime(n) but also smaller than prime(n).

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, May 24 2018

Keywords

Comments

Conjecture: a(n) > 0 for all n > 4. In other words, any prime p > 7 has a primitive root g < p of the form 5^k + 10^m with k and m nonnegative integers.
We have verified this for any prime p > 7 not exceeding 10^9.
It seems that a(n) = 1 only for n = 2, 3, 11, 14, 53, 63, 64, 82, 99, 101, 111, 129, 344, 369, 391, 795, 1170, 1587, 5629, 5718, 6613, 430516.
See also A305048 for similar conjectures.

Examples

			a(14) = 1 with 5^2 + 10^0 = 26 a primitive root modulo prime(14) = 43.
a(101) = 1 with 5^0 + 10^0 = 2 a primitive root modulo prime(101) = 547.
a(111) = 1 with 5^2 + 10 = 35 a primitive root modulo prime(111) = 607.
a(5718) = 1 with 5^0 + 10^3 = 1001 a primitive root modulo prime(5718) = 56401.
a(6613) = 1 with 5^1 + 10^3 = 1005 a primitive root modulo prime(6613) = 66301.
a(430516) = 1 with 5^5 + 10^1 = 3135 a primitive root modulo prime(430516) = 6276271.
		

Crossrefs

Programs

  • Mathematica
    p[n_]:=p[n]=Prime[n];
    Dv[n_]:=Dv[n]=Divisors[n];
    gp[g_,p_]:=gp[g,p]=Mod[g,p]>0&&Sum[Boole[PowerMod[g,Dv[p-1][[k]],p]==1],{k,1,Length[Dv[p-1]]-1}]==0;
    tab={};Do[r=0;Do[If[gp[5^a+10^b,p[n]],r=r+1],{a,0,Log[5,p[n]-1]},{b,0,Log[10,p[n]-5^a]}];tab=Append[tab,r],{n,1,90}];Print[tab]
Showing 1-10 of 13 results. Next