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 21-30 of 37 results. Next

A219027 Number of non-primitive roots for n, less than n.

Original entry on oeis.org

0, 0, 1, 2, 2, 4, 4, 7, 6, 7, 6, 11, 8, 11, 14, 15, 8, 15, 12, 19, 20, 17, 12, 23, 16, 21, 20, 27, 16, 29, 22, 31, 32, 25, 34, 35, 24, 31, 38, 39, 24, 41, 30, 43, 44, 35, 24, 47, 36, 41, 50, 51, 28, 47, 54, 55, 56, 45, 30, 59, 44, 53, 62, 63, 64, 65, 46, 67, 68
Offset: 1

Views

Author

V. Raman, Nov 10 2012

Keywords

Comments

a(n) will be the same as A219029(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. In such cases, when n is a member of A033949, then a(n) = n-1.

Crossrefs

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

Programs

  • PARI
    for(i=1,100,p=0;for(q=1,i-1,if(gcd(q,i)>1||znorder(Mod(q,i))!=eulerphi(i),p++));print1(p","))

Formula

n-1-A046144(n).

A277776 Triangle T(n,k) in which the n-th row contains the increasing list of nontrivial square roots of unity mod n; n>=1.

Original entry on oeis.org

3, 5, 5, 7, 4, 11, 7, 9, 9, 11, 8, 13, 5, 7, 11, 13, 17, 19, 13, 15, 11, 19, 15, 17, 10, 23, 6, 29, 17, 19, 14, 25, 9, 11, 19, 21, 29, 31, 13, 29, 21, 23, 19, 26, 7, 17, 23, 25, 31, 41, 16, 35, 25, 27, 21, 34, 13, 15, 27, 29, 41, 43, 20, 37, 11, 19, 29, 31, 41
Offset: 1

Views

Author

Alois P. Heinz, Oct 30 2016

Keywords

Comments

Rows with indices n in A033948 (or with A046144(n)=0) are empty. Indices of nonempty rows are given by A033949.
This is A228179 without the trivial square roots {1, n-1}.
The number of terms in each nonempty row n is even: A060594(n)-2.

Examples

			Row n=8 contains 3 and 5 because 3*3 = 9 == 1 mod 8 and 5*5 = 25 == 1 mod 8.
Triangle T(n,k) begins:
08 :   3,  5;
12 :   5,  7;
15 :   4, 11;
16 :   7,  9;
20 :   9, 11;
21 :   8, 13;
24 :   5,  7, 11, 13, 17, 19;
28 :  13, 15;
30 :  11, 19;
		

Crossrefs

Columns k=1-2 give: A082568, A357099.
Last elements of nonempty rows give A277777.

Programs

  • Maple
    T:= n-> seq(`if`(i*i mod n=1, i, [][]), i=2..n-2):
    seq(T(n), n=1..100);
    # second Maple program:
    T:= n-> ({numtheory[rootsunity](2, n)} minus {1, n-1})[]:
    seq(T(n), n=1..100);
  • Mathematica
    T[n_] := Table[If[Mod[i^2, n] == 1, i, Nothing], {i, 2, n-2}];
    Select[Array[T, 100], # != {}&] // Flatten (* Jean-François Alcover, Jun 18 2018, from first Maple program *)
  • Python
    from itertools import chain, count, islice
    from sympy.ntheory import sqrt_mod_iter
    def A277776_gen(): # generator of terms
        return chain.from_iterable((sorted(filter(lambda m:1A277776_list = list(islice(A277776_gen(),30)) # Chai Wah Wu, Oct 26 2022

A280262 Numbers n such that A187730(n) < A049559(n).

Original entry on oeis.org

21, 33, 57, 65, 69, 77, 91, 93, 105, 129, 133, 141, 145, 161, 177, 185, 189, 201, 209, 213, 217, 225, 237, 249, 253, 265, 273, 297, 301, 305, 309, 321, 329, 341, 345, 369, 377, 381, 385, 393, 413, 417, 437, 441, 451, 453, 465, 469, 473, 481, 489, 497, 501, 505, 513, 517, 537, 545, 553, 559, 573
Offset: 1

Views

Author

Thomas Ordowski and Robert Israel, Dec 30 2016

Keywords

Comments

Terms are not of the form p^k, where p is a prime.
There are no terms of the form 2p+1, where p is a prime.
The sequence contains all Carmichael numbers except A264012.
If n is in the sequence, then n-1 is not squarefree. - Thomas Ordowski, Jan 02 2017
Theorem: the set of such numbers has natural density 0. Proof: Let y = y(n) = loglog n /logloglog n. Using part 1 of Lemma 2.1 in paper 199 on my home page (joint with Luca), applied to the residue class 1: But for a set of n of density 0, for each integer d < y, there is a prime p|n with p == 1 (mod d). In particular, lambda(n) is divisible by every integer d up to y. Suppose now that gcd(lambda(n),n-1) < gcd(phi(n),n-1). Then there is a prime power q^a such that q^a | phi(n), q^a | n-1, and q^a does not divide lambda(n). Then, but for a set of n of density 0, we would have q^a > y. Since q | lambda(n), we have a at least 2. So, n-1 is divisible by some q^a > y with a >= 2. The set of such n has density 0. QED. - Carl Pomerance, Jan 02 2017
Number of terms < 10^k: 0, 8, 112, 1258, 13069, 132262, 1324263, 13229372, 132009236, ..., . Robert G. Wilson v, Jan 04 2017
If p and q are distinct primes == 3 (mod 4), then p*q is in the sequence. - Thomas Ordowski, Mar 30 2017

Crossrefs

Subsequence of A033949.

Programs

  • Maple
    select(t -> igcd(numtheory:-lambda(t),t-1) < igcd(numtheory:-phi(t),t-1), [$1..1000]);
  • Mathematica
    Select[Range@ 600, GCD[CarmichaelLambda@ #, # - 1] < GCD[# - 1, EulerPhi@ #] &] (* Michael De Vlieger, Dec 31 2016 *)

A354109 Numbers that are neither an odd prime power nor twice an odd prime power.

Original entry on oeis.org

1, 2, 4, 8, 12, 15, 16, 20, 21, 24, 28, 30, 32, 33, 35, 36, 39, 40, 42, 44, 45, 48, 51, 52, 55, 56, 57, 60, 63, 64, 65, 66, 68, 69, 70, 72, 75, 76, 77, 78, 80, 84, 85, 87, 88, 90, 91, 92, 93, 95, 96, 99, 100, 102, 104, 105, 108, 110, 111, 112, 114, 115, 116, 117, 119, 120, 123, 124, 126, 128, 129, 130, 132, 133, 135
Offset: 1

Views

Author

Antti Karttunen, May 18 2022

Keywords

Comments

Terms (1, 2, 4) followed by A033949, positive integers that do not have a primitive root.
Also numbers n for which A353768(n) and A353768(A267099(n)) are equal. Proof: if n is an odd prime power or twice such a number, then the odd prime factor in A267099(n) is in the opposite side of 4k+1 / 4k+3 divide of that of the odd prime factor of n, and subtracting one from it will give a number of the form 4k+0 in the other case, and 4k+2 in the other case, and either 4k != 4k+2 (mod 4) when the prime factor is unitary, or then 4k*(4k+1) != (4k+2)*(4k+3) (mod 4), when the odd prime has exponent > 1, so none of such n occur in this sequence. On the other hand, if n has more than two distinct odd prime factors, p and q, then (p-1)(q-1) == 0 (mod 4), or if n is a multiple of 4, then as phi(4) = 2 and phi(2^k) == 0 (mod 4) for k > 2, and with (p-1) giving at least one instance of factor 2, then both A267099(n) and n are guaranteed to be multiples of 4, regardless of whether p (and q) is (are) of the form 4k+1 or 4k+3.

Crossrefs

Cf. A033949, A353768, A267099, A354107, A354108 (characteristic function), A354189 (subsequence).

Programs

  • Mathematica
    q[n_] := ! (OddQ[n] && PrimePowerQ[n]) && ! (OddQ[n/2] && PrimePowerQ[n/2]); Select[Range[135], q] (* Amiram Eldar, May 20 2022 *)
  • PARI
    A354108(n) = (A353768(n) == A353768(A267099(n)));
    A354108(n) = ((n && !bitand(n,n-1)) || !isprimepower(n/(2-(n%2))));
    isA354109(n) = A354108(n);
    
  • Python
    from sympy import primepi, integer_nthroot
    def A354109(n):
        def f(x): return int(n+sum(primepi(integer_nthroot(x,k)[0])-1 for k in range(1,x.bit_length()))+sum(primepi(integer_nthroot(x>>1,k)[0])-1 for k in range(1,x.bit_length()-1)))
        m, k = n, f(n)
        while m != k: m, k = k, f(k)
        return m # Chai Wah Wu, Feb 25 2025

Formula

{k | A353768(k) == A354107(k)}.

A160377 Phi-torial of n (A001783) modulo n.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 1, 8, 9, 10, 1, 12, 13, 1, 1, 16, 17, 18, 1, 1, 21, 22, 1, 24, 25, 26, 1, 28, 1, 30, 1, 1, 33, 1, 1, 36, 37, 1, 1, 40, 1, 42, 1, 1, 45, 46, 1, 48, 49, 1, 1, 52, 53, 1, 1, 1, 57, 58, 1, 60, 61, 1, 1, 1, 1, 66, 1, 1, 1, 70, 1, 72, 73, 1, 1, 1, 1, 78, 1, 80, 81, 82, 1, 1, 85, 1, 1
Offset: 1

Views

Author

J. M. Bergot, May 11 2009

Keywords

Comments

Is a(n)<> 1 iff n in A033948, n>2? [R. J. Mathar, May 21 2009]
Same as A103131, except there -1 appears instead of n-1. By Gauss's generalization of Wilson's theorem, a(n)=-1 means n has a primitive root (n in A033948) and a(n)=1 means n has no primitive root (n in A033949). [T. D. Noe, May 21 2009]

Examples

			Phi-torial of 12 equals 1*5*7*11=385 which leaves a remainder of 1 when divided by 12.
Phi-torial of 14 equals 1*3*5*9*11*13=19305 which leaves a remainder of 13 when divided by 14.
		

Crossrefs

Cf. A124740 (one of just four listing "product of coprimes").

Programs

  • Maple
    copr := proc(n) local a,k ; a := {1} ; for k from 2 to n-1 do if gcd(k,n) = 1 then a := a union {k} ; fi; od: a ; end:
    A001783 := proc(n) local c; mul(c,c= copr(n)) ; end:
    A160377 := proc(n) A001783(n) mod n ; end: seq( A160377(n),n=1..100) ; # R. J. Mathar, May 21 2009
    A160377 := proc(n) local k, r; r := 1:
    for k to n do if igcd(n,k) = 1 then r := modp(r*k, n) fi od;
    r end: seq( A160377(i), i=1..88); # Peter Luschny, Oct 20 2012
  • Mathematica
    Table[nn = n; a = Select[Range[nn], CoprimeQ[#, nn] &];
    Mod[Apply[Times, a], nn], {n, 1, 88}] (* Geoffrey Critzer, Jan 03 2015 *)
  • Sage
    def A160377(n):
        r = 1
        for k in (1..n):
            if gcd(n, k) == 1: r = mod(r*k, n)
        return r
    [A160377(n) for n in (1..88)]  # Peter Luschny, Oct 20 2012

Formula

a(n) = A001783(n) mod n. - R. J. Mathar, May 21 2009
For n>2, a(n)=n-1 if A060594(n)=2; otherwise a(n)=1. - Max Alekseyev
a(n) = Gauss_factorial(n, n) modulo n. (Definition of the Gauss factorial in A216919.) - Peter Luschny, Oct 20 2012

Extensions

Edited and extended by R. J. Mathar and Max Alekseyev, May 21 2009

A208296 Smallest positive nontrivial odd solution of the congruence x^2 == 1 (mod A001748(n+2)), n >= 1.

Original entry on oeis.org

11, 13, 23, 25, 35, 37, 47, 59, 61, 73, 83, 85, 95, 107, 119, 121, 133, 143, 145, 157, 167, 179, 193, 203, 205, 215, 217, 227, 253, 263, 275, 277, 299, 301, 313, 325, 335, 347, 359, 361, 383, 385, 395, 397, 421, 445, 455, 457, 467, 479, 481, 503, 515
Offset: 1

Views

Author

Wolfdieter Lang, Mar 14 2012

Keywords

Comments

The trivial solutions of the congruence x^2 == 1 (mod 3*prime(n+2)), n>=1, with the primes prime(n+2) = A000040(n+2) have positive representatives 1 and 3*prime(n+2)-1. There are all-together four incongruent solutions due to a general theorem (see, e.g., the Hardy-Wright reference, Theorem 122, p. 96, and also A060594) and the fact that the number of incongruent solutions of this congruence with odd prime modulus p is two, namely with positive representative p and p-1 (see, e.g., Hardy-Wright, Theorem 109, p. 85). a(n) is the smallest positive odd representative >1 which solves this congruence. The other nontrivial even representative solving this congruence is 3*prime(n+2) - a(n), i.e. 4, 8, 10, 14, 16, 20, ... See 2*A207336.
a(n) solves also the congruence x^2 == 1 (Modd A001748(n+2)), n>=1. For Modd n (not to be confused with mod n) see a comment on A203571. This follows from floor(a(n)^2/3*prime(n+2)) being even, in fact it is 8*A024699(n) (see a comment there), hence a(n)^2 (Modd 3*prime(n+2)) = a(n)^2 (mod 3*prime(n+2)) = 1. For those multiplicative groups Modd 3*p with p an odd prime which are cyclic (this is not possible in the mod case, see A033949), a(n) is the representative of the only other nontrivial solution of this congruence. The representative of the trivial solution is 1 (-1 belongs to the same Modd class). (The conjecture stated here earlier is wrong, that is, the multiplicative group Modd (91=7*13) is non-cyclic. It may still be true for 3*p. - Wolfdieter Lang, Mar 15 2012)

Examples

			a(3)=23 because prime(5)=11=A007528(2), hence K(3)=11 and sqrt(8*T(11)+1)=sqrt(8*66+1)= 23. 23^2 = 529 == 1 (Modd 33), because floor(529/33)=16=8*A024699(3) is even, and 529 == 1 (mod 33).
a(4)=25 because prime(6)=13=A002476(2), hence K(4)=12 and sqrt(8*T(12)+1)=sqrt(8*78+1)=25. 25^2 = 625 == 1 (Modd 39), because floor(625/39)=16=8*A024699(4) is even, and 625 == 1 (mod 39).
		

References

  • H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers. 5th ed., Clarendon Press, Oxford, 2003.

Crossrefs

Programs

  • Mathematica
    Table[SelectFirst[Solve[x^2==1 && x !=1,x, Modulus->3*Prime[n+2]][[All,1,2]],OddQ], {n, 53}] (* Jon Maiga, Sep 28 2019 *)

Formula

a(n) = sqrt(8*T(K(n))+1), with the triangular numbers T = A000217, and K(n) = prime(n+2)-1 if the prime prime(n+2) is of the form 6*k+1, i.e., from A002476, and K(n) = prime(n+2) if prime(n+2) is of the form 6*k-1, i.e. from A007528.
a(n)^2 == 1 (mod A001748(n+2)), n >= 1.
a(n)^2 == 1 (Modd A001748(n+2)), n >= 1.

A282625 Number of cyclic groups in the total direct product factorization of the multiplicative group of integers modulo n, for n >= 1.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 3, 2, 2, 3, 2, 2, 2, 3, 2, 2, 3, 2, 3, 1, 3, 3, 2, 2, 3, 3, 2, 3, 3, 3, 3, 2, 2, 3, 3, 2, 2, 3, 2, 2, 3, 4, 3, 2, 2, 3, 3, 3, 4, 2, 3, 3, 3, 2, 3, 3, 3, 4, 2, 2, 3, 3, 4, 3, 3, 3, 2, 2, 2, 4, 2, 3, 3, 4, 2, 3, 4, 3, 4, 2, 3, 3, 2, 3, 4, 3
Offset: 1

Views

Author

Wolfdieter Lang, Mar 02 2017

Keywords

Comments

The multiplicative group of integers modulo n, (Z/n*Z)^x, also the cyclotomic group, the Galois group Gal(Q(zeta(n))/Q) with zeta(n) = exp(2*Pi*I/n), is cyclic for n from A033948 and non-cyclic for n from A033949. Each of these groups is the direct product of cyclic factors (one factor is included).
In the total factorization for n >= 3 only cyclic factors whose orders are prime powers appear, and because the direct product is associative, and for these abelian groups also commutative, one can order the factors with nonincreasing orders.
For n=1 and n=2 the group is C_1 = {1} (for n=1 one has 1 == 0 (mod 1)).
Cyclic groups may also have a factorization into more than one factor. E.g., C_6 = C_3 x C_2.
The number of factors in this total factorization is for a cyclic group C_m, for m >= 2, given by A001221(m). For m=1 this number is 1 (not A001221(1)).
For non-cyclic groups the number of factors in this total factorization is given by A281855(m) if n = A033949(m), m >= 1.
For the non-cyclic group case see also the W. Lang links under A281854.
Compare this sequence with A046072 where another factorization of these groups is used, the one with the least cyclic factors. E.g., A046072(7) = 1 for the group C_6, and a(7) = 2 here (see the example above).

Examples

			n = 35, a non-cyclic case because A033949(12) = 35. The group can be written as <19_6, 13_4 > where the orders modulo 35 of the generators are given as subscript. Therefore the group is C_6 x C4 = C_4 x C_3 x C_2 and a(35) = 3, whereas A046072(35) = 2.
		

Crossrefs

A175594 Numbers having no primitive root.

Original entry on oeis.org

0, 8, 12, 15, 16, 20, 21, 24, 28, 30, 32, 33, 35, 36, 39, 40, 42, 44, 45, 48, 51, 52, 55, 56, 57, 60, 63, 64, 65, 66, 68, 69, 70, 72, 75, 76, 77, 78, 80, 84, 85, 87, 88, 90, 91, 92, 93, 95, 96, 99, 100, 102, 104, 105, 108, 110, 111, 112, 114, 115, 116, 117, 119, 120, 123
Offset: 1

Views

Author

Vladislav-Stepan Malakhovsky and Juri-Stepan Gerasimov, Jul 20 2010

Keywords

Comments

Union of {0} and A033949.
Numbers n such that A046145(n)=0 except n=1.

Programs

  • Mathematica
    Prepend[Select[Range[2, 123], Not[IntegerQ[PrimitiveRoot[#]]] &], 0] (* Alonso del Arte, Dec 12 2011 *)
  • Python
    from sympy import primepi, integer_nthroot
    def A175594(n):
        if n==1: return 0
        def f(x): return int(n+(x>=2)+(x>=4)+sum(primepi(integer_nthroot(x,k)[0])-1 for k in range(1,x.bit_length()))+sum(primepi(integer_nthroot(x>>1,k)[0])-1 for k in range(1,x.bit_length()-1)))
        m, k = n, f(n)
        while m != k: m, k = k, f(k)
        return m # Chai Wah Wu, Feb 25 2025

Extensions

Corrected by R. J. Mathar, Oct 15 2011
Corrected by Arkadiusz Wesolowski, Sep 06 2012

A193305 Composite numbers of the form 4, p^m, or 2*p^m for p an odd prime. All composites that have a primitive root.

Original entry on oeis.org

4, 6, 9, 10, 14, 18, 22, 25, 26, 27, 34, 38, 46, 49, 50, 54, 58, 62, 74, 81, 82, 86, 94, 98, 106, 118, 121, 122, 125, 134, 142, 146, 158, 162, 166, 169, 178, 194, 202, 206, 214, 218, 226, 242, 243, 250, 254, 262, 274, 278, 289, 298, 302, 314, 326, 334, 338, 343
Offset: 1

Views

Author

Warren Breslow, Jul 21 2011

Keywords

Comments

Nonprime k such that the multiplicative group modulo k is cyclic. Nonprime terms of A033948 (omitting the initial term 1). - Joerg Arndt, Aug 07 2011
a(n) has a primitive root for any n. - Arkadiusz Wesolowski, Sep 06 2012 [See, e.g., the Niven et al. reference. - Wolfdieter Lang, Jan 18 2017]

References

  • Ivan Niven, Herbert S. Zuckerman and Hugh L. Montgomery, An Introduction to the Theory Of Numbers, Fifth Edition, John Wiley and Sons, Inc., NY 1991, Theorem 2.41, p. 104.

Crossrefs

Cf. A033948, A033949 (composites without primitive root). A279398.

Programs

  • Mathematica
    lim = 500; t = {4}; Do[p = Prime[n]; k = 1; While[p^k <= lim, If[k > 1, AppendTo[t, p^k]]; If[2*p^k <= lim, AppendTo[t, 2*p^k]]; k++], {n, 2, PrimePi[lim/2]}]; Sort[t]; (* T. D. Noe, Sep 06 2012 *)
  • PARI
    for (n=2, 555, if ( isprime(n), next() ); if ( 1 == #(znstar(n)[3]), print1(n,", ") ); );  /* Joerg Arndt, Aug 07 2011 */
    
  • Python
    from sympy import primepi, integer_nthroot
    def A193305(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            kmin = kmax >> 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return int(n+x-(x>=4)-sum(primepi(integer_nthroot(x,k)[0])-1 for k in range(2,x.bit_length()))-sum(primepi(integer_nthroot(x>>1,k)[0])-1 for k in range(1,x.bit_length()-1)))
        return bisection(f,n,n) # Chai Wah Wu, Feb 24 2025

Extensions

More terms from Joerg Arndt, Aug 07 2011
Name corrected and augmented by Wolfdieter Lang, Jan 18 2017

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
Previous Showing 21-30 of 37 results. Next