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-2 of 2 results.

A118818 Primes p for which there are more primitive roots below p/2 than above p/2.

Original entry on oeis.org

223, 379, 463, 631, 691, 883, 907, 1051, 1423, 1447, 1543, 1723, 1747, 1783, 1987, 2143, 2179, 2347, 2467, 2591, 2767, 3259, 3307, 3511, 3631, 3691, 3739, 3823, 3907, 4219, 4447, 4507, 4519, 4639, 4987, 5023, 5107, 5119, 5347, 5683, 5923
Offset: 1

Views

Author

Don Reble, Apr 20 2007

Keywords

Comments

All terms are of the form 4*m + 3 (see A172480 and A172490). - Emmanuel Vantieghem, Nov 07 2016

Examples

			223 is a term because it has 38 primitive roots below 111.5, but 34 above 111.5.
		

Crossrefs

Programs

A172480 Odd primes p such that there are as many primitive roots (mod p) in the interval [0,p/2] as in the interval [p/2,p].

Original entry on oeis.org

5, 7, 13, 17, 29, 31, 37, 41, 43, 53, 61, 67, 73, 89, 97, 101, 109, 113, 137, 149, 157, 173, 181, 193, 197, 229, 233, 241, 257, 269, 277, 281, 293, 307, 313, 317, 337, 349, 353, 367, 373, 389, 397, 401, 409, 421, 433, 449, 457, 461, 487, 509, 521, 541, 557, 569
Offset: 1

Views

Author

Emmanuel Vantieghem, Feb 04 2010

Keywords

Comments

The sequence contains all the primes of the form 4m+1 (A002144).
The sequence also contains some primes of the form 4m+3 (see them in A172490).

Crossrefs

A002144 is a subsequence.

Programs

  • Maple
    filter:= proc(p) local m; uses NumberTheory;
      if not isprime(p) then return false fi;
      if p mod 4 = 1 then return true fi;
      m:= Totient(Totient(p))/2;
      PrimitiveRoot(p,ith=m+1)=PrimitiveRoot(p,greaterthan=floor(p/2))
    end proc:
    select(filter, [seq(i,i=5..1000,2)]); # Robert Israel, Nov 23 2019
  • Mathematica
    << NumberTheory`NumberTheoryFunctions` m = 2; s = {}; While[m < 10000, m++; p = Prime[m]; If[Mod[p, 4] == 1, s = {s, p}, q = (p - 1)/2; g = PrimitiveRoot[p]; se = Select[Range[p - 1], GCD[ #, p - 1] == 1 &]; e = Length[se]; j = 0; t = 0; While[j < e, j++; h = PowerMod[g, se[[j]], p]; If[h <= q, t = t + 1,] ]; If[e == 2t, s = {s, p},] ] ]; s = Flatten[s]
Showing 1-2 of 2 results.