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

A087784 Number of solutions to x^2 + y^2 + z^2 = 1 mod n.

Original entry on oeis.org

1, 4, 6, 24, 30, 24, 42, 96, 54, 120, 110, 144, 182, 168, 180, 384, 306, 216, 342, 720, 252, 440, 506, 576, 750, 728, 486, 1008, 870, 720, 930, 1536, 660, 1224, 1260, 1296, 1406, 1368, 1092, 2880, 1722, 1008, 1806, 2640, 1620, 2024, 2162, 2304, 2058, 3000
Offset: 1

Views

Author

Yuval Dekel (dekelyuval(AT)hotmail.com), Oct 06 2003

Keywords

Crossrefs

Programs

  • Mathematica
    Table[With[{f = FactorInteger[n][[All, 1]]}, Apply[Times, Map[1 + 1/# &, Select[f, Mod[#, 4] == 1 &]]] Apply[Times, Map[1 - 1/# &, Select[f, Mod[#, 4] == 3 &]]] (1 + Boole[Divisible[n, 4]]/2) n^2] - Boole[n == 1], {n, 50}] (* Michael De Vlieger, Feb 15 2018 *)
  • PARI
    a(n) = {my(f=factor(n)); if ((n % 4), 1, 3/2)*n^2*prod(k=1, #f~, p = f[k,1]; m = p % 4; if (m==1, 1+1/p, if (m==3, 1-1/p, 1)));} \\ Michel Marcus, Feb 14 2018

Formula

a(n) = n^2 * (3/2 if 4|n) * Product_{primes p == 1 mod 4 dividing n} (1+1/p) * Product_{primes p == 3 mod 4 dividing n} (1-1/p). - Bjorn Poonen, Dec 09 2003
Sum_{k=1..n} a(k) ~ c * n^3 + O(n^2 * log(n)), where c = 36*G/Pi^4 = 0.338518..., where G is Catalan's constant (A006752) (Tóth, 2014). - Amiram Eldar, Oct 18 2022

Extensions

More terms from David Wasserman, Jun 17 2005

A071302 a(n) = (1/2) * (number of n X n 0..2 matrices M with MM' mod 3 = I, where M' is the transpose of M and I is the n X n identity matrix).

Original entry on oeis.org

1, 4, 24, 576, 51840, 13063680, 9170703360, 19808719257600, 131569513308979200, 2600339861038664908800, 152915585868239728626892800, 27051378802435080953011843891200, 14395932257291877030764312963579904000
Offset: 1

Views

Author

R. H. Hardin, Jun 11 2002

Keywords

Comments

Also, number of n X n orthogonal matrices over GF(3) with determinant 1. - Max Alekseyev, Nov 06 2022

Examples

			From _Petros Hadjicostas_, Dec 17 2019: (Start)
For n = 2, the 2*a(2) = 8 n X n matrices M with elements in {0, 1, 2} that satisfy MM' mod 3 = I are the following:
(a) With 1 = det(M) mod 3:
[[1,0],[0,1]];  [[0,1],[2,0]]; [[0,2],[1,0]]; [[2,0],[0,2]].
This is the abelian group SO(2, Z_3). See the comments for sequence A060968.
(b) With 2 = det(M) mod 3:
[[0,1],[1,0]];  [[0,2],[2,0]]; [[1,0],[0,2]]; [[2,0],[0,1]].
Note that, for n = 3, we have 2*a(3) = 2*24 = 48 = A264083(3). (End)
		

Crossrefs

Programs

  • Mathematica
    FoldList[Times, 1, LinearRecurrence[{3, -3, 9}, {4, 6, 24}, 12]] (* Amiram Eldar, Jun 22 2025 *)
  • PARI
    { a071302(n) = my(t=n\2); prod(i=0,t-1,3^(2*t)-3^(2*i)) * if(n%2,3^t,1/(3^t+(-1)^t)); } \\ Max Alekseyev, Nov 06 2022

Formula

a(2k+1) = 3^k * Product_{i=0..k-1} (3^(2k) - 3^(2i)); a(2k) = (3^k + (-1)^(k+1)) * Product_{i=1..k-1} (3^(2k) - 3^(2i)) (see MacWilliams, 1969). - Max Alekseyev, Nov 06 2022
a(n+1) = a(n) * A318609(n+1) for n >= 1. - conjectured by Petros Hadjicostas, Dec 18 2019; proved based on the explicit formula by Max Alekseyev, Nov 06 2022

Extensions

Terms a(8) onward from Max Alekseyev, Nov 06 2022

A071303 1/2 times the number of n X n 0..3 matrices M with MM' mod 4 = I, where M' is the transpose of M and I is the n X n identity matrix.

Original entry on oeis.org

1, 8, 192, 12288, 1966080, 1509949440, 5411658792960
Offset: 1

Views

Author

R. H. Hardin, Jun 11 2002

Keywords

Comments

It seems that a(n) = n! * 2^(binomial(n+1,2) - 1) for n = 1, 2, 3, 4, 5, while for n = 6, a(n) is twice this number. The number n! * 2^(binomial(n+1,2) - 1) appears in Proposition 6.1 in Eriksson and Linusson (2000) as an upper bound to the number of three-dimensional permutation arrays of size n (see column k = 3 of A330490). - Petros Hadjicostas, Dec 16 2019
a(7) = 7! * 2^30. - Sean A. Irvine, Jul 11 2024

Examples

			From _Petros Hadjicostas_, Dec 16 2019: (Start)
For n = 2, here are the 2*a(2) = 16 2 x 2 matrices M with elements in {0,1,2,3} that satisfy MM'  mod 4 = I:
(a) With 1 = det(M) mod 4:
  [[1,0],[0,1]]; [[0,1],[3,0]]; [[0,3],[1,0]]; [[1,2],[2,1]];
  [[2,1],[3,2]]; [[2,3],[1,2]]; [[3,0],[0,3]]; [[3,2],[2,3]].
These form the abelian group SO(2, Z_n). See the comments for sequence A060968.
(b) With 3 = det(M) mod 4:
  [[0,1],[1,0]]; [[0,3],[3,0]]; [[1,0],[0,3]];  [[1,2],[2,3]];
  [[2,1],[1,2]]; [[2,3],[3,2]]; [[3,0],[0,1]];  [[3,2],[2,1]].
Note that, for n = 3, we have 2*a(3) = 2*192 = 384 = A264083(4). (End)
		

Crossrefs

Extensions

a(7) from Sean A. Irvine, Jul 11 2024

A071304 a(n) = (1/2) * (number of n X n 0..4 matrices M with MM' mod 5 = I, where M' is the transpose of M and I is the n X n identity matrix).

Original entry on oeis.org

1, 4, 120, 14400, 9360000, 29016000000, 457002000000000, 35646156000000000000, 13946558535000000000000000, 27230655539587500000000000000000, 266009466302345390625000000000000000000, 12987912192212013697265625000000000000000000000
Offset: 1

Views

Author

R. H. Hardin, Jun 11 2002

Keywords

Comments

Also, number of n X n orthogonal matrices over GF(5) with determinant 1. - Max Alekseyev, Nov 06 2022

Examples

			From _Petros Hadjicostas_, Dec 17 2019: (Start)
For n = 2, the 2*a(2) = 8 n X n matrices M with elements in {0,1,2,3,4} that satisfy MM' mod 5 = I are the following:
(a) those with 1 = det(M) mod 5:
[[1,0],[0,1]]; [[0,4],[1,0]]; [[0,1],[4,0]]; [[4,0],[0,4]].
These form the abelian group SO(2, Z_5). See the comments for sequence A060968.
(b) those with 4 = det(M) mod 5:
[[0,1],[1,0]]; [[0,4],[4,0]]; [[1,0],[0,4]]; [[4,0],[0,1]].
Note that, for n = 3, we have 2*a(3) = 2*120 = 240 = A264083(5). (End)
		

Crossrefs

Programs

  • PARI
    { a071304(n) = my(t=n\2); prod(i=0, t-1, 5^(2*t)-5^(2*i)) * if(n%2, 5^t, 1/(5^t+1)); } \\ Max Alekseyev, Nov 06 2022

Formula

a(2k+1) = 5^k * Product_{i=0..k-1} (5^(2k) - 5^(2i)); a(2k) = (5^k - 1) * Product_{i=1..k-1} (5^(2k) - 5^(2i)) (see MacWilliams, 1969). - Max Alekseyev, Nov 06 2022
From Petros Hadjicostas, Dec 20 2019: (Start)
Let b(n) be the number of solutions to the equation Sum_{i = 1..n} x_i^2 = 1 (mod 5) with x_i in 0..4. We have that b(n) = 5*b(n-1) + 5*b(n-2) - 25*b(n-3) for n >= 3 with b(0) = 0, b(1) = 2, and b(2) = 4.
We have b(n) = A330607(n, k=1) for n >= 0.
We conjecture that a(n+1) = a(n)*b(n+1) for n >= 1. (End)

Extensions

Terms a(7) onward from Max Alekseyev, Nov 06 2022

A071306 a(n) = (1/2) * (number of n X n 0..6 matrices M with MM' mod 7 = I, where M' is the transpose of M and I is the n X n identity matrix).

Original entry on oeis.org

1, 8, 336, 112896, 276595200, 4662288691200, 546914437209907200, 450219964711195607040000, 2596509480922336727312302080000, 104784757384177668346109081238896640000, 29597339316082819652234687848790174733434880000
Offset: 1

Views

Author

R. H. Hardin, Jun 11 2002

Keywords

Comments

Also, number of n X n orthogonal matrices over GF(7) with determinant 1. - Max Alekseyev, Nov 06 2022

Examples

			From _Petros Hadjicostas_, Dec 19 2019: (Start)
For n = 2, the 2*a(2) = 16 n X n matrices M with elements in 0..6 that satisfy MM' = I are the following:
(a) those with 1 = det(M) mod 7:
[[1,0],[0,1]]; [[0,1],[6,0]]; [[0,6],[1,0]]; [[2,2],[5,2]];
[[2,5],[2,2]]; [[5,2],[5,5]]; [[5,5],[2,5]]; [[6,0],[0,6]].
These are the elements of the abelian group SO(2,Z_7). See the comments for sequence A060968.
(b) those with 6 = det(M) mod 7:
[[0,1],[1,0]]; [[0,6],[6,0]]; [[1,0],[0,6]]; [[2,2],[2,5]];
[[2,5],[5,5]]; [[5,2],[2,2]]; [[5,5],[5,2]]; [[6,0],[0,1]].
Note that, for n = 3, we have 2*a(3) = 2*336 = 672 = A264083(7). (End)
		

Crossrefs

Programs

  • PARI
    { a071306(n) = my(t=n\2); prod(i=0, t-1, 7^(2*t)-7^(2*i)) * if(n%2, 7^t, 1/(7^t+(-1)^t)); } \\ Max Alekseyev, Nov 06 2022

Formula

a(2k+1) = 7^k * Product_{i=0..k-1} (7^(2k) - 7^(2i)); a(2k) = (7^k + (-1)^(k+1)) * Product_{i=1..k-1} (7^(2k) - 7^(2i)) (see MacWilliams, 1969). - Max Alekseyev, Nov 06 2022
Conjecture: Let b(n) be the number of solutions to the equation Sum_{i = 1..n} x_i^2 = 1 (mod 7) with x_i in 0..6. We conjecture that b(n) = 7*b(n-1) - 7*b(n-2) + 49*b(n-3) for n >= 4 with b(1) = 2, b(2) = 8, and b(3) = 42. We also conjecture that a(n+1) = a(n)*b(n+1) for n >= 1. - Petros Hadjicostas, Dec 19 2019

Extensions

Terms a(6) onward from Max Alekseyev, Nov 06 2022

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

A071900 1/4 times the number of n X n 0..7 matrices with MM' mod 8 = I, where M' is the transpose of M and I is the n X n identity matrix.

Original entry on oeis.org

1, 16, 1536, 786432, 2013265920
Offset: 1

Views

Author

R. H. Hardin, Jun 12 2002

Keywords

Examples

			From _Petros Hadjicostas_, Dec 18 2019: (Start)
For n = 2, the 4*a(2) = 64 n X n matrices M with elements in 0..7 that satisfy MM' mod 8 = I can be classified into four categories:
(a) Matrices M with 1 = det(M) mod 8. These form the abelian group SO(2, Z_8). See the comments for sequence A060968.
(b) Matrices M with 3 = det(M) mod 8. These are the elements of the left coset A*SO(2, Z_8) = {AM: M in SO(2, Z_8)}, where A = [[3,0],[0,1]].
(c) Matrices M with 5 = det(M) mod 8. These are the elements of the left coset B*SO(2, Z_8) = {BM: M in SO(2, Z_8)}, where B = [[5,0],[0,1]].
(d) Matrices M with 7 = det(M) mod 8. These are the elements of the left coset C*SO(2, Z_8) = {CM: M in SO(2, Z_8)}, where C= [[7,0],[0,1]].
All four classes of matrices have the same number of elements, that is, 16 each.
Note that for n = 3 we have 4*a(3) = 4*1536 = 6144 = A264083(8). (End)
		

Crossrefs

Formula

Conjecture: a(n) = 2^(n*(n-1)/2) * A071303(n) for n >= 1. - Michel Marcus, Nov 08 2022

A240547 Number of non-congruent solutions of x^2 + y^2 + z^2 + t^2 == 0 mod n.

Original entry on oeis.org

1, 8, 33, 32, 145, 264, 385, 128, 945, 1160, 1441, 1056, 2353, 3080, 4785, 512, 5185, 7560, 7201, 4640, 12705, 11528, 12673, 4224, 18625, 18824, 26001, 12320, 25201, 38280, 30721, 2048, 47553, 41480, 55825, 30240, 51985, 57608, 77649, 18560, 70561, 101640
Offset: 1

Views

Author

Laszlo Toth, Apr 07 2014

Keywords

Examples

			For n=2 the a(2)=8 solutions are (0,0,0,0), (1,1,0,0), (1,0,1,0), (1,0,0,1), (0,1,1,0), (0,1,0,1), (0,0,1,1), (1,1,1,1).
		

Crossrefs

Programs

  • Maple
    A240547 := proc(n) local a, x, y, z, t ; a := 0 ; for x from 0 to n-1 do for y
    from 0 to n-1 do for z from 0 to n-1 do for t from 0 to n-1 do if
    (x^2+y^2+z^2+t^2) mod n = 0 mod n then a := a+1 ; fi; od; od ; od; od;
    a ; end proc;
    # alternative
    A240547 := proc(n)
        a := 1;
        for pe in ifactors(n)[2] do
            p := op(1,pe) ;
            e := op(2,pe) ;
            if p = 2 then
                a := a*p^(2*e+1) ;
            else
                a := a* p^(2*e-1)*(p^(e+1)+p^e-1) ;
            end if;
        end do:
        a ;
    end proc:
    seq(A240547(n),n=1..100) ; # R. J. Mathar, Jun 25 2018
  • Mathematica
    b[2, e_] := 2^(2 e + 1);
    b[p_, e_] := p^(2 e - 1)*(p^(e + 1) + p^e - 1);
    a[n_] := Times @@ b @@@ FactorInteger[n];
    Array[a, 42] (* Jean-François Alcover, Dec 05 2017 *)
  • PARI
    a(n) = my(m); if( n<1, 0, forvec( v = vector(4, i, [0, n-1]), m += (0 == norml2(v)%n))); m /* Michael Somos, Apr 07 2014 */
    
  • PARI
    a(n) = {my(f = factor(n), res = 1, start = 1, p, e, i); if(n % 2 == 0, res = 1<<(f[1,2]<<1+1); start = 2); for(i = start, #f~, p = f[i, 1]; e = f[i, 2]; res*=(p^(e<<1-1)*(p^(e+1)+p^e-1))); res} \\ David A. Corneth, Jul 22 2018

Formula

Multiplicative, with a(2^e) = 2^(2e+1) for e>=1, a(p^e) = p^(2e-1)*(p^(e+1)+p^e-1) for p > 2, e>=1.
For odd n, a(n) = A069097(n)*n = A020478(n). - R. J. Mathar, Jun 23 2018
Sum_{k=1..n} a(k) ~ c * n^4 + O(n^3 * log(n)), where c = 5*Pi^2/(168*zeta(3)) = 0.244362... (Tóth, 2014). - Amiram Eldar, Oct 18 2022

A227553 Number of solutions to x^2 - y^2 - z^2 == 1 (mod n).

Original entry on oeis.org

1, 4, 6, 8, 30, 24, 42, 32, 54, 120, 110, 48, 182, 168, 180, 128, 306, 216, 342, 240, 252, 440, 506, 192, 750, 728, 486, 336, 870, 720, 930, 512, 660, 1224, 1260, 432, 1406, 1368, 1092, 960, 1722, 1008, 1806, 880, 1620, 2024, 2162, 768, 2058, 3000, 1836
Offset: 1

Views

Author

Keywords

Comments

Conjecture: a(2) = 4; if s > 1 then a(2^s) = 2^(2s-1); if p == 1 (mod 4) then a(p^s) = (p+1)*p^(2s-1); if p == 3 (mod 4) then a(p^s) = (p-1)*p^(2s-1).

Crossrefs

Programs

  • Mathematica
    a[1] = 1; a[n_] := Sum[If[Mod[a^2-b^2-c^2, n] == 1, 1, 0], {a, n}, {b, n}, {c, n}]; Table[a[n], {n, 10}]
  • PARI
    M(n,f)={sum(i=0, n-1, Mod(x^(f(i)%n), x^n-1))}
    a(n)={polcoeff(lift(M(n, i->i^2) * M(n, i->-(i^2))^2 ), 1%n)} \\ Andrew Howroyd, Jun 24 2018
Showing 1-9 of 9 results.