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.

Previous Showing 11-20 of 44 results. Next

A266987 Primes p for which the average of the primitive roots equals p/2.

Original entry on oeis.org

2, 5, 13, 17, 19, 29, 37, 41, 53, 61, 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, 373, 389, 397, 401, 409, 421, 433, 449
Offset: 1

Views

Author

Dimitri Papadopoulos, Jan 08 2016

Keywords

Comments

From Robert Israel, Feb 01 2016: (Start)
Union of A002144 and A267010.
Contains A002144 because for each of these primes, x is a primitive root iff p-x is a primitive root. (End)

Examples

			a(13) = 13 since the primitive roots of 13 are 2, 6, 7, and 11 and the average of these primitive roots is (2+6+7+11)/phi(12) = 26/4 = 13/2.
		

Crossrefs

Programs

  • Maple
    proots := proc(n)
        local r,eulphi,m;
        if n = 1 then
            return {0} ;
        end if;
        eulphi := numtheory[phi](n) ;
        r := {} ;
        for m from 0 to n-1 do
            if numtheory[order](m,n) = eulphi then
                r := r union {m} ;
            end if;
        end do:
        return r;
    end proc:
    isA266987 := proc(n)
        local r;
        if isprime(n) then
            r := convert(proots(n),list) ;
            2*add(pr, pr=r)  = n*nops(r) ;
        else
            false;
        end if;
    end proc:
    for n from 1 to 500 do
        if isA266987(n) then
            printf("%d,",n);
        end if;
    end do: # R. J. Mathar, Jan 12 2016
    Filter:= proc(p) local x, s,js;
      if p mod 4 = 1 then return true fi;
      x:= numtheory:-primroot(p);
      js:= select(t -> igcd(t,p-1)=1, [$1..p-2]);
      s:= add(x&^ j mod p, j=js);
      evalb(s = p/2 * nops(js))
    end proc:
    select(Filter, [seq(ithprime(i),i=1..1000)]); # Robert Israel, Feb 01 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 &)]]]
    (* second program (version >= 10): *)
    Select[Prime[Range[100]], Mean[PrimitiveRootList[#]] == #/2&] (* Jean-François Alcover, Jan 12 2016 *)

Formula

a(n) = prime(A266986(n)).

A286714 Difference phi(p-1) - phi(p+1) for lesser of twin primes.

Original entry on oeis.org

-1, 0, 0, 2, 4, 4, 12, 0, 8, 16, 20, 32, 40, 8, 24, 40, 32, 60, 4, 24, 60, 84, 24, 56, 24, 136, 104, 36, 44, 116, 184, 48, 84, 184, 68, 252, 72, 280, 68, 144, 56, 292, 140, 192, 120, 338, 276, 120, 144, 262, 192, 376, 120, 268, 192, 236, 64, 168, 240, 492, 348, 388
Offset: 1

Views

Author

Michel Marcus, May 13 2017

Keywords

Crossrefs

Programs

  • Mathematica
    (EulerPhi[#-1] - EulerPhi[#+1]) &@ Select[Prime@ Range@ 310, PrimeQ[# + 2] &] (* Giovanni Resta, May 13 2017 *)
  • PARI
    lista(nn) = forprime(p=2, nn, if (isprime(p+2), print1(eulerphi(p-1)-eulerphi(p+1), ", ")));

A286715 Lesser of twin primes for which phi(p-1) < phi(p+1).

Original entry on oeis.org

3, 2381, 3851, 14561, 17291, 20021, 20231, 26951, 34511, 41231, 47741, 50051, 52361, 55931, 57191, 65171, 67211, 67271, 70841, 82811, 87011, 98561, 101501, 101531, 108461, 117041, 119771, 126491, 129221, 134681, 136991, 142871, 145601, 150221, 156941, 165551, 166601
Offset: 1

Views

Author

Michel Marcus, May 13 2017

Keywords

Crossrefs

Programs

  • Mathematica
    s = {}; p = 3; Do[q = NextPrime[p]; If[q - p != 2, p = q; Continue[]]; If[EulerPhi[p + 1] > EulerPhi[p - 1], AppendTo[s, p]]; p = q, {15500}]; s (* Amiram Eldar, Sep 11 2019 *)
  • PARI
    lista(nn) = forprime(p=2, nn, if (isprime(p+2) && (eulerphi(p-1) < eulerphi(p+1)), print1(p, ", ")));

A104039 Number of primitive roots modulo prime(n)^2, where prime(n) is n-th prime.

Original entry on oeis.org

1, 2, 8, 12, 40, 48, 128, 108, 220, 336, 240, 432, 640, 504, 1012, 1248, 1624, 960, 1320, 1680, 1728, 1872, 3280, 3520, 3072, 4000, 3264, 5512, 3888, 5376, 4536, 6240, 8704, 6072, 10656, 6000, 7488, 8748, 13612, 14448, 15664, 8640, 13680, 12288, 16464
Offset: 1

Views

Author

Lekraj Beedassy, Mar 31 2005

Keywords

References

  • I. Niven, H. S. Zuckerman & H. L. Montgomery, An Introduction to the Theory of Numbers, 5th Ed., p. 102, John Wiley, NY, 1991.

Programs

  • Magma
    [(NthPrime(n)-1)*EulerPhi((NthPrime(n)-1)): n in [1..50]]; // Vincenzo Librandi, Aug 18 2017
  • Maple
    with(numtheory): for p from 1 to 100 do printf(`%d,`,(ithprime(p)-1)*phi(ithprime(p)-1)) od: # James Sellers, Apr 10 2005
  • Mathematica
    Table[(Prime[n] - 1) EulerPhi[(Prime[n] - 1)], {n, 50}] (* Vincenzo Librandi, Aug 18 2017 *)

Formula

a(n) = (prime(n) - 1)*phi((prime(n) - 1)) = A006093(n)*A000010(A006093(n)) = A006093(n)*A008330(n).

Extensions

More terms from James Sellers, Apr 10 2005

A121519 Number of primitive roots of prime A103203(n).

Original entry on oeis.org

1, 2, 4, 8, 10, 12, 16, 22, 24, 28, 40, 52, 64, 72, 82, 84, 88, 112, 128, 130, 132, 144, 156, 172, 178, 190, 192, 232, 238, 250, 252, 276, 280, 292, 324, 358, 384, 396, 400, 418, 424, 430, 442, 448, 480, 490, 508, 520, 544, 552, 592, 612, 640, 652, 658, 682, 712
Offset: 1

Views

Author

Klaus Brockhaus, Aug 06 2006

Keywords

Comments

Also records in A008330.

Examples

			Prime A103203(5) = 23 has 10 primitive roots, so a(5) = 10; 23 = prime(9) and A008330(9) = 10 is a record in A008330.
		

Crossrefs

Programs

  • PARI
    r=0;for(n=1,230,k=eulerphi(prime(n)-1);if(r
    				

A174842 Irregular triangle T(i,n) giving the number of elements of Zp having multiplicative order di, the i-th divisor of p-1, where p is the n-th prime.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 4, 4, 1, 1, 2, 2, 2, 4, 1, 1, 2, 4, 8, 1, 1, 2, 2, 6, 6, 1, 1, 10, 10, 1, 1, 2, 6, 6, 12, 1, 1, 2, 4, 2, 4, 8, 8, 1, 1, 2, 2, 2, 6, 4, 6, 12, 1, 1, 2, 4, 4, 4, 8, 16, 1, 1, 2, 2, 6, 6, 12, 12, 1, 1, 22, 22, 1, 1, 2, 12, 12, 24, 1, 1, 28, 28, 1, 1, 2, 2, 4, 2, 4, 4, 8, 8
Offset: 1

Views

Author

T. D. Noe, Mar 30 2010

Keywords

Comments

The divisors of p-1 are assumed to be in increasing order. The first row, for prime 2, has only one term. All other rows begin with two 1s and end with phi(p-1). There are tau(p-1), the number of divisors of p-1, terms in each row. The sum of the terms in each row is p-1. When p is a prime of the form 4k-1, then the last two terms in the row are equal. When p is a prime of the form 4k+1, then the last two terms in the row have a ratio of 2.

Examples

			For prime p=17, the 7th prime, the multiplicative order of the numbers 1 to p-1 is 1, 8, 16, 4, 16, 16, 16, 8, 8, 16, 16, 16, 4, 16, 8, 2. There is one 1, one 2, two 4's, four 8's, and eight 16's. Hence row 7 is 1, 1, 2, 4, 8.
		

Crossrefs

A008328 (tau(p-1)), A008330 (phi(p-1)), A174843 (divisors of p-1)

Programs

  • Mathematica
    Flatten[Table[EulerPhi[Divisors[p-1]], {p, Prime[Range[100]]}]]

Formula

T(i,n) = phi(di), where di is the i-th divisor of prime(n)-1.

A219029 a(n) = n - 1 - phi(phi(n)).

Original entry on oeis.org

-1, 0, 1, 2, 2, 4, 4, 5, 6, 7, 6, 9, 8, 11, 10, 11, 8, 15, 12, 15, 16, 17, 12, 19, 16, 21, 20, 23, 16, 25, 22, 23, 24, 25, 26, 31, 24, 31, 30, 31, 24, 37, 30, 35, 36, 35, 24, 39, 36, 41, 34, 43, 28, 47, 38, 47, 44, 45, 30, 51, 44, 53, 50, 47, 48, 57, 46, 51, 48
Offset: 1

Views

Author

V. Raman, Nov 10 2012

Keywords

Comments

There are exactly n - 1 - phi(phi(n)) non-primitive roots for n, less than n, if n is prime.
a(n) will be the same as A219027(n) except when n is a member of A033949 or n = 1, i.e., n is not 2, 4, prime, power of a prime, twice a prime, or twice a prime power.

Crossrefs

Cf. A008330 (number of primitive roots for the n-th prime).
Cf. A046144 (number of primitive roots for n).
Cf. A010554 (value of phi(phi(n))).

Programs

  • Magma
    [(n - 1 - EulerPhi(EulerPhi(n))): n in [1..70] ]; // Vincenzo Librandi, Jan 26 2013
  • Mathematica
    Table[n - (EulerPhi[EulerPhi[n]] + 1), {n, 75}] (* Alonso del Arte, Nov 17 2012 *)
  • PARI
    for(n=1,100,print1(n-1-eulerphi(eulerphi(n))","))
    

Formula

a(n) = n - 1 - A010554(n). - V. Raman, Nov 22 2012

A241197 Numerator of new minima of phi(p-1)/(p-1), where phi is Euler's totient function and p = prime(n).

Original entry on oeis.org

1, 1, 1, 4, 8, 16, 288, 256, 192, 768, 384, 3456, 3072, 6912, 6144, 55296, 1658880, 221184, 110592, 3317760, 442368, 13271040
Offset: 1

Views

Author

T. D. Noe, Apr 17 2014

Keywords

Comments

The values of p are in A241196. The denominator is in A241198.

Examples

			In decimal, the minima are about 1, 0.5, 0.333333, 0.266667, 0.228571, 0.207792, 0.196856, 0.195569, 0.191808, 0.185194, 0.183469, 0.181713, 0.180525, 0.173812, 0.172676, 0.171024, 0.165507, 0.165127, 0.163588.
		

Crossrefs

Cf. A008330 (phi(prime(n)-1)), A073918, A241194, A241195.

Programs

  • Mathematica
    tMin = {{2, 1}}; Do[p = Prime[n]; tn = EulerPhi[p - 1]/(p - 1); If[tn < tMin[[-1, -1]], AppendTo[tMin, {p, tn}]], {n, 10^7}]; Numerator[Transpose[tMin][[2]]]

Extensions

a(20)-a(22) from Giovanni Resta, Apr 14 2016

A241198 Denominator of new minima of phi(p-1)/(p-1), where phi is Euler's totient function and p = prime(n).

Original entry on oeis.org

1, 2, 3, 15, 35, 77, 1463, 1309, 1001, 4147, 2093, 19019, 17017, 39767, 35581, 323323, 10023013, 1339481, 676039, 20957209, 2800733, 86822723
Offset: 1

Views

Author

T. D. Noe, Apr 17 2014

Keywords

Comments

The values of p are in A241196. The numerator is in A241197.

Crossrefs

Cf. A008330 (phi(prime(n)-1)), A073918, A241194, A241195.

Programs

  • Mathematica
    tMin = {{2, 1}}; Do[p = Prime[n]; tn = EulerPhi[p - 1]/(p - 1); If[tn < tMin[[-1, -1]], AppendTo[tMin, {p, tn}]], {n, 10^7}]; Denominator[Transpose[tMin][[2]]]

Extensions

a(20)-a(22) from Giovanni Resta, Apr 14 2016

A247176 Largest number of maximal order mod n.

Original entry on oeis.org

0, 1, 2, 3, 3, 5, 5, 7, 5, 7, 8, 11, 11, 5, 13, 13, 14, 11, 15, 17, 19, 19, 21, 23, 23, 19, 23, 23, 27, 23, 24, 29, 29, 31, 33, 31, 35, 33, 37, 37, 35, 31, 34, 41, 43, 43, 45, 43, 47, 47, 46, 45, 51, 47, 53, 53, 53, 55, 56, 53, 59, 55, 61, 61, 63, 61, 63, 65, 67, 67, 69, 67
Offset: 1

Views

Author

Eric Chen, Nov 29 2014

Keywords

Examples

			a(18) = 11 because the largest possible order mod 18 is 6, and because 16, 15, 14, and 12 are not coprime to 18, and the orders of 17 and 13 to mod 18 are 2 and 3, not the largest possible order, and the order of 11 to mod 18 is 6, so a(18) = 11.
		

Crossrefs

Cf. A002322 (orders), same as A046146 for n with primitive roots, A071894 (for primes).

Programs

  • Mathematica
    prms={}; f[n_] = Block[If[MultiplicativeOrder[p, n]=CarmichaelLambda[n], Join[prms, p]]; prms[-1]]; Array[f, 128]
  • PARI
    carmichaellambda(n)=lcm(znstar(n)[2]);
    for(i=1, 128, p=0; for(q=1, i-1, if(gcd(q, i)==1&&znorder(Mod(q, i))==carmichaellambda(i), p=q)); print1(p", "))

Extensions

a(68) corrected by Eric Chen, Jun 01 2015
Previous Showing 11-20 of 44 results. Next