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 56 results. Next

A327730 a(n) = A060594(2n).

Original entry on oeis.org

1, 2, 2, 4, 2, 4, 2, 4, 2, 4, 2, 8, 2, 4, 4, 4, 2, 4, 2, 8, 4, 4, 2, 8, 2, 4, 2, 8, 2, 8, 2, 4, 4, 4, 4, 8, 2, 4, 4, 8, 2, 8, 2, 8, 4, 4, 2, 8, 2, 4, 4, 8, 2, 4, 4, 8, 4, 4, 2, 16, 2, 4, 4, 4, 4, 8, 2, 8, 4, 8, 2, 8, 2, 4, 4, 8, 4, 8, 2, 8, 2, 4, 2, 16, 4, 4, 4, 8, 2, 8, 4, 8, 4, 4, 4, 8, 2, 4, 4, 8
Offset: 1

Views

Author

Jianing Song, Sep 23 2019

Keywords

Comments

a(n) is the number of quadratic number fields Q(sqrt(d)) (including Q itself) that are subfields of the cyclotomic field Q(exp(Pi*i/n)), where i is the imaginary unit. Note that for odd k, Q(exp(2*Pi*i/k)) = Q(exp(2*Pi*i/(2*k))), so we can just consider the case Q(exp(2*Pi*i/(2*k))) for integers k and let n = 2*k.
a(n) = 2 if and only if n = 2 or n = p^e, where p is an odd prime and e >= 1.

Examples

			List of quadratic number fields (including Q itself) that are subfields of Q(exp(Pi*i/n)):
n = 2 (the quotient field over the Gaussian integers): Q, Q(i);
n = 3 (the quotient field over the Eisenstein integers): Q, Q(sqrt(-3));
n = 4: Q, Q(sqrt(2)), Q(i), Q(sqrt(-2));
n = 5: Q, Q(sqrt(5));
n = 6: Q, Q(sqrt(3)), Q(sqrt(-3)), Q(i);
n = 7: Q, Q(sqrt(-7));
n = 8: Q, Q(sqrt(2)), Q(i), Q(sqrt(-2));
n = 9: Q, Q(sqrt(-3));
n = 10: Q, Q(sqrt(5)), Q(i), Q(sqrt(-5));
n = 11: Q, Q(sqrt(-11));
n = 12: Q, Q(sqrt(2)), Q(sqrt(3)), Q(sqrt(6)), Q(sqrt(-3)), Q(i), Q(sqrt(-2)), Q(sqrt(-6));
n = 13: Q, Q(sqrt(13));
n = 14: Q, Q(sqrt(7)), Q(i), Q(sqrt(-7));
n = 15: Q, Q(sqrt(5)), Q(sqrt(-3)), Q(sqrt(-15));
n = 16: Q, Q(sqrt(2)), Q(i), Q(sqrt(-2)).
		

Crossrefs

Programs

  • Mathematica
    f[p_, e_] := 2; f[2, e_] := If[e == 1, 2, 4]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Dec 31 2022 *)
  • PARI
    a(n) = 2^#znstar(2*n)[2]

Formula

a(n) = 2*A060594(n) if n is even and not divisible by 8, otherwise A060594(n).
Multiplicative with a(2) = 2 and a(2^e) = 4 for e > 1; a(p^e) = 2 for odd primes p.
a(n) = 2^omega(n) if 4 does not divide n, otherwise 2^(omega(n)+1), omega = A001221.
From Amiram Eldar, Dec 31 2022: (Start)
Dirichlet g.f.: (zeta(s)^2/zeta(2*s))*((2+2^s+4^s)/(2^s+4^s)).
Sum_{k=1..n} a(k) ~ (n*log(n) + (2*gamma - 5*log(2)/12 - 2*zeta'(2)/zeta(2) - 1)*n)*8/Pi^2, where gamma is Euler's constant (A001620). (End)

Extensions

Offset 1 from Sébastien Palcoux, Jun 22 2022

A033948 Numbers that have a primitive root (the multiplicative group modulo n is cyclic).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 13, 14, 17, 18, 19, 22, 23, 25, 26, 27, 29, 31, 34, 37, 38, 41, 43, 46, 47, 49, 50, 53, 54, 58, 59, 61, 62, 67, 71, 73, 74, 79, 81, 82, 83, 86, 89, 94, 97, 98, 101, 103, 106, 107, 109, 113, 118, 121, 122, 125, 127, 131, 134, 137, 139
Offset: 1

Views

Author

Calculated by Jud McCranie, entered by N. J. A. Sloane

Keywords

Comments

The sequence consists of 1, 2, 4 and numbers of the form p^i and 2p^i, where p is an odd prime and i >= 1.
Sequence gives values of n such that x^2 == 1 (mod n) has no solution with 1 < x < n-1. - Benoit Cloitre, Jan 04 2002
Gaussian criterion for terms of the sequence: n is in the sequence iff Product_{1<=i<=n-1, gcd(i,n)=1} i == -1 (mod n), see example. - Vladimir Shevelev, Jan 11 2011
For the criterion used above see the Hardy and Wright reference, Theorem 129. p. 102, a consequence of Bauer's theorem. See also T. D. Noe's comment with the Nagell reference on A060594 and also A160377. - Wolfdieter Lang, Feb 16 2012
Also numbers n such that phi(n) = lambda(n) (or numbers with A034380(n)=1), where phi is A000010, and lambda is Carmichael's lambda: A002322. - Enrique Pérez Herrero, Jun 04 2013
All values of n>2 are given when there are exactly two solutions for n*j+1 is a square, 0 <= j < n, which are j = {0, n-2}. See Mathematica examples. - Richard R. Forberg, Mar 26 2016
Numbers n such that the Galois group of the cyclotomic field with the n-th roots of unity is a cyclic group. [Van der Waerden, p. 55, Th. 4.11.; Corwin, 1967] - N. J. A. Sloane, Nov 26 2016

Examples

			Gaussian product for n=9 is 1*2*4*5*7*8=2240. Since 2240==-1(mod 9), then 9 is in the sequence. - _Vladimir Shevelev_, Jan 11 2011
		

References

  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, Fifth ed., Clarendon Press, Oxford, 2003, Theorem 129, p. 102.
  • I. Niven and H. S. Zuckerman, An Introduction to the Theory of Numbers, 4th edition, page 62, Theorem 2.25.
  • B. L. van der Waerden, Modern Algebra, 2nd. ed., Ungar, NY, Vol. I, 1948.

Crossrefs

Cf. A033949 (complement), A072209, A001783 (Gaussian products used in the V. Shevelev example).
Union of 1, 2, 4, A061345, A278568.

Programs

  • Maple
    m := proc(n) local k, r; r := 1; if n = 2 then return false fi;
    for k from 1 to n do if igcd(n,k) = 1 then r := modp(r*k,n) fi od; r end:
    select(n -> m(n) <> 1, [$1..139]); # Peter Luschny, May 25 2017
  • Mathematica
    Join[{1}, Select[ Range[140], IntegerQ[ PrimitiveRoot[#]] &]] (* Jean-François Alcover, Sep 27 2011 *)
    Select[Range[139], EulerPhi[#] == CarmichaelLambda[#] &] (* T. D. Noe, Jun 04 2013 *)
    result = {}; Do[count = 0;
    Do[If[Mod[j^2, n] == 1, count++], {j, 2, n - 2}];
    If[count == 0, AppendTo[result, n]], {n, 1, 200}]; result (* Richard R. Forberg, Mar 26 2016 *)
    result = {}; Do[count = 0;
    Do[ r = Sqrt[n*j + 1]; If[IntegerQ[r], count++], {j, 0, n}];
    If[count == 2, AppendTo[result, n]], {n, 0, 200}]; result  (* missing{1,2} Richard R. Forberg, Mar 26 2016 *)
  • PARI
    is(n)=if(n%2, isprimepower(n) || n==1, n==2 || n==4 || (isprimepower(n/2,&n) && n>2)) \\ Charles R Greathouse IV, Apr 16 2015
    
  • Python
    from sympy import primepi, integer_nthroot
    def A033948(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-1+x-(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)))
        return bisection(f,n,n) # Chai Wah Wu, Feb 24 2025

A060968 Number of solutions to x^2 + y^2 == 1 (mod n).

Original entry on oeis.org

1, 2, 4, 8, 4, 8, 8, 16, 12, 8, 12, 32, 12, 16, 16, 32, 16, 24, 20, 32, 32, 24, 24, 64, 20, 24, 36, 64, 28, 32, 32, 64, 48, 32, 32, 96, 36, 40, 48, 64, 40, 64, 44, 96, 48, 48, 48, 128, 56, 40, 64, 96, 52, 72, 48, 128, 80, 56, 60, 128, 60, 64, 96, 128, 48, 96, 68, 128, 96, 64, 72
Offset: 1

Views

Author

Ahmed Fares (ahmedfares(AT)my-deja.com), May 09 2001

Keywords

Comments

From Jianing Song, Nov 05 2019: (Start)
a(n) is also the order of the group SO(2,Z_n), i.e., the group of 2 X 2 matrices A over Z_n such that A*A^T = E = [1,0;0,1] and det(A) = 1. Elements in SO(2,Z_n) are of the form [x,y;-y,x] where x^2+y^2 == 1 (mod n). For example, SO(2,Z_4) = {[1,0;0,1], [0,1;3,0], [1,2;2,1], [2,1;3,2], [3,0;0,3], [0,3;1,0], [3,2;2,3], [2,3;1,2]}. Note that SO(2,Z_n) is abelian, and it is isomorphic to the multiplicative group G_n := {x+yi: x^2 + y^2 = 1, x,y in Z_n} where i = sqrt(-1), by the mapping [x,y;-y,x] <-> x+yi. See my link below for the group structure of SO(2,Z_n).
The exponent of SO(2,Z_n) (i.e., least e > 0 such that x^e = E for every x in SO(2,Z_n)) is given by A235863(n).
The rank of SO(2,Z_n) (i.e., the minimum number of generators) is omega(n) if n is not divisible by 4, omega(n)+1 if n is divisible by 4 but not by 8 and omega(n)+2 if n is divisible by 8, omega = A001221. (End)
In general, let R be any commutative ring with unity, O(m,R) be the group of m X m matrices A over R such that A*A^T = E and SO(m,R) be the group of m X m matrices A over R such that A*A^T = E and det(A) = 1, then O(m,R)/SO(m,R) = {square roots of unity in R*}, where R* is the multiplicative group of R. This is because if we define f(M) = det(M) for M in O(m,R), then f is a surjective homomorphism from O(m,R) to {square roots of unity in R*}, and SO(m,R) is its kernel. See also A182039. - Jianing Song, Nov 08 2019

Examples

			a(3) = 4 because the 4 solutions are (0,1), (0,2), (1,0), (2,0).
		

Crossrefs

Programs

  • Haskell
    a060968 1 = 1
    a060968 n = (if p == 2 then (if e == 1 then 2 else 2^(e+1)) else 1) *
       (product $ zipWith (*) (map (\q -> q - 2 + mod q 4) ps'')
                              (zipWith (^) ps'' (map (subtract 1) es'')))
       where (ps'', es'') = if p == 2 then (ps, es) else (ps', es')
             ps'@(p:ps) = a027748_row n; es'@(e:es) = a124010_row n
    -- Reinhard Zumkeller, Aug 05 2014
  • Mathematica
    fa=FactorInteger; phi[p_,s_] := Which[Mod[p,4] == 1, p^(s-1)*(p-1), Mod[p,4]==3, p^(s-1)*(p+1), s==1, 2, True, 2^(s+1)]; phi[1]=1; phi[n_] := Product[phi[fa[n][[i,1]], fa[n][[i,2]]], {i, Length[fa[n]]}]; Table[phi[n], {n,1,100}]
  • PARI
    a(n)=my(f=factor(n)[,1]);n*prod(i=if(n%2,1,2),#f,if(f[i]%4==1, 1-1/f[i], 1+1/f[i]))*if(n%4,1,2) \\ Charles R Greathouse IV, Apr 16 2012
    

Formula

Multiplicative, with a(2^e) = 2 if e = 1 or 2^(e+1) if e > 1, a(p^e) = (p-1)*p^(e-1) if p == 1 (mod 4), a(p^e) = (p+1)*p^(e-1) if p == 3 (mod 4). - David W. Wilson, Jun 19 2001
a(n) = n * (Product_{prime p|n, p == 1 (mod 4)} (1 - 1/p)) * (Product_{prime p|n, p == 3 (mod 4)} (1 + 1/p)) * (1 + [4|n]) where "[ ]" is the Iverson bracket. - Ola Veshta (olaveshta(AT)my-deja.com), May 18 2001
a(n) = A182039(n)/A060594(n). - Jianing Song, Nov 08 2019
Sum_{k=1..n} a(k) ~ c * n^2 + O(n*log(n)), where c = 5/(8*G) = 0.682340..., where G is Catalan's constant (A006752) (Tóth, 2014). - Amiram Eldar, Oct 18 2022

A046073 Number of squares in multiplicative group modulo n.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 3, 1, 3, 2, 5, 1, 6, 3, 2, 2, 8, 3, 9, 2, 3, 5, 11, 1, 10, 6, 9, 3, 14, 2, 15, 4, 5, 8, 6, 3, 18, 9, 6, 2, 20, 3, 21, 5, 6, 11, 23, 2, 21, 10, 8, 6, 26, 9, 10, 3, 9, 14, 29, 2, 30, 15, 9, 8, 12, 5, 33, 8, 11, 6, 35, 3, 36, 18, 10, 9, 15, 6, 39, 4, 27, 20, 41, 3, 16, 21
Offset: 1

Views

Author

Keywords

Comments

a(n) is the number of different diagonal elements in Cayley table for multiplicative group modulo n. But the fact that the same number of different elements are on the diagonal of the Cayley table does not mean in every case that these groups are isomorphic. - Artur Jasinski, Jul 03 2010
The number of quadratic residues modulo n that are coprime to n. These residues are listed in A096103. - Peter Munn, Mar 10 2021

References

  • Daniel Shanks, Solved and Unsolved Problems in Number Theory, 4th ed. New York: Chelsea, p. 95, 1993.

Crossrefs

Row lengths of A096103.
Positions of ones: A018253.

Programs

  • Maple
    F:= n -> nops({seq}(`if`(igcd(t,n)=1,t^2 mod n,NULL), t=1..floor(n/2))):
    1, seq(F(n), n=2..100); # Robert Israel, Jan 04 2015
    # 2nd program
    A046073 := proc(n)
        local a,p,e,pf;
        a := 1;
        for pf in ifactors(n)[2] do
            p := op(1,pf) ;
            e := op(2,pf) ;
            if p = 2 then
                a := a*p^max(e-3,0) ;
            else
                a := a*(p-1)/2*p^(e-1) ;
            end if;
        end do:
        a ;
    end proc: # R. J. Mathar, Oct 03 2016
  • Mathematica
    Table[EulerPhi[n]/Sum[Boole[Mod[k^2, n] == 1] + Boole[n == 1], {k, n}], {n, 86}] (* or *)
    Table[Apply[Times, FactorInteger[n] /. {p_, e_} /; p > 0 :> Which[p == 1, 1, p == 2, 2^Max[e - 3, 0], True, (p - 1) p^(e - 1)/2]], {n, 86}] (* Michael De Vlieger, Jul 18 2017 *)
  • PARI
    A060594(n) = if(n<=2, 1, 2^#znstar(n)[3]); \\ This function from Joerg Arndt, Jan 06 2015
    A046073(n) = eulerphi(n)/A060594(n); \\ Antti Karttunen, Jul 17 2017, after Sharon Sela's Mar 09 2002 formula.
    
  • PARI
    A046073(n)=if(n>4,(n=znstar(n))[1]>>#n[3],1) \\ Avoids duplicate computation of phi(n). - M. F. Hasler, Nov 27 2017, typo fixed Mar 11 2021
    
  • Python
    from sympy import factorint, prod
    def a(n): return 1 if n==1 else prod([2**max(e - 3, 0) if p==2 else (p - 1)*p**(e - 1)//2 for p, e in factorint(n).items()])
    print([a(n) for n in range(1, 51)]) # Indranil Ghosh, Jul 17 2017
  • Scheme
    (define (A046073 n) (cond ((= 1 n) n) ((even? n) (* (A000079 (max (- (A007814 n) 3) 0)) (A046073 (A028234 n)))) (else (* (/ 1 2) (- (A020639 n) 1) (/ (A028233 n) (A020639 n)) (A046073 (A028234 n)))))) ;; Antti Karttunen, Jul 17 2017, after the given multiplicative formula.
    

Formula

a(n) * A060594(n) = A000010(n) = phi(n) (This gives a formula for a(n) using the one in A060594(n) ). - Sharon Sela (sharonsela(AT)hotmail.com), Mar 09 2002
Multiplicative with a(2^e) = 2^max(e-3,0), a(p^e) = (p-1)*p^(e-1)/2 for p an odd prime.
Sum_{k=1..n} a(k) ~ c * n^2/sqrt(log(n)), where c = (43/(80*sqrt(Pi))) * Product_{p prime} (1+1/(2*p))*sqrt(1-1/p) = 0.24627260085060864229... (Finch and Sebah, 2006). - Amiram Eldar, Oct 18 2022

Extensions

Edited and verified by Franklin T. Adams-Watters, Nov 07 2006

A060839 Number of solutions to x^3 == 1 (mod n).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 3, 1, 3, 1, 1, 1, 3, 3, 1, 1, 1, 3, 3, 1, 3, 1, 1, 1, 1, 3, 3, 3, 1, 1, 3, 1, 1, 1, 3, 3, 3, 3, 3, 1, 1, 3, 3, 1, 3, 1, 1, 1, 3, 1, 1, 3, 1, 3, 1, 3, 3, 1, 1, 1, 3, 3, 9, 1, 3, 1, 3, 1, 1, 3, 1, 3, 3, 3, 1, 3, 3, 3, 3, 1, 3, 1, 1, 3, 1, 3, 1, 1, 1, 3, 9, 1, 3, 1, 3, 1, 3, 3, 3, 1, 1, 1, 3, 3, 3
Offset: 1

Views

Author

Ahmed Fares (ahmedfares(AT)my-deja.com), May 02 2001

Keywords

Comments

Sum_{k=1..n} a(k) appears to be asymptotic to C*n*log(n) with C = 0.4... - Benoit Cloitre, Aug 19 2002 [C = (11/(6*Pi*sqrt(3))) * Product_{p prime == 1 (mod 3)} (1 - 2/(p*(p+1))) = 0.3170565167... (Finch and Sebah, 2006). - Amiram Eldar, Mar 26 2021]

Examples

			a(7) = 3 because the three solutions to x^3 == 1 (mod 7) are x = 1,2,4.
		

Crossrefs

Cf. A005088, A357905 (base-3 logarithm).
Number of solutions to x^k == 1 (mod n): A060594 (k=2), this sequence (k=3), A073103 (k=4), A319099 (k=5), A319100 (k=6), A319101 (k=7), A247257 (k=8).
Column 3 of A354057.

Programs

  • Maple
    A060839 := proc(n)
        local a,pf,p,r;
        a := 1 ;
        for pf in ifactors(n)[2] do
            p := op(1,pf);
            r := op(2,pf);
            if p = 2 then
                ;
            elif p =3 then
                if r >= 2 then
                    a := a*3 ;
                end if;
            else
                if modp(p,3) = 2 then
                    ;
                else
                    a := 3*a ;
                end if;
            end if;
        end do:
        a ;
    end proc:
    seq(A060839(n),n=1..40) ; # R. J. Mathar, Mar 02 2015
  • Mathematica
    a[n_] := Sum[ If[ Mod[k^3-1, n] == 0, 1, 0], {k, 1, n}]; Table[ a[n], {n, 1, 105}](* Jean-François Alcover, Nov 14 2011, after PARI *)
    f[p_, e_] := If[Mod[p, 3] == 1, 3, 1]; f[3, 1] = 1; f[3, e_] := 3; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Aug 10 2023 *)
  • PARI
    a(n)=sum(i=1,n,if((i^3-1)%n,0,1))
    
  • PARI
    a(n)=my(f=factor(n)); prod(i=1, #f~, if(f[i, 1]==3, 3^min(f[i, 2]-1, 1), if(f[i, 1]%3==1, 3, 1))) \\ Jianing Song, Oct 21 2022
  • Python
    from math import prod
    from sympy import factorint
    def A060839(n): return prod(3 for p, e in factorint(n).items() if (p!=3 or e!=1) and p%3!=2) # Chai Wah Wu, Oct 19 2022
    

Formula

Let b(n) be the number of primes dividing n which are congruent to 1 (mod 3) (sequence A005088); then a(n) is 3^b(n) if n is not divisible by 9 and 3^(b(n) + 1) if n is divisible by 9.
Multiplicative with a(3) = 1, a(3^e) = 3, e >= 2, a(p^e) = 3 for primes p of the form 3k+1, a(p^e) = 1 for primes p of the form 3k+2. - David W. Wilson, May 22 2005 [Corrected by Jianing Song, Oct 21 2022]
If the multiplicative group of integers modulo n has (Z/nZ)* = C_{k_1} X C_{k_2} X ... X C_{k_r}, then a(n) = Product_{i=1..r} gcd(3,k_r). - Jianing Song, Oct 21 2022

A073103 Number of solutions to x^4 == 1 (mod n).

Original entry on oeis.org

1, 1, 2, 2, 4, 2, 2, 4, 2, 4, 2, 4, 4, 2, 8, 8, 4, 2, 2, 8, 4, 2, 2, 8, 4, 4, 2, 4, 4, 8, 2, 8, 4, 4, 8, 4, 4, 2, 8, 16, 4, 4, 2, 4, 8, 2, 2, 16, 2, 4, 8, 8, 4, 2, 8, 8, 4, 4, 2, 16, 4, 2, 4, 8, 16, 4, 2, 8, 4, 8, 2, 8, 4, 4, 8, 4, 4, 8, 2, 32, 2, 4, 2, 8, 16, 2, 8, 8, 4, 8, 8, 4, 4, 2, 8, 16, 4, 2, 4, 8
Offset: 1

Views

Author

Benoit Cloitre, Aug 19 2002

Keywords

Comments

a(n) = 2*A060594(n) for n = 5, 10, 13, 15, 16, 17, 20, 25, 26, 29, .... This subsequence, which contains all the primes of form 4k+1, seems to be asymptotic to 2n.
Shadow transform of A123865. - Michel Marcus, Jun 06 2013

Crossrefs

Programs

  • Maple
    a:= n-> add(`if`(irem(j^4-1, n)=0, 1, 0), j=0..n-1):
    seq(a(n), n=1..120);  # Alois P. Heinz, Jun 06 2013
    # alternative
    A073103 := proc(n)
        local a,pf,p,r;
        a := 1 ;
        for pf in ifactors(n)[2] do
            p := op(1,pf);
            r := op(2,pf);
            if p = 2 then
                a := a*p^min(r-1,3) ;
            else
                if modp(p,4) = 1 then
                    a := 4*a ;
                else
                    a := 2*a ;
                end if;
            end if;
        end do:
        a ;
    end proc: # R. J. Mathar, Mar 02 2015
  • Mathematica
    a[n_] := Sum[If[Mod[j^4-1, n] == 0, 1, 0], {j, 0, n-1}]; Table[a[n], {n, 1, 120}] (* Jean-François Alcover, Jun 12 2015, after Alois P. Heinz *)
    f[2, e_] := 2^Min[e-1, 3]; f[p_, e_] := If[Mod[p, 4] == 1, 4, 2]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Sep 17 2020 *)
  • PARI
    a(n)=sum(i=1,n,if((i^4-1)%n,0,1))
    
  • PARI
    a(n)=my(f=factor(n)); prod(i=1,#f~, if(f[i,1]==2, 2^min(f[i,2]-1,3), if(f[i,1]%4==1, 4, 2))) \\ Charles R Greathouse IV, Mar 02 2015
    
  • Python
    from math import prod
    from sympy import primefactors
    def A073103(n): return (1<>1) for p in primefactors(n>>s)) # Chai Wah Wu, Oct 26 2022

Formula

Sum_{k=1..n} a(k) seems to be asymptotic to C*n*Log(n) with C>1.4...(when Sum_{k=1..n} A060594(k) is asymptotic to C/2*n*Log(n)).
Multiplicative with a(p^e) = p^min(e-1, 3) if p = 2, 4 if p == 1 (mod 4), 2 if p == 3 (mod 4). - David W. Wilson, Jun 09 2005
In fact, Sum_{k=1..n} a(k) is asymptotic to c*n*log(n)^2 where 2*c=0.190876.... - Steven Finch, Aug 12 2009 [c = 7/(2*Pi^3) * Product_{p prime == 1 (mod 4)} (1 - 4/(p+1)^2) = 0.0954383605... (Finch et al., 2010). - Amiram Eldar, Mar 26 2021]

A319100 Number of solutions to x^6 == 1 (mod n).

Original entry on oeis.org

1, 1, 2, 2, 2, 2, 6, 4, 6, 2, 2, 4, 6, 6, 4, 4, 2, 6, 6, 4, 12, 2, 2, 8, 2, 6, 6, 12, 2, 4, 6, 4, 4, 2, 12, 12, 6, 6, 12, 8, 2, 12, 6, 4, 12, 2, 2, 8, 6, 2, 4, 12, 2, 6, 4, 24, 12, 2, 2, 8, 6, 6, 36, 4, 12, 4, 6, 4, 4, 12, 2, 24, 6, 6, 4, 12, 12, 12, 6, 8, 6, 2
Offset: 1

Views

Author

Jianing Song, Sep 10 2018

Keywords

Comments

All terms are 3-smooth. a(n) is even for n > 2. Those n such that a(n) = 2 are in A066501.

Examples

			Solutions to x^6 == 1 (mod 13): x == 1, 3, 4, 9, 10, 12 (mod 13).
Solutions to x^6 == 1 (mod 27): x == 1, 8, 10, 17, 19, 26 (mod 27) (x == 1, 8 (mod 9)).
Solutions to x^6 == 1 (mod 37): x == 1, 10, 11, 26, 27, 36 (mod 37).
		

Crossrefs

Number of solutions to x^k == 1 (mod n): A060594 (k=2), A060839 (k=3), A073103 (k=4), A319099 (k=5), this sequence (k=6), A319101 (k=7), A247257 (k=8).
Mobius transform gives A307381.

Programs

  • PARI
    a(n)=my(Z=znstar(n)[2]); prod(i=1, #Z, gcd(6, Z[i]))

Formula

Multiplicative with a(2) = 1, a(4) = 2, a(2^e) = 4 for e >= 3; a(3) = 2, a(3^e) = 6 if e >= 2; for other primes p, a(p^e) = 6 if p == 1 (mod 6), a(p^e) = 2 if p == 5 (mod 6).
If the multiplicative group of integers modulo n is isomorphic to C_{k_1} x C_{k_2} x ... x C_{k_m}, where k_i divides k_j for i < j; then a(n) = Product_{i=1..m} gcd(6, k_i).
a(n) = A060594(n)*A060839(n).
For n > 2, a(n) = A060839(n)*2^A046072(n).
a(n) = A060594(n) iff n is not divisible by 9 and no prime factor of n is congruent to 1 mod 6, that is, n in A088232.
a(n) = A000010(n)/A293483(n). - Jianing Song, Nov 10 2019
Sum_{k=1..n} a(k) ~ c * n * log(n)^3, where c = (1/Pi^4) * Product_{p prime == 1 (mod 6)} (1 - (12*p-4)/(p+1)^3) = 0.0075925601... (Finch et al., 2010). - Amiram Eldar, Mar 26 2021

A304182 Number of primitive inequivalent mirror-symmetric sublattices of rectangular lattice of index n.

Original entry on oeis.org

1, 3, 2, 4, 2, 6, 2, 4, 2, 6, 2, 8, 2, 6, 4, 4, 2, 6, 2, 8, 4, 6, 2, 8, 2, 6, 2, 8, 2, 12, 2, 4, 4, 6, 4, 8, 2, 6, 4, 8, 2, 12, 2, 8, 4, 6, 2, 8, 2, 6, 4, 8, 2, 6, 4, 8, 4, 6, 2, 16, 2, 6, 4, 4, 4, 12, 2, 8, 4, 12, 2, 8, 2, 6, 4, 8, 4, 12, 2, 8, 2, 6, 2, 16, 4
Offset: 1

Views

Author

Andrey Zabolotskiy, May 07 2018

Keywords

Examples

			There are 6 = A001615(4) lattices in Z^2 whose quotient group is C_4. The reflection through an axis relates <(4,0), (1,1)> and <(4,0), (3,1)>. The remaining 4 = a(4) lattices are fixed.
		

Crossrefs

Cf. A069735 (not only primitive sublattices), A304183 (primitive oblique sublattices), A069734 (all sublattices).
Cf. other columns of tables 4 and 5 from [Rutherford, 2009]: A001615, A060594, A157223, A000089, A157224, A000086, A157227, A019590, A157228, A157226, A157230, A157231, A154272, A157235.

Programs

  • Mathematica
    f[p_, e_] := If[p == 2, If[e == 1, 3, 4], 2]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Oct 22 2022 *)

Formula

From Álvar Ibeas, Mar 18 2021: (Start)
For n odd, a(n) = A034444(n) = 2^(A001221(n)).
For n even, a(n) = A034444(n) + A034444(n/2). If 4|n, a(n) = 2^(A001221(n) + 1); otherwise, a(n) = 3 * 2^(A001221(n) - 1).
Multiplicative with a(2) = 3, a(2^e) = 4 (for e>1), and a(p^e) = 2 (for p>2).
Dirichlet g.f.: (1+2^(-s)) * zeta(s)^2 / zeta(2s).
(End)
Sum_{k=1..n} a(k) ~ (log(n) + 2*gamma - log(2)/3 - 2*zeta'(2)/zeta(2) - 1)*9*n/Pi^2, where gamma is Euler's constant (A001620). - Amiram Eldar, Dec 31 2022

A102476 Least modulus with 2^n square roots of 1.

Original entry on oeis.org

1, 3, 8, 24, 120, 840, 9240, 120120, 2042040, 38798760, 892371480, 25878772920, 802241960520, 29682952539240, 1217001054108840, 52331045326680120, 2459559130353965640, 130356633908760178920, 7691041400616850556280
Offset: 0

Views

Author

David W. Wilson, Jan 10 2005

Keywords

Comments

The number of square roots of 1 in any modulus is a power of 2.
Another way of expressing the same: These are also the record setting values of m for the number of solutions to "m*k+1 is a square", for some k, 0<=k<=m. There is 1 solution for a(0)=m=1, and for m = a(n), n>0, there is the first occurrence of 2^n solutions. Compare with A006278. - Richard R. Forberg, Mar 18 2016
Also a(n) is the least k such that the proportion of squares in a reduced residue system modulo n is 1/2^n, i.e. A046073(k)/A000010(k) = 1/2^n. - Jianing Song, Nov 12 2019
From Jianing Song, Oct 18 2021: (Start)
a(n) is the smallest k such that rank((Z/kZ)*) = n. The rank of a finitely generated group rank(G) is defined to be the size of the minimal generating sets of G. In particular, rank((Z/kZ)*) = 0 if k <= 2 and A046072(k) otherwise.
The number of coprime squares modulo a(n) is given by A046073(a(n)) = A323739(n-1) for n >= 2. (End)

Examples

			a(3) = 24 because 24 is the least modulus with 2^3 square roots of 1, namely 1,5,7,11,13,17,19,23.
		

Crossrefs

Programs

  • Mathematica
    {1, 3}~Join~Table[4 Product[Prime[k], {k, n}], {n, 17}] (* Michael De Vlieger, Mar 27 2016 *)
    nxt[{a_, p_}] := {a*NextPrime[p], NextPrime[p]}; Join[{1,3},NestList[nxt,{8,2},20][[All,1]]] (* or *) Join[{1,3},4*FoldList[ Times, Prime[ Range[ 21]]]](* Harvey P. Dale, Dec 18 2016 *)
  • PARI
    a(n) = if(n<=1, [1,3][n+1], 4*factorback(primes(n-1))) \\ Jianing Song, Oct 19 2021, following David A. Corneth's program for A002110

Formula

a(n) = 4(prime(n-1))# = 4*A002110(n-1) for n >= 2. Least k with A060594(k) = 2^n.

A319099 Number of solutions to x^5 == 1 (mod n).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 1, 5, 1, 1, 1, 1, 1, 5, 1, 5, 1, 1, 1, 1, 1, 1, 1, 5, 1, 1, 5, 1, 1, 1, 1, 1, 5, 1, 1, 1, 1, 5, 1, 1, 1, 1, 1, 5, 5, 1, 1, 1, 5, 1, 1, 1, 1, 5, 1, 1, 1, 5, 1, 5, 1, 1, 1, 1, 5, 1, 1, 1, 1, 1
Offset: 1

Views

Author

Jianing Song, Sep 10 2018

Keywords

Comments

All terms are powers of 5. Those n such that a(n) > 1 are in A066500.

Examples

			Solutions to x^5 == 1 (mod 11): x == 1, 3, 4, 5, 9 (mod 11).
Solutions to x^5 == 1 (mod 25): x == 1, 6, 11, 16, 21 (mod 25) (x == 1 (mod 5)).
Solutions to x^5 == 1 (mod 31): x == 1, 2, 4, 8, 16 (mod 31).
		

Crossrefs

Number of solutions to x^k == 1 (mod n): A060594 (k=2), A060839 (k=3), A073103 (k=4), this sequence (k=5), A319100 (k=6), A319101 (k=7), A247257 (k=8).
Mobius transform gives A307380.

Programs

  • Mathematica
    f[p_, e_] := If[Mod[p, 5] == 1, 5, 1]; f[5, 1] = 1; f[5, e_] := 5; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Aug 10 2023 *)
  • PARI
    a(n)=my(Z=znstar(n)[2]); prod(i=1,#Z,gcd(5,Z[i]));

Formula

Multiplicative with a(5) = 1, a(5^e) = 5 if e >= 2; for other primes p, a(p^e) = 5 if p == 1 (mod 5), a(p^e) = 1 otherwise.
If the multiplicative group of integers modulo n is isomorphic to C_{k_1} x C_{k_2} x ... x C_{k_m}, where k_i divides k_j for i < j; then a(n) = Product_{i=1..m} gcd(5, k_i).
a(n) = A000010(n)/A293482(n). - Jianing Song, Nov 10 2019
Showing 1-10 of 56 results. Next