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

A319101 Number of solutions to x^7 == 1 (mod n).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 7
Offset: 1

Views

Author

Jianing Song, Sep 10 2018

Keywords

Comments

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

Examples

			Solutions to x^7 == 1 (mod 29): x == 1, 7, 16, 20, 23, 24, 25 (mod 29).
Solutions to x^7 == 1 (mod 43): x == 1, 4, 11, 16, 21, 35, 41 (mod 43).
Solutions to x^7 == 1 (mod 49): x == 1, 8, 15, 22, 29, 36, 43 (mod 49) (x == 1 (mod 7)).
		

Crossrefs

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

Programs

  • Mathematica
    f[p_, e_] := If[Mod[p, 7] == 1, 7, 1]; f[7, 1] = 1; f[7, e_] := 7; 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(7, Z[i]))

Formula

Multiplicative with a(7) = 1, a(7^e) = 7 if e >= 2; for other primes p, a(p^e) = 7 if p == 1 (mod 7), 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(7, k_i).
a(n) = A000010(n)/A293484(n). - Jianing Song, Nov 10 2019

A114643 Number of real primitive Dirichlet characters modulo n.

Original entry on oeis.org

1, 0, 1, 1, 1, 0, 1, 2, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 2, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 2, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 2, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 2, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 2, 1
Offset: 1

Views

Author

Steven Finch, Feb 16 2006

Keywords

Comments

a(n) = 1 if either n or -n is a fundamental discriminant (not both); a(n) = 2 if n and -n are fundamental discriminants; a(n) = 0 otherwise. Also, Sum_{k=1..n} a(k) is asymptotic to (6/Pi^2)*n.
From Jianing Song, Feb 27 2019: (Start)
If n is an odd squarefree number, then a(n) = 1, where the unique real primitive Dirichlet character modulo n is {Kronecker(n,k)} = {Jacobi(k,n)} if n == 1 (mod 4) and {Kronecker(-n,k)} = {Jacobi(k,n)} if n == 3 (mod 4).
If n = 4*m, m is an odd squarefree number, then a(n) is also 1, where the unique real primitive Dirichlet character modulo n is {Kronecker(-n,k)} if m == 1 (mod 4) and {Kronecker(n,k)} if m == 3 (mod 4).
If n is 8 times an odd squarefree number, then a(n) = 2, where the two real primitive Dirichlet characters modulo n are {Kronecker(n,k)} and {Kronecker(-n,k)}.
a(n) = 0 if n == 2 (mod 4), n is divisible by 16 or the square of an odd prime. (End)
Mobius transform of A060594. - Jianing Song, Mar 02 2019

Examples

			From _Jianing Song_, Feb 27 2019: (Start)
For n = 5, the only real primitive Dirichlet characters modulo n is {Kronecker(5,k)} = [0, 1, -1, -1, 1] = A080891, so a(5) = 1.
For n = 8, the real primitive Dirichlet characters modulo n are {Kronecker(8,k)} = [0, 1, 0, -1, 0, -1, 0, 1] = A091337 and [0, 1, 0, 1, 0, -1, 0, -1] = A188510, so a(8) = 2.
For n = 20, the only real primitive Dirichlet characters modulo n is {Kronecker(-20,k)} = [0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, -1, 0, -1, 0, 0, 0, -1, 0, -1] = A289741, so a(20) = 1. (End)
		

References

  • W. Ellison and F. Ellison, Prime Numbers, Wiley, 1985, pp. 224-226.

Crossrefs

Cf. A160498 (number of cubic primitive Dirichlet characters modulo n), A160499 (number of quartic primitive Dirichlet characters modulo n).
Cf. A060594 (number of solutions to x^2 == 1 (mod n)).

Programs

  • Maple
    A114643 := 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
                if r =  1 then
                    a := 0 ;
                elif r =  2 then
                    ;
                elif r =  3 then
                    a := a*2 ;
                elif r >=  4 then
                    a := 0 ;
                end if;
            else
                if r =1 then
                    ;
                else
                    a := 0 ;
                end if;
            end if;
        end do:
        a ;
    end proc:
    seq(A114643(n),n=1..40) ; # R. J. Mathar, Mar 02 2015
    # Alternative:
    f:= proc(n) local r,v,F;
      v:= padic:-ordp(n,2);
      if v = 1 or v >= 4 then return 0
      elif v = 3 then r:= 2
      else r:= 1
      fi;
      if numtheory:-issqrfree(n/2^v) then r else 0 fi
    end proc:
    map(f, [$1..100]); # Robert Israel, Oct 08 2017
  • Mathematica
    a[n_] := Sum[ MoebiusMu[n/d] * Sum[ If[ Mod[i^2 - 1, d] == 0, 1, 0], {i, 2, d}], {d, Divisors[n]}]; a[1] = 1; Table[a[n], {n, 1, 105}] (* Jean-François Alcover, Jun 20 2013, after Steven Finch *)
    f[2, e_] := Which[e == 1, 0, e == 2, 1, e == 3, 2, e >= 4, 0]; f[p_, e_] := If[e == 1, 1, 0]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Sep 16 2020 *)
  • PARI
    a(n)=sum(d=1, n, if(n%d==0, moebius(n/d)*sum(i=1, d, if((i^2-1)%d, 0, 1)), 0)) \\ Steven Finch, Jun 09 2009

Formula

This sequence is multiplicative with a(2) = 0, a(4) = 1, a(8) = 2, a(2^r) = 0 for r > 3, a(p) = 1 for prime p > 2 and a(p^r) = 0 for r > 1. - Steven Finch, Mar 08 2006 (With correction by Jianing Song, Jun 28 2018)
Dirichlet g.f.: zeta(s)*(1 + 2^(-2s) + 2^(1-3s))/(zeta(2s)*(1 + 2^(-s))). - R. J. Mathar, Jul 03 2011

A145391 Number of inequivalent sublattices of index n in centered rectangular lattice.

Original entry on oeis.org

1, 2, 3, 5, 4, 7, 5, 10, 8, 10, 7, 17, 8, 13, 14, 19, 10, 21, 11, 24, 18, 19, 13, 35, 17, 22, 22, 31, 16, 38, 17, 36, 26, 28, 26, 50, 20, 31, 30, 50, 22, 50, 23, 45, 42, 37, 25, 69, 30, 48, 38, 52, 28, 62, 38, 65, 42, 46, 31, 90, 32, 49, 55, 69, 44, 74, 35, 66, 50, 74
Offset: 1

Views

Author

N. J. A. Sloane, Feb 23 2009

Keywords

Comments

The centered rectangular lattice has symmetry group c2mm, or cmm. For other 2D Patterson groups, the analogous sequences are A000203 (p2), A069734 (p2mm), A145392 (p4), A145393 (p4mm), A145394 (p6), A003051 (p6mm). - Andrey Zabolotskiy, Mar 12 2018

Crossrefs

Programs

  • Mathematica
    a060594[n_] := Switch[Mod[n, 8], 2|6, 2^(PrimeNu[n] - 1), 1|3|4|5|7, 2^PrimeNu[n], 0, 2^(PrimeNu[n] + 1)];
    a145390[n_] := Sum[If[IntegerQ[Sqrt[d]], a060594[n/d], 0], {d, Divisors[n]} ];
    a[n_] := (DivisorSigma[1, n] + a145390[n])/2;
    Array[a, 100] (* Jean-François Alcover, Aug 31 2018 *)

Formula

a(n) = (A000203(n) + A145390(n))/2. [Rutherford] - N. J. A. Sloane, Mar 13 2009
a(n) = Sum_{ m: m^2|n } A060594(n/m^2) + A157223(n/m^2) = A145390(n) + Sum_{ m: m^2|n } A157223(n/m^2). - Andrey Zabolotskiy, May 07 2018
a(n) = Sum_{ d|n } A004525(d+1). - Andrey Zabolotskiy, Aug 29 2019

Extensions

New name from Andrey Zabolotskiy, Mar 12 2018
New name from Andrey Zabolotskiy, Jan 19 2022

A247257 The number of octic characters modulo n.

Original entry on oeis.org

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

Views

Author

R. J. Mathar, Mar 02 2015

Keywords

Comments

Number of solutions to x^8 == 1 (mod n). - Jianing Song, Nov 10 2019

Crossrefs

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

Programs

  • Maple
    A247257 := 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
                if r >= 5 then
                    a := a*16 ;
                else
                    a := a*op(r,[1,2,4,8]) ;
                end if;
            elif modp(p,4) = 3 then
                a := a*2;
            elif modp(p,8) = 5 then
                a := a*4;
            elif modp(p,8) = 1 then
                a := a*8;
            else
                error
            end if;
        end do:
        a ;
    end proc:
  • Mathematica
    g[p_, e_] := Which[p==2, 2^Min[e-1, 4], Mod[p, 4]==3, 2, Mod[p, 8]==5, 4, True, 8];
    a[1] = 1; a[n_] := Times @@ g @@@ FactorInteger[n];
    Array[a, 80] (* Jean-François Alcover, Nov 26 2017, after Charles R Greathouse IV *)
  • PARI
    g(p,e)=if(p==2, 2^min(e-1,4), if(p%4==3, 2, if(p%8==5, 4, 8)))
    a(n)=my(f=factor(n)); prod(i=1,#f~, g(f[i,1],f[i,2])) \\ Charles R Greathouse IV, Mar 02 2015

Formula

Multiplicative with a(p^e) = p^min(e-1, 4) if p = 2, gcd(8, p-1) if p > 2. - Jianing Song, Nov 10 2019

A157230 Number of primitive inequivalent sublattices of square lattice having mirrors parallel to the diagonals of the unit cell of the parent lattice of index n.

Original entry on oeis.org

0, 0, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 1, 2, 2, 1, 1, 4, 1, 1, 1, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1, 1, 2, 4, 1, 2, 1, 2, 2, 1, 1, 4, 1, 1, 2, 2, 1, 1, 2, 4, 2, 1, 1, 4, 1, 1, 2, 2, 2, 2, 1, 2, 2, 2, 1, 4, 1, 1, 2, 2, 2, 2, 1, 4, 1, 1, 1, 4, 2, 1, 2
Offset: 1

Views

Author

N. J. A. Sloane, Feb 25 2009

Keywords

Comments

After a(2), this matches A034380 except for n = 63, 65, 80, 85, ... - R. J. Mathar, Feb 27 2009 [Updated by Andrey Zabolotskiy, May 09 2018]

Crossrefs

Cf. A145393 (all sublattices of the square lattice), A019590, A157228, A157226, A157231, A304182, A060594, A046072, A033948, A272592.

Programs

  • Mathematica
    a[n_] := If[n <= 2, 0, Sum[Boole[Mod[k^2, n] == 1], {k, 1, n}]/2];
    Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Apr 12 2023 *)

Formula

From Andrey Zabolotskiy, Sep 30 2018: (Start)
a(n) = (A060594(n) - A019590(n))/2.
a(n) = 2^(A046072(n)-1) for n>2. Thus a(n) = 1 if n>2 is in A033948, a(n) = 2 if n is in A272592, etc. (End)

Extensions

New name and more terms from Andrey Zabolotskiy, May 09 2018

A264083 Number of orthogonal 3 X 3 matrices over the ring Z/nZ.

Original entry on oeis.org

1, 6, 48, 384, 240, 288, 672, 6144, 1296, 1440, 2640, 18432, 4368, 4032, 11520, 49152, 9792, 7776, 13680, 92160, 32256, 15840, 24288, 294912, 30000, 26208, 34992, 258048, 48720, 69120, 59520, 393216, 126720, 58752, 161280, 497664, 101232, 82080, 209664, 1474560
Offset: 1

Views

Author

Charles Repizo, Nov 03 2015

Keywords

Comments

Number of matrices M = [a,b,c; d,e,f; g,h,i] with 0 <= a, b, c, d, e, f, g, h, i < n such that M*transpose(M) == [1,0,0; 0,1,0; 0,0,1] (mod n).
For n > 1, a(n) is divisible by 6*A060594(n)^3. - Robert Israel, Dec 16 2015

Crossrefs

Programs

  • Magma
    Enter R := IntegerRing(n);
    korthmat := function(R,n,k);
    O := [];
    M := MatrixAlgebra(R,n);
    for x in M do
    if x*Transpose(x) eq k*M!1 and Transpose(x)*x eq k*M!1 then
    O := Append(O,x);
    end if;
    end for;
    return O;
    end function;
    # korthmat(R,3,1);
    
  • Maple
    F:= proc(n) local R,V,nR,S,nS,Rp,nRp,i,j,a,b,c,t,r,r1,count;
          R:= select(t -> t[1]^2 + t[2]^2 + t[3]^2 mod n = 1, [seq(seq(seq([a,b,c],a=0..n-1),b=0..n-1),c=0..n-1)]);
          nR:= nops(R);
          S:= select(t -> t^2 mod n = 1, {$2..n-1});
          nS:= nops(S);
          for r in R do if not assigned(V[r]) then
             for c in S do V[c*r mod n] := 0 od
          fi od;
          R:= select(r -> not assigned(V[r]), R);
          nR:= nops(R);
          count:= 0;
          for i from 1 to nR do
            r:= R[i];
            Rp:= select(j -> R[j][1]*r[1] + R[j][2]*r[2] + R[j][3]*r[3] mod n = 0, [$i+1..nR]);
            nRp:= nops(Rp);
            for j from 1 to nRp do
                r1:= R[Rp[j]];
                count:= count + 6*(1+nS)^3*nops(select(k -> R[Rp[k]][1]*r1[1] + R[Rp[k]][2]*r1[2]+R[Rp[k]][3]*r1[3] mod n = 0, [$j+1..nRp]));
            od
          od;
          count;
    end proc:
    F(1):= 1:
    seq(F(n), n=1..40); # Robert Israel, Dec 16 2015
  • PARI
    my(t=Mod(matid(3), n)); sum(a=1, n, sum(b=1, n, sum(c=1, n, sum(d=1, n, sum(e=1, n, sum(f=1, n, sum(g=1, n, sum(h=1, n, sum(i=1, n, my(M=[a, b, c; d, e, f; g, h, i]); M*M~==t))))))))) \\ Charles R Greathouse IV, Nov 10 2015

Formula

For p an odd prime, a(p) = 2*p*(p^2-1). - Tom Edgar, Nov 04 2015
From Robert Israel, Dec 16 2015: (Start)
Conjectures:
a(2^k) = 12*8^k for k >= 3.
For odd primes p, a(p^k) = a(p)*p^(3k-3) for k>=1. (End)

Extensions

a(11)-a(31) from Tom Edgar, Nov 05 2015
a(31) corrected by Robert Israel, Dec 15 2015

A141453 Primes p such that either p = 2^k + 1 or p = 2^k - 1, k>=0.

Original entry on oeis.org

2, 3, 5, 7, 17, 31, 127, 257, 8191, 65537, 131071, 524287, 2147483647, 2305843009213693951, 618970019642690137449562111, 162259276829213363391578010288127, 170141183460469231731687303715884105727
Offset: 1

Views

Author

Leroy Quet, Aug 07 2008

Keywords

Comments

Sequence consists of 2 and the union of the Mersenne primes (A000668) and the Fermat primes (A019434).
a(18) has 157 digits and is too large to include. - Ray Chandler, Jun 22 2009
From Wolfdieter Lang, Mar 28 2012: (Start)
The sequence of exponents k of 2 for these Mersenne or Fermat primes is k=[0, 1, 2, 3, 4, 5, 7, 8, 13, 16, 17, 19, 31, 61, 89, 107, 127,...], n>=1, if 3 is considered as Fermat prime.
The second exponent is 2 if 3 is considered as Mersenne prime. The next exponent k(18)=521 for the Mersenne prime a(18).
r(a(n)) := sqrt(a(n)*2^(k(n)+2) + 1) is a solution of the congruence x^2 == 1 (mod a(n)*2^(k(n)+1)), n>=1. The sequence k is given in the preceding comment. If n=2 then, besides r(3) = 5, also sqrt(3*2^(2+2) + 1) = 7 is an incongruent solution mod 12 if the exponent 2 is chosen. For n=2 there are altogether four incongruent solutions of x^2 == 1 (mod 12), namely 1, 12-1 = 11, r(3)=5 and 12-5 = 7. If n=1 there are altogether two incongruent solutions, namely 1 and r(2) = 3 = 4-1 (a trivial solution == -1 (mod 4)). For n>=3 there are eight incongruent solutions, and besides the trivial (positive) ones, 1 and a(n)*2^(k(n)+1) - 1, one has a nontrivial pair r(a(n)) and a(n)*2^(k(n)+1) - r(a(n)). For the number of incongruent solutions of the congruence x^2 == 1 (mod n) see A060594. For the r(a(n)) values see A210844.
r(a(n)), n>=1, also solves the congruence x^2 == 1 (Modd a(n)*2^(k(n)+1)), because floor((r(a(n))^2)/(a(n)*2^(k(n)+1)) is even. For Modd n (not to be confused with mod n) see a comment on A203571.
(End)

Examples

			From _Wolfdieter Lang_, Mar 28 2012: (Start)
Solutions to the congruence x^2 == 1 (mod a(n)*2^(k(n)+1):
n=3: r(5) = sqrt(5*2^(2+2) + 1) = 9. 9^2 = 81 == 1 (mod 5*8).
  The companion solution is 40-9 = 31. Because floor(81/40)=2 is even, 81 == 1 (Modd 40) also.
n=4: r(7) =  sqrt(7*2^(3+2) + 1) = 15. 15^2 = 225 == 1 (mod 7*16). The companion solution is 112-15 = 97. Because floor(225/112)=2 is even, 225 == 1 (Modd 112) also.
n=7: r(127) = sqrt(127*2^(7+2) + 1) = 255. 255^2 == 1 (mod 127*2^8). The companion solution is 32512-255 = 32257.
(End)
		

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[30000]], Length[FactorInteger[#-1]]==1 || Length[FactorInteger[#+1]]==1&] (* Vladimir Joseph Stephan Orlovsky, Feb 03 2012 *)
    Select[Union[Join @@ Array[2^# + {-1, +1} &, 140, 0]], PrimeQ] (* Michael De Vlieger, Oct 23 2017 *)

Extensions

More terms from R. J. Mathar, Jan 23 2009
a(17) from Ray Chandler, Jun 22 2009

A145390 Number of sublattices of index n of a centered rectangular lattice fixed by a reflection.

Original entry on oeis.org

1, 1, 2, 3, 2, 2, 2, 5, 3, 2, 2, 6, 2, 2, 4, 7, 2, 3, 2, 6, 4, 2, 2, 10, 3, 2, 4, 6, 2, 4, 2, 9, 4, 2, 4, 9, 2, 2, 4, 10, 2, 4, 2, 6, 6, 2, 2, 14, 3, 3, 4, 6, 2, 4, 4, 10, 4, 2, 2, 12, 2, 2, 6, 11, 4, 4, 2, 6, 4, 4, 2, 15, 2, 2, 6, 6, 4, 4, 2, 14, 5, 2, 2, 12, 4, 2, 4, 10, 2, 6, 4, 6, 4, 2, 4, 18, 2, 3, 6, 9, 2
Offset: 1

Views

Author

N. J. A. Sloane, Feb 23 2009, Mar 13 2009

Keywords

Comments

a(n) is the Dirichlet convolution of A000012 and A098178. - Domenico (domenicoo(AT)gmail.com), Oct 21 2009

Crossrefs

Cf. A098178, A060594 (primitive sublattices only), A145391.

Programs

  • Maple
    nmax := 100 :
    L := [1,-1,0,2,seq(0,i=1..nmax)] :
    MOBIUSi(%) :
    MOBIUSi(%) ; # R. J. Mathar, Sep 25 2017
  • Mathematica
    m = 101; Drop[ CoefficientList[ Series[ Sum[(1 + Cos[n*Pi/2])*x^n/(1 - x^n), {n, 1, m}], {x, 0, m}], x], 1] (* Jean-François Alcover, Sep 20 2011, after formula *)
    f[p_, e_] := e+1; f[2, e_] := 2*e-1; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Aug 27 2023 *)
  • PARI
    t1=direuler(p=2,200,1/(1-X)^2)
    t2=direuler(p=2,2,1-X+2*X^2,200)
    t3=dirmul(t1,t2)

Formula

Dirichlet g.f.: (1-2^(-s) + 2*4^(-s))*zeta^2(s).
G.f.: Sum_n (1 + cos(n*Pi/2)) x^n / (1 - x^n). - Domenico (domenicoo(AT)gmail.com), Oct 21 2009
If 4|n then a(n) = d(n) - d(n/2) + 2*d(n/4); else if 2|n then a(n) = d(n) - d(n/2); else a(n) = d(n); where d(n) is the number of divisors of n. [Rutherford] - Andrey Zabolotskiy, Mar 10 2018
a(n) = Sum_{ m: m^2|n } A060594(n/m^2). - Andrey Zabolotskiy, May 07 2018
Sum_{k=1..n} a(k) ~ n*(log(n) - 1 + 2*gamma - log(2)/2), where gamma is the Euler-Mascheroni constant A001620. - Vaclav Kotesovec, Feb 02 2019
Multiplicative with a(2^e) = 2*e-1 and a(p^e) = e+1 for an odd prime p. - Amiram Eldar, Aug 27 2023

Extensions

New name from Andrey Zabolotskiy, Mar 10 2018

A180783 Number of distinct solutions of Sum_{i=1..1} (x(2i-1)*x(2i)) == 1 (mod n), with x() in {1,2,...,n-1}.

Original entry on oeis.org

0, 1, 2, 2, 3, 2, 4, 4, 4, 3, 6, 4, 7, 4, 6, 6, 9, 4, 10, 6, 8, 6, 12, 8, 11, 7, 10, 8, 15, 6, 16, 10, 12, 9, 14, 8, 19, 10, 14, 12, 21, 8, 22, 12, 14, 12, 24, 12, 22, 11, 18, 14, 27, 10, 22, 16, 20, 15, 30, 12, 31, 16, 20, 18, 26, 12, 34, 18, 24, 14, 36, 16, 37, 19, 22, 20, 32, 14, 40, 20, 28
Offset: 1

Views

Author

R. H. Hardin, formula from Max Alekseyev in the Sequence Fans Mailing List, Sep 20 2010

Keywords

Comments

Except for the first term, this appears to be the number of pairs of integers i,j with 1 <= i <= n, 1 <= j <= i, such that i+j == i*j (mod n), for n=1,2,3,... - John W. Layman, Oct 19 2011
Layman's observation holds since i+j == i*j (mod n) is equivalent to (i-1)*(j-1) == 1 (mod n). - Max Alekseyev, Oct 22 2011
For i > 1, equal to the number of elements x relatively prime to n such that x mod n >= x^(-1) mod n. - Jeffrey Shallit, Jun 14 2018
Differs from A007897 for n = 1, 35, 45 etc. - Georg Fischer, Sep 20 2020

Examples

			Solutions for product of a single 1..10 pair = 1 (mod 11) are (1*1) (2*6) (3*4) (5*9) (7*8) (10*10).
		

Crossrefs

Column 1 of A180793.

Formula

a(n) = (A000010(n) + A060594(n)) / 2.

A227091 Number of solutions to x^2 == 1 (mod n) in Z[i]/nZ[i].

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Number of non-congruent solutions of x^2 + y^2 -1 == 2xy == 0 (mod n).
This sequence combines A329586 (number of representative solutions of a^2 - (b^2 + 1) == 0 (mod m) and 2*a*b == 0 (mod m) with a*b = 0), and those from A329589 (number of representative solutions of these two congruences but with a*b not 0). - Wolfdieter Lang, Dec 14 2019
In A226746 the positive n numbers with more than two representative solutions of the congruence z^2 = +1 (mod n) are given. This is therefore a proper subsequence of the present one. - Wolfdieter Lang, Dec 14 2019

Examples

			a(4) = 4 because in Z[i]/4Z[i] the equation x^2==1 (mod 4) has 4 solutions: 1, 1+2i, 3 and 3+2i.
		

Crossrefs

Programs

  • Maple
    a:= n-> mul(`if`(i[1]=2, 2^min(i[2], 3), `if`(
        irem(i[1], 4)=1, 4, 2)), i=ifactors(n)[2]):
    seq(a(n), n=1..100);  # Alois P. Heinz, Feb 07 2020
  • Mathematica
    h[n_] := Flatten[Table[a + b I, {a, 0, n - 1}, {b, 0, n - 1}]]; a[1] = 1; a[n_] := Length@Select[h[n], Mod[#^2, n] == 1 &]; Table[a[n], {n, 2, 44}]
    f[2, e_] := 2^Min[e, 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 19 2020 *)
  • PARI
    a(n)=my(o=valuation(n,2),f=factor(n>>o)[,1]); prod(i=1,#f, if(f[i]%4==1, 4, 2))<Charles R Greathouse IV, Dec 13 2013
  • Sage
    def A227091(n) : return prod([4,2^min(m,3),2][p%4-1] for (p,m) in factor(n)) # Eric M. Schmidt, Jul 09 2013
    

Formula

Multiplicative with a(2^e) = 2^min(e, 3); a(p^e) = 4 for p == 1 (mod 4); a(p^e) = 2 for p == 3 (mod 4). - Eric M. Schmidt, Jul 09 2013
Previous Showing 11-20 of 56 results. Next