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.

A266986 The indices of primes p for which the average of the primitive roots equals p/2.

Original entry on oeis.org

1, 3, 6, 7, 8, 10, 12, 13, 16, 18, 21, 24, 25, 26, 29, 30, 33, 35, 37, 40, 42, 44, 45, 50, 51, 53, 55, 57, 59, 60, 62, 63, 65, 66, 68, 70, 71, 74, 77, 78, 79, 80, 82, 84, 87, 88, 89, 97, 98, 100, 102, 104, 106, 108, 110, 112, 113, 116, 119, 121, 122, 123, 126, 127, 130, 134, 135, 136, 137, 139, 140, 142, 145
Offset: 1

Views

Author

Dimitri Papadopoulos, Jan 08 2016

Keywords

Comments

The average of the primitive roots of a prime p are <,=, or > p/2 (observation).
The indices of all primes p==1(mod 4) are in this sequence since for primes of form 4k+1 b a primitive root implies -b a primitive root.
The indices of some primes p==3 (mod 4) are also in this sequence although for most such primes the average of the primitive roots is <> p/2.(observation)

Examples

			p(a(1))=p(1)=2. 2 has the primitive root 1. The average primitive root is 1 and 1=2/2.
p(a(2))=p(3)=5. The primitive roots of 5 are 2 and 3. Their average equals (2+3)/phi(4)=5/2=p/2.
		

Crossrefs

Programs

  • Mathematica
    A = Table[Total[Flatten[Position[Table[MultiplicativeOrder[i, Prime[k]], {i, Prime[k] - 1}],Prime[k] - 1]]]/(EulerPhi[Prime[k] - 1] Prime[k]/2), {k, 1, 1000}]; Flatten[Position[A, _?(# == 1 &)]]

A266989 Primes for which the average of the primitive roots is < p/2.

Original entry on oeis.org

31, 43, 67, 223, 379, 491, 619, 631, 643, 683, 859, 883, 907, 1051, 1091, 1423, 1747, 1987, 2143, 2347, 2371, 2467, 2531, 2767, 3307, 3643, 3691, 3739, 3823, 3931, 4019, 4219, 4519, 4691, 4987, 5059, 5107, 5347, 5683, 5827, 6043
Offset: 1

Views

Author

Dimitri Papadopoulos, Jan 08 2016

Keywords

Comments

These primes are congruent to 3 (mod 4).

Examples

			a(1)=31. The primitive roots of 31 are 3, 11, 12, 13, 17, 21, 22, and 24.
Their average is (3+11+12+13+17+21+22+24)/phi(30)=123/8<31/2.
		

Crossrefs

Programs

  • Maple
    f:= proc(p) local g;
      if not isprime(p) then return false fi;
      g:= numtheory[primroot](p);
      evalb(add(g&^i mod p, i = select(t->igcd(t,p-1)=1, [$1..p-2]))
         < p/2 * numtheory:-phi(p-1))
    end proc:
    select(f, [seq(i,i=3..10000,4)]); # Robert Israel, Feb 09 2016
  • Mathematica
    A = Table[Total[Flatten[Position[Table[MultiplicativeOrder[i, Prime[k]], {i, Prime[k] - 1}],Prime[k] - 1]]]/(EulerPhi[Prime[k] - 1] Prime[k]/2), {k, 1,100}]; Prime[Flatten[Position[A, _?(# < 1 &)]]]
  • PARI
    ar(p) = my(r, pr, j); r=vector(eulerphi(p-1)); pr=znprimroot(p); for(i=1, p-1, if(gcd(i, p-1)==1, r[j++]=lift(pr^i))); vecsort(r) ;
    isok(p) = my(vr = ar(p)); vecsum(vr)/#vr < p/2;
    lista(nn) = forprime(p=2, nn, if (isok(p), print1(p, ", "))); \\ Michel Marcus, Feb 09 2016

Formula

a(n) = prime(A266988(n)).

A267010 Primes of the form p==3 (mod 4) such that the average of their primitive roots equals p/2.

Original entry on oeis.org

19, 307, 1451, 2179, 2251, 2683, 2843, 3259, 3907, 4447, 11863, 12907, 17623, 30763, 37963, 51059, 52543, 86131, 92467, 104851, 129763, 131203, 146683, 150151, 156151, 156703, 162523, 163819, 174007, 245899, 263827, 287731, 348643, 353611, 400123, 412831, 423091, 432587
Offset: 1

Views

Author

Dimitri Papadopoulos, Jan 08 2016

Keywords

Comments

Most primes for which the average of the primitive roots=p/2 are of the form p==1(mod 4). Much rarer for primes of form p==3(mod 4) to have this property. (Observation)

Examples

			19 is a term because the primitive roots of 19 are 2, 3, 10, 13, 14, and 15. Their average is (2+3+10+13+14+15)/phi(18)=57/phi(18)=57/6=19/2.
		

Crossrefs

Cf. A060749. Intersection of A002145 and A266987.

Programs

  • Maple
    isA267010 := proc(n)
        if isprime(n) and modp(n,4) = 3 then
            isA266987(n) ;
        else
            false;
        end if;
    end proc: # R. J. Mathar, Aug 14 2024
  • Mathematica
    f[n_] := If[Total[Flatten[Position[Table[MultiplicativeOrder[i, Prime[n]], {i, Prime[n] - 1}],    Prime[n] - 1]]] == EulerPhi[Prime[n] - 1]*Prime[n]/2, 1, 0];
    For[k = 1, k < 10000, k++, If[f[k] == 1 && Mod[Prime[k], 4] == 3, Print[k, "  ", Prime[k]]]]
    Select[4*Range[1000] + 3, PrimeQ[#] && Mean[PrimitiveRootList[#]] == #/2 &] (* Amiram Eldar, Oct 11 2021 *)
  • PARI
    vr(p) = j=0; r=vector(eulerphi(p-1)); pr=znprimroot(p); for(i=1, p-1, if(gcd(i, p-1)==1, r[j++]=lift(pr^i))); r; \\ after A060749
    isok(p) = ((p % 4 == 3) && (vpr = vr(p)) && (vecsum(vpr) == #vpr*p/2)); \\ Michel Marcus, Jan 09 2016

Extensions

a(16)-a(38) from Michel Marcus, Jan 09 2016
Showing 1-3 of 3 results.