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

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

A293482 The number of 5th powers in the multiplicative group modulo n.

Original entry on oeis.org

1, 1, 2, 2, 4, 2, 6, 4, 6, 4, 2, 4, 12, 6, 8, 8, 16, 6, 18, 8, 12, 2, 22, 8, 4, 12, 18, 12, 28, 8, 6, 16, 4, 16, 24, 12, 36, 18, 24, 16, 8, 12, 42, 4, 24, 22, 46, 16, 42, 4, 32, 24, 52, 18, 8, 24, 36, 28, 58, 16, 12, 6, 36, 32, 48, 4, 66, 32, 44, 24, 14, 24, 72, 36, 8, 36, 12, 24, 78, 32, 54, 8, 82, 24
Offset: 1

Views

Author

R. J. Mathar, Oct 10 2017

Keywords

Comments

The size of the set of numbers j^5 mod n, gcd(j,n)=1, 1 <= j <= n.
A000010(n) / a(n) is another multiplicative integer sequence.

Crossrefs

The number of k-th powers in the multiplicative group modulo n: A046073 (k=2), A087692 (k=3), A250207 (k=4), this sequence (k=5), A293483 (k=6), A293484 (k=7), A293485 (k=8).

Programs

  • Maple
    A293482 := proc(n)
        local r,j;
        r := {} ;
        for j from 1 to n do
            if igcd(j,n)= 1 then
                r := r union { modp(j &^ 5,n) } ;
            end if;
        end do:
        nops(r) ;
    end proc:
    seq(A293482(n),n=1..120) ;
  • Mathematica
    a[n_] := Module[{r, j}, r = {}; For[j = 1, j <= n, j++, If[GCD[j, n] == 1, r = r ~Union~ {PowerMod[j, 5, n]}] ]; Length[r]];
    Table[a[n], {n, 1, 120}] (* Jean-François Alcover, Feb 14 2023, after R. J. Mathar *)
    f[p_, e_] := (p - 1)*p^(e - 1)/If[Mod[p, 5] == 1, 5, 1]; f[2, e_] := 2^(e - 1); f[2, 1] = 1; f[5, e_] := 4*5^(e-2); f[5, 1] = 4; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Aug 10 2023 *)

Formula

Conjecture: a(2^e) = 1 for e <= 1; a(2^e) = 2^(e-1) for e >= 1; a(5)=4; a(5^e) = 4*5^(e-2) for e > 1; a(p^e) = (p-1)*p^(e-1) for p == {2,3,4} (mod 5); a(p^e) = (p-1)*p^(e-1)/5 for p == 1 (mod 5). - R. J. Mathar, Oct 13 2017
a(n) = A000010(n)/A319099(n). This implies that the conjecture above is true. - Jianing Song, Nov 10 2019

A250207 The number of quartic terms in the multiplicative group modulo n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 3, 1, 3, 1, 5, 1, 3, 3, 1, 1, 4, 3, 9, 1, 3, 5, 11, 1, 5, 3, 9, 3, 7, 1, 15, 2, 5, 4, 3, 3, 9, 9, 3, 1, 10, 3, 21, 5, 3, 11, 23, 1, 21, 5, 4, 3, 13, 9, 5, 3, 9, 7, 29, 1, 15, 15, 9, 4, 3, 5, 33, 4, 11, 3, 35, 3, 18, 9, 5, 9, 15, 3, 39, 1
Offset: 1

Views

Author

R. J. Mathar, Mar 02 2015

Keywords

Comments

In the character table of the multiplicative group modulo n there are phi(n) different characters. [This is made explicit for example by the number of rows in arXiv:1008.2547.] The set of the fourth powers of the characters in all representations has some cardinality, which defines the sequence.

Examples

			For n <= 6, the set of all characters in all representations consists of a subset of +1, -1, +i or -i. Their fourth powers are all +1, a single value, so a(n)=1 then.
For n=7, the set of characters is 1, -1, +-1/2 +- sqrt(3)*i/2, so their fourth powers are 1 or -1/2 +- sqrt(3)*i/2, which are three different values, so a(7)=3.
For n=11, the fourth powers of the characters may be 1, exp(+-2*i*Pi/5) or exp(+-4*i*Pi/5), which are 5 different values.
		

Crossrefs

Programs

  • Maple
    A250207 := proc(n)
        numtheory[phi](n)/A073103(n) ;
    end proc:
  • Mathematica
    a[n_] := EulerPhi[n]/Count[Range[0, n-1]^4 - 1, k_ /; Divisible[k, n]];
    Array[a, 80] (* Jean-François Alcover, Nov 20 2017 *)
    f[p_, e_] := (p - 1)*p^(e - 1)/If[Mod[p, 4] == 1, 4, 2]; f[2, e_] := If[e <= 3, 1, 2^(e - 4)]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Aug 10 2023 *)
  • PARI
    a(n)=my(f=factor(n)); prod(i=1,#f~, if(f[i,1]==2, 2^max(0,f[i,2]-4), f[i,1]^(f[i,2]-1)*(f[i,1]-1)/if(f[i,1]%4==1,4,2))) \\ Charles R Greathouse IV, Mar 02 2015

Formula

a(n) = A000010(n)/A073103(n).
Multiplicative with a(2^e) = 1 for e<=3; a(2^e) = 2^(e-4) for e>=4; a(p^e) = p^(e-1)*(p-1)/4 for e>=1 and p == 1 (mod 4); a(p^e) = p^(e-1)*(p-1)/2 for e>=1 and p == 3 (mod 4). (Derived from A073103.) - R. J. Mathar, Oct 13 2017

A293483 The number of 6th powers in the multiplicative group modulo n.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 5, 1, 2, 1, 2, 2, 8, 1, 3, 2, 1, 5, 11, 1, 10, 2, 3, 1, 14, 2, 5, 4, 5, 8, 2, 1, 6, 3, 2, 2, 20, 1, 7, 5, 2, 11, 23, 2, 7, 10, 8, 2, 26, 3, 10, 1, 3, 14, 29, 2, 10, 5, 1, 8, 4, 5, 11, 8, 11, 2, 35, 1, 12, 6, 10, 3, 5, 2, 13, 4, 9, 20
Offset: 1

Views

Author

R. J. Mathar, Oct 10 2017

Keywords

Comments

The size of the set of numbers j^6 mod n, gcd(j,n)=1, 1 <= j <= n.
A000010(n) / a(n) is another multiplicative integer sequence.

Crossrefs

The number of k-th powers in the multiplicative group modulo n: A046073 (k=2), A087692 (k=3), A250207 (k=4), A293482 (k=5), this sequence (k=6), A293484 (k=7), A293485 (k=8).

Programs

  • Maple
    A293483 := proc(n)
        local r,j;
        r := {} ;
        for j from 1 to n do
            if igcd(j,n)= 1 then
                r := r union { modp(j &^ 6,n) } ;
            end if;
        end do:
        nops(r) ;
    end proc:
    seq(A293483(n),n=1..120) ;
  • Mathematica
    a[n_] := EulerPhi[n]/Count[Range[0, n - 1]^6 - 1, k_ /; Divisible[k, n]];
    Array[a, 100] (* Jean-François Alcover, May 24 2023 *)
    f[p_, e_] := (p - 1)*p^(e - 1)/If[Mod[p, 6] == 1, 6, 2]; f[2, e_] := If[e <= 3, 1, 2^(e - 3)]; f[3, e_] := If[e <= 2, 1, 3^(e - 2)]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Aug 10 2023 *)

Formula

Conjecture: a(2^e) = 1 for e <= 3; a(2^e) = 2^(e-3) for e >= 3; a(3^e) = 1 for e <= 2; a(3^e) = 3^(e-2) for e >= 2; a(p^e) = (p-1)*p^(e-1)/2 for p == 5 (mod 6); a(p^e) = (p-1)*p^(e-1)/6 for p == 1 (mod 6). - R. J. Mathar, Oct 13 2017
a(n) = A000010(n)/A319100(n). This implies that the conjecture above is true. - Jianing Song, Nov 10 2019

A293484 The number of 7th powers in the multiplicative group modulo n.

Original entry on oeis.org

1, 1, 2, 2, 4, 2, 6, 4, 6, 4, 10, 4, 12, 6, 8, 8, 16, 6, 18, 8, 12, 10, 22, 8, 20, 12, 18, 12, 4, 8, 30, 16, 20, 16, 24, 12, 36, 18, 24, 16, 40, 12, 6, 20, 24, 22, 46, 16, 6, 20, 32, 24, 52, 18, 40, 24, 36, 4, 58, 16, 60, 30, 36, 32, 48, 20, 66, 32, 44, 24, 10, 24, 72, 36, 40, 36
Offset: 1

Views

Author

R. J. Mathar, Oct 10 2017

Keywords

Comments

The size of the set of numbers j^7 mod n, gcd(j,n)=1, 1 <= j <= n.
A000010(n) / a(n) is another multiplicative integer sequence (size of the kernel of the isomorphism of the multiplicative group modulo n to the multiplicative group of 7th powers modulo n).

Crossrefs

The number of k-th powers in the multiplicative group modulo n: A046073 (k=2), A087692 (k=3), A250207 (k=4), A293482 (k=5), A293483 (k=6), this sequence (k=7), A293485 (k=8).

Programs

  • Maple
    A293484 := proc(n)
        local r,j;
        r := {} ;
        for j from 1 to n do
            if igcd(j,n)= 1 then
                r := r union { modp(j &^ 7,n) } ;
            end if;
        end do:
        nops(r) ;
    end proc:
    seq(A293484(n),n=1..120) ;
  • Mathematica
    a[n_] := EulerPhi[n]/Count[Range[0, n - 1]^7 - 1, k_ /; Divisible[k, n]];
    Array[a, 100] (* Jean-François Alcover, May 24 2023 *)
    f[p_, e_] := (p-1)*p^(e-1)/If[Mod[p, 7] == 1, 7, 1]; f[2, e_] := 2^(e-1); f[7, 1] = 6; f[7, e_] := 6*7^(e-2); a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Aug 10 2023 *)

Formula

Conjecture: a(2^e) = 1 for e <= 1; a(2^e) = 2^(e-1) for e >= 1; a(7^e) = 6 for e=1; a(7^e) = 6*7^(e-2) for e >= 2; a(p^e) = (p-1)*p^(e-1) for p == {2,3,4,5,6} (mod 7); a(p^e) = (p-1)*p^(e-1)/7 for p == 1 (mod 7). - R. J. Mathar, Oct 13 2017
a(n) = A000010(n)/A319101(n). This implies that the conjecture above is true. - Jianing Song, Nov 10 2019

A293485 The number of 8th powers in the multiplicative group modulo n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 3, 1, 3, 1, 5, 1, 3, 3, 1, 1, 2, 3, 9, 1, 3, 5, 11, 1, 5, 3, 9, 3, 7, 1, 15, 1, 5, 2, 3, 3, 9, 9, 3, 1, 5, 3, 21, 5, 3, 11, 23, 1, 21, 5, 2, 3, 13, 9, 5, 3, 9, 7, 29, 1, 15, 15, 9, 2, 3, 5, 33, 2, 11, 3, 35, 3, 9, 9, 5, 9, 15, 3, 39, 1, 27, 5, 41, 3, 2
Offset: 1

Views

Author

R. J. Mathar, Oct 10 2017

Keywords

Comments

The size of the set of numbers j^8 mod n, gcd(j,n)=1, 1<=j<=n.

Crossrefs

The number of k-th powers in the multiplicative group modulo n: A046073 (k=2), A087692 (k=3), A250207 (k=4), A293482 (k=5), A293483 (k=6), A293484 (k=7), this sequence (k=8).
Cf. A085311, A247257 (order of the kernel isomorphism of Z/nZ to this group), A000010.

Programs

  • Maple
    A293485 := proc(n)
        local r,j;
        r := {} ;
        for j from 1 to n do
            if igcd(j,n)= 1 then
                r := r union { modp(j &^ 8,n) } ;
            end if;
        end do:
        nops(r) ;
    end proc:
    seq(A293485(n),n=1..120) ;
  • Mathematica
    a[n_] := EulerPhi[n]/Count[Range[0, n - 1]^8 - 1, k_ /; Divisible[k, n]];
    Array[a, 100] (* Jean-François Alcover, May 24 2023 *)
    f[p_, e_] := (p - 1)*p^(e - 1)/Switch[Mod[p, 8], 1, 8, 5, 4, , 2]; f[2, e] := If[e <= 4, 1, 2^(e - 5)]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Aug 10 2023 *)
  • PARI
    \\ The following two functions by Charles R Greathouse IV, from A247257:
    g(p, e) = if(p==2, 2^min(e-1, 4), if(p%4==3, 2, if(p%8==5, 4, 8)));
    A247257(n) = my(f=factor(n)); prod(i=1, #f~, g(f[i, 1], f[i, 2]));
    A293485(n) = (eulerphi(n)/A247257(n)); \\ Antti Karttunen, Dec 05 2017

Formula

A000010(n) / a(n) = A247257(n).
Multiplicative with a(2^e) = 1 for e<=4, a(2^e) = 2^(e-5) for e>=5; a(p^e) = (p-1)*p^(e-1)/8 for p == 1 (mod 8); a(p^e) = (p-1)*p^(e-1)/4 for p == 5 (mod 8); a(p^e) = (p-1)*p^(e-1)/2 for p == {3,7} (mod 8). - R. J. Mathar, Oct 15 2017 [corrected by Georg Fischer, Jul 21 2022]

A096107 Triangle read by rows: row n lists cubic residues modulo n.

Original entry on oeis.org

1, 1, 2, 1, 3, 1, 2, 3, 4, 1, 5, 1, 6, 1, 3, 5, 7, 1, 8, 1, 3, 7, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 5, 7, 11, 1, 5, 8, 12, 1, 13, 1, 2, 4, 7, 8, 11, 13, 14, 1, 3, 5, 7, 9, 11, 13, 15, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 1, 17, 1, 7, 8, 11, 12, 18, 1, 3, 7, 9, 11, 13, 17, 19, 1, 8
Offset: 2

Views

Author

Cino Hilliard, Jul 22 2004

Keywords

Comments

Row n has A087692(n) terms. - Robert Israel, Jan 04 2015

Examples

			1;
1,2;
1,3;
1,2,3,4;
1,5;
1,6;
1,3,5,7;
1,8;
1,3,7,9;
Row 5 contains 1,2,3,4 because (in mod 5)  1^3 = 1, 3^3 = 2, 2^3 = 3, and 4^3 = 4. - _Geoffrey Critzer_, Jan 07 2015
		

Crossrefs

Programs

  • Maple
    for n from 2 to 30 do
      op({seq(`if`(igcd(i,n)=1,i^3 mod n,NULL),i=1..n-1)})
    # if using Maple 11 or earlier, replace this by
    #   op(sort(convert({seq(`if`(igcd(i,n)=1,i^3 mod n,NULL),i=1..n-1)},list)))
    od; # Robert Israel, Jan 04 2015
  • Mathematica
    Table[Select[Range[n],
       CoprimeQ[#, n] && IntegerQ[PowerMod[#, 1/3, n]] &], {n, 1, 20}] // Grid
    (* Geoffrey Critzer, Jan 04 2015 *)
  • PARI
    maybecubegcd1(n) = { for(x=2,n, b=floor(x-1); a=vector(b+1); for(y=1,b, z=y^3%x; if(z<>0, a[y]=z; ) ); s=vecsort(a); c=1; for(j=2,b+1, if(s[j]<>s[j-1], c++; if(gcd(s[j],x)==1,print1(s[j]",")) ) ); ) }

Extensions

Edited by Don Reble, May 07 2006
Showing 1-7 of 7 results.