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 10 results.

A242750 Positive integers n with property that n is a primitive root modulo prime(n).

Original entry on oeis.org

1, 2, 3, 6, 7, 10, 11, 13, 15, 18, 24, 26, 28, 33, 39, 41, 44, 45, 48, 50, 54, 55, 56, 58, 62, 65, 68, 69, 71, 75, 79, 83, 85, 93, 95, 107, 108, 109, 110, 117, 118, 119, 120, 123, 126, 129, 130, 131, 133, 139, 142, 143, 145, 148, 157, 158, 160, 163, 164, 166, 170, 172, 173, 174, 179, 182, 186, 190, 191, 195
Offset: 1

Views

Author

Zhi-Wei Sun, May 21 2014

Keywords

Comments

According to the conjecture in A242748, this sequence should have infinitely many terms.

Examples

			6 is a member since 6 is a primitive root modulo prime(6) = 13, but 4 and 5 are not since 4 is not a primitive root modulo prime(4) = 7 and 5 is not a primitive root modulo prime(5) = 11.
		

Crossrefs

Programs

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

A242752 Primes p such that pi(p) is a primitive root modulo p, where pi(p) is the number of primes not exceeding p.

Original entry on oeis.org

2, 3, 5, 13, 17, 29, 31, 41, 47, 61, 89, 101, 107, 137, 167, 179, 193, 197, 223, 229, 251, 257, 263, 271, 293, 313, 337, 347, 353, 379, 401, 431, 439, 487, 499, 587, 593, 599, 601, 643, 647, 653, 659, 677, 701, 727, 733, 739, 751, 797, 821, 823, 829, 857, 919, 929, 941, 967, 971, 983
Offset: 1

Views

Author

Zhi-Wei Sun, May 21 2014

Keywords

Comments

According to the conjecture in A232748, this sequence should contain infinitely many primes.

Examples

			a(3) = 5 since 5 is prime with pi(5) = 3 a primitive root modulo 5.
		

Crossrefs

Programs

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

A242753 Number of ordered ways to write n = k + m with 0 < k <= m such that the inverse of k mod prime(k) among 1, ..., prime(k) - 1 is prime and the inverse of m mod prime(m) among 1, ..., prime(m) - 1 is also prime.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, May 22 2014

Keywords

Comments

Conjecture: a(n) > 0 for all n > 3.
This implies that there are infinitely many positive integers k such that k*q == 1 (mod prime(k)) for some prime q < prime(k).

Examples

			a(11) = 1 since 11 = 4 + 7, 4*2 == 1 (mod prime(4)=7) with 2 prime, and 7*5 == 1 (mod Prime(7)=17) with 5 prime.
a(36) = 1 since 36 = 18 + 18, and 18*17 == 1 (mod 61) with 17 prime.
a(46) = 1 since 46 = 6 + 40, 6*11 == 1 (mod prime(6)= 13) with 11 prime, and 40*13 == 1 (mod prime(40)=173) with 13 prime.
		

Crossrefs

Programs

  • Mathematica
    p[n_]:=PrimeQ[PowerMod[n,-1,Prime[n]]]
    Do[m=0;Do[If[p[k]&&p[n-k],m=m+1],{k,1,n/2}];Print[n," ",m];Continue,{n,1,80}]

A243164 Number of primes p < n such that p*n is a primitive root modulo prime(n).

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, May 31 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 6.
(ii) Any integer n > 6 can be written as k + m with k > 0 and m > 0 such that k*m is a primitive root modulo prime(n).
We have verified part (i) for all n = 7, ..., 2*10^5.

Examples

			a(4) = 1 since 3 is prime with 3*4 = 12 a primitive root modulo prime(4) = 7.
a(9) = 1 since 7 is prime with 7*9 = 63 a primitive root modulo prime(9) = 23.
a(10) = 1 since 5 is prime with 5*10 = 50 a primitive root modulo prime(10) = 29.
a(12) = 1 since 2 is prime with 2*12 = 24 a primitive root modulo prime(12) = 37.
		

Crossrefs

Programs

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

A242754 Positive integers k such that k*p == 1 (mod prime(k)) for some prime p < prime(k).

Original entry on oeis.org

2, 3, 4, 6, 7, 10, 11, 13, 17, 18, 21, 31, 37, 40, 41, 46, 48, 49, 52, 53, 58, 60, 64, 66, 70, 71, 72, 73, 75, 81, 85, 92, 93, 96, 100, 102, 109, 117, 119, 127, 136, 137, 140, 143, 145, 146, 149, 160, 162, 179, 189, 194, 200, 206, 215, 232, 233, 243, 246, 247
Offset: 1

Views

Author

Zhi-Wei Sun, May 22 2014

Keywords

Comments

According to the conjecture in A242753, this sequence should have infinitely many terms.
Conjecture: The number of terms not exceeding x > 1 has the main term x/(log x) as x tends to infinity.

Examples

			a(4) = 6 since 6*11 == 1 (mod prime(6)=13) with 11 prime, but 5*9 == 1 (mod prime(5)=11) with 9 composite.
		

Crossrefs

Programs

  • Mathematica
    p[n_]:=PrimeQ[PowerMod[n,-1,Prime[n]]]
    n=0;Do[If[p[k],n=n+1;Print[n," ",k]];Continue,{k,1,247}]

A242755 Primes p such that pi(p)*q == 1 (mod p) for some prime q < p, where pi(p) is the number of primes not exceeding p.

Original entry on oeis.org

3, 5, 7, 13, 17, 29, 31, 41, 59, 61, 73, 127, 157, 173, 179, 199, 223, 227, 239, 241, 271, 281, 311, 317, 349, 353, 359, 367, 379, 419, 439, 479, 487, 503, 541, 557, 599, 643, 653, 709, 769, 773, 809, 823, 829, 839, 859, 941, 953, 1063
Offset: 1

Views

Author

Zhi-Wei Sun, May 22 2014

Keywords

Comments

According to the conjecture in A242753, this sequence should contain infinitely many primes.
Conjecture: The number of such primes not exceeding x > 1 has the main term x/(log x)^2 as x tends to infinity.

Examples

			a(4) = 13 since 13 is prime with pi(13) = 6, and 6*11 == 1 (mod 13) with 11 prime, but pi(11)*9 == 1 (mod 11) with 9 not prime.
		

Crossrefs

Programs

  • Mathematica
    p[n_]:=PrimeQ[PowerMod[n,-1,Prime[n]]]
    n=0;Do[If[p[k],n=n+1;Print[n," ",Prime[k]]];Continue,{k,1,179}]

A242950 Number of ordered ways to write n = k + m with k > 1 and m > 1 such that the least nonnegative residue of prime(k) modulo k is a square and the least nonnegative residue of prime(m) modulo m is a prime.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, May 27 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 7.
(ii) Any integer n > 9 can be written as k + m with k > 1 and m > 1 such that the least nonnegative residue of prime(k) modulo k and the least nonnegative residue of prime(m) modulo m are both prime.
We have verified a(n) > 0 for all n = 8, ..., 10^8.

Examples

			a(11) = 1 since 11 = 2 + 9, prime(2) = 3 == 1^2 (mod 2), and prime(9) = 23 == 5 (mod 9) with 5 prime.
a(16) = 1 since 16 = 12 + 4, prime(12) = 37 == 1^2 (mod 12), and prime(4) = 7 == 3 (mod 4) with 3 prime.
		

Crossrefs

Programs

  • Mathematica
    SQ[n_]:=IntegerQ[Sqrt[n]]
    s[k_]:=SQ[Mod[Prime[k],k]]
    p[k_]:=PrimeQ[Mod[Prime[k],k]]
    a[n_]:=Sum[Boole[s[k]&&p[n-k]],{k,2,n-2}]
    Table[a[n],{n,1,80}]

A242879 Least positive integer k < n such that k*p == 1 (mod prime(k)) for some prime p < prime(k) and (n-k)*q == 1 (mod prime(n-k)) for some prime q < prime(n-k), or 0 if such a number k does not exist.

Original entry on oeis.org

0, 0, 0, 2, 2, 2, 3, 2, 2, 3, 4, 2, 2, 3, 2, 3, 4, 7, 2, 2, 3, 4, 2, 3, 4, 13, 6, 7, 11, 13, 10, 11, 2, 3, 4, 18, 6, 7, 2, 3, 4, 2, 2, 3, 4, 6, 6, 2, 3, 2, 2, 3, 4, 2, 2, 3, 4, 6, 6, 2, 3, 2, 3, 4, 7, 2, 3, 2, 3, 4, 7, 2, 2, 2, 2, 3, 2, 3, 4, 7
Offset: 1

Views

Author

Zhi-Wei Sun, May 25 2014

Keywords

Comments

According to the conjecture in A242753, a(n) should be positive for all n > 3.
We have verified that a(n) > 0 for all n = 4, ..., 10^8.

Examples

			a(4) = 2 since 4 = 2 + 2 and 2*2 == 1 (mod prime(2)=3).
a(7) = 3 since 7 = 3 + 4, 3*2 == 1 (mod prime(3)=5) with 2 prime, and also 4*2 == 1 (mod prime(4)=7) with 2 prime, but 5*9 == 1 (mod prime(5)=11) with 9 not prime.
		

Crossrefs

Programs

  • Mathematica
    p[n_]:=PrimeQ[PowerMod[n,-1,Prime[n]]]
    Do[Do[If[p[k]&&p[n-k],Print[n," ",k];Goto[aa]];Continue,{k,1,n/2}];Print[n," ",0];Label[aa];Continue,{n,1,80}]

A261387 Number of ways to write n = k + m with 0 < k < m < n such that prime(k) is a primitive root modulo prime(m) and also prime(m) is a primitive root modulo prime(k).

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Aug 27 2015

Keywords

Comments

Conjecture: (i) a(n) > 0 except for n = 1, 2, 8.
(ii) Any positive rational number r not equal to 1 can be written as m/n, where m and n are positive integers such that prime(m) is a primitive root modulo prime(n) and also prime(n) is a primitive root modulo prime(m).

Examples

			a(7) = 2 since 7 = 1+6 = 3+4, prime(1) = 2 is a primitive root modulo prime(6) = 13 and 13 is a primitive root modulo 2, also prime(3) = 5 is a primitive root modulo prime(4) = 7 and 7 is a primitive root modulo 5.
a(22) = 1 since 22 = 4+18, prime(4)= 7 is a primitive root modulo prime(18) = 61 and 61 is a primitive root modulo 7.
		

Crossrefs

Programs

  • Mathematica
    f[n_]:=Prime[n]
    Dv[n_]:=Divisors[n]
    LL[n_]:=Length[Dv[n]]
    Do[r=0;Do[Do[If[Mod[f[k]^(Part[Dv[f[n-k]-1],i])-1,f[n-k]]==0,Goto[bb]],{i,1,LL[f[n-k]-1]-1}];Do[If[Mod[f[n-k]^(Part[Dv[f[k]-1],i])-1,f[k]]==0,Goto[bb]],{i,1,LL[f[k]-1]-1}];
    r=r+1;Label[bb];Continue,{k,1,(n-1)/2}];Print[n," ",r];Continue,{n,1,70}]

A293213 Primes p with phi(p-1) a primitive root modulo p, where phi(.) is Euler's totient function (A000010).

Original entry on oeis.org

2, 5, 23, 43, 47, 67, 101, 149, 167, 211, 229, 263, 269, 281, 349, 353, 359, 383, 389, 421, 431, 449, 461, 479, 499, 503, 509, 521, 661, 691, 709, 719, 739, 743, 829, 839, 859, 863, 883, 887, 907, 941, 953, 971, 983, 991, 1031, 1087, 1103, 1109, 1163, 1181, 1229, 1237, 1279, 1291, 1319, 1327, 1367, 1373
Offset: 1

Views

Author

Zhi-Wei Sun, Oct 02 2017

Keywords

Comments

It is well known that for any prime p the number of distinct primitive roots modulo p among 1,...,p-1 is phi(p-1).
Conjecture: The sequence contains infinitely many terms. Moreover, the number of primes p <= x with phi(p-1) a primitive root modulo p is asymptotically equivalent to c*x/(log x) as x tends to the infinity, where c is a constant with 0.36 < c < 0.37.

Examples

			a(2) = 5 since phi(5-1) = 2 is a primitive root modulo the prime 5.
		

Crossrefs

Programs

  • Mathematica
    p[n_]:=p[n]=Prime[n];
    n=0;Do[Do[If[Mod[EulerPhi[p[k]-1]^(Part[Divisors[p[k]-1],i])-1,p[k]]==0,Goto[aa]],{i,1,Length[Divisors[p[k]-1]]-1}];
    n=n+1;Print[n," ",p[k]];Label[aa],{k,1,220}]
Showing 1-10 of 10 results.