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

A059306 Number of 2 X 2 singular integer matrices with elements from {0,...,n}.

Original entry on oeis.org

1, 10, 31, 64, 113, 170, 255, 336, 449, 570, 719, 848, 1057, 1210, 1423, 1664, 1921, 2122, 2447, 2672, 3041, 3386, 3727, 4000, 4497, 4858, 5263, 5696, 6225, 6570, 7231, 7600, 8177, 8730, 9263, 9872, 10689, 11130, 11727, 12384, 13265, 13754, 14703
Offset: 0

Views

Author

John W. Layman, Jan 25 2001

Keywords

Crossrefs

Programs

  • Mathematica
    a[0] = 1; a[n_] := Table[{w, x, y, z} /. {ToRules[ Reduce[0 <= x <= n && 0 <= y <= n && 0 <= z <= n && w*z - x*y == 0, {x, y, z}, Integers]] }, {w, 0, n}] // Flatten[#, 1]& // Length; Table[Print[an = a[n]]; an, {n, 0, 42}] (* Jean-François Alcover, Oct 11 2013 *)
  • Python
    from math import gcd
    def A059306(n): return (2*n+1)*(n+1) + 4*sum(gcd(i, j) for i in range(1, n+1) for j in range(i, n+1)) # David Radcliffe, Aug 13 2025

Formula

a(n) = A134506(n) + (2n+1)^2. Shi's result (see formula section in A134506) shows that a(n) = kn^2 log n + cn^2 + O(n^e) where k = 12/Pi^2, e > 547/416 = 1.3149..., and c = 4.5113... - Chai Wah Wu, Nov 28 2016
a(n) = 4*A272718(n) + 2*n^2 + 3*n + 1. - David Radcliffe, Aug 13 2025

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Jan 09 2003

A171503 Number of 2 X 2 integer matrices with entries from {0,1,...,n} having determinant 1.

Original entry on oeis.org

0, 3, 7, 15, 23, 39, 47, 71, 87, 111, 127, 167, 183, 231, 255, 287, 319, 383, 407, 479, 511, 559, 599, 687, 719, 799, 847, 919, 967, 1079, 1111, 1231, 1295, 1375, 1439, 1535, 1583, 1727, 1799, 1895, 1959, 2119, 2167, 2335, 2415, 2511, 2599
Offset: 0

Views

Author

Jacob A. Siehler, Dec 10 2009

Keywords

Comments

Number of distinct solutions to k*x+h=0, where |h|<=n and k=1,2,...,n. - Giovanni Resta, Jan 08 2013.
Number of reduced rational numbers r/s with |r|<=n and 0Juan M. Marquez, Apr 13 2015

Crossrefs

Cf. A062801, A000010, A018805. Differences are A002246.
See A326354 for an essentially identical sequence.

Programs

  • Maple
    with(numtheory):
    a:= proc(n) option remember;
           `if`(n<2, [0, 3][n+1], a(n-1) + 4*phi(n))
        end:
    seq(a(n), n=0..60);
  • Mathematica
    a[n_]:=Count[Det/@(Partition[ #,2]&/@Tuples[Range[0,n],4]),1]
    (* Second program: *)
    a[0] = 0; a[1] = 3; a[n_] := a[n] = a[n-1] + 4*EulerPhi[n];
    Table[a[n], {n, 0, 60}] (* Jean-François Alcover, Jun 16 2018 *)
  • PARI
    a(n)=(n>0)+2*sum(k=1, n, moebius(k)*(n\k)^2) \\ Charles R Greathouse IV, Apr 20 2015
    
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def A171503(n): # based on second formula in A018805
        if n == 0:
            return 0
        c, j = 0, 2
        k1 = n//j
        while k1 > 1:
            j2 = n//k1 + 1
            c += (j2-j)*(A171503(k1)-1)//2
            j, k1 = j2, n//j2
        return 2*(n*(n-1)-c+j) - 1 # Chai Wah Wu, Mar 25 2021

Formula

Recursion: a(n) = a(n - 1) + 4*phi(n) for n > 1, with phi being Euler's totient function. - Juan M. Marquez, Jan 19 2010
a(n) = 4 * A002088(n) - 1 for n >= 1. - Robert Israel, Jun 01 2014

Extensions

Edited by Alois P. Heinz, Jan 19 2011

A187462 T(n,k)=Number of (n+1)X(n+1) 0..k arrays with all the 2X2 subblocks nonsingular and the array of 2X2 subblock determinants symmetric.

Original entry on oeis.org

6, 50, 26, 192, 1236, 144, 512, 13726, 89618, 1272, 1126, 84048, 5098224, 11684688, 15192, 2146, 325932, 100936174, 3387715318, 6112320620, 286392, 3760, 1118854, 1061948616, 216668424092, 19708386669940, 4871877392202, 7648032, 6112
Offset: 1

Views

Author

R. H. Hardin Mar 10 2011

Keywords

Comments

Table starts
.........6................50................192..............512..........1126
........26..............1236..............13726............84048........325932
.......144.............89618............5098224........100936174....1061948616
......1272..........11684688.........3387715318.....216668424092.5212823523842
.....15192........6112320620.....19708386669940.7540469990506332
....286392.....4871877392202.150657364854061134
...7648032.17264863350746654
.314011868

Examples

			Some k=3 solutions for 4X4
..0..2..2..0....0..2..3..3....0..2..2..3....0..2..2..2....0..2..2..0
..3..2..0..2....1..2..0..1....3..2..0..1....2..2..0..2....2..3..0..3
..2..0..1..2....3..0..2..3....2..0..3..3....2..0..1..1....2..0..1..0
..0..2..2..3....2..1..3..0....1..1..2..0....3..2..2..0....2..3..3..3
		

Crossrefs

Row 1 is A062801

A020478 Number of singular 2 X 2 matrices over Z(n) (i.e., with determinant = 0).

Original entry on oeis.org

1, 10, 33, 88, 145, 330, 385, 736, 945, 1450, 1441, 2904, 2353, 3850, 4785, 6016, 5185, 9450, 7201, 12760, 12705, 14410, 12673, 24288, 18625, 23530, 26001, 33880, 25201, 47850, 30721, 48640, 47553, 51850, 55825, 83160, 51985, 72010, 77649, 106720
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    f[p_, e_] := p^(2*e - 1)*(p^(e + 1) + p^e - 1); a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Oct 22 2020 *)
  • PARI
    a(n)=if(n<1, 0, direuler(p=2, n, (1-p*X)/((1-p^2*X)*(1-p^3*X)))[n])
    
  • PARI
    a(n)=local(c=0); forvec(x=vector(4,k,[1,n]),c+=((x[1]*x[2]-x[3]*x[4])%n==0)); c

Formula

From Vladeta Jovovic, Apr 22 2002: (Start)
a(n) = n^4 - A005353(n).
Multiplicative with a(p^e) = p^(2*e - 1)*(p^(e+1) + p^e - 1). (End)
Dirichlet g.f.: zeta(s-2)*zeta(s-3)/zeta(s-1).
A102631(n) | a(n). - R. J. Mathar, Mar 30 2011
Sum_{k=1..n} a(k) ~ Pi^2 * n^4 / (24*Zeta(3)). - Vaclav Kotesovec, Jan 31 2019
From Piotr Rysinski, Sep 11 2020: (Start)
a(n) = n * A069097(n).
Proof: a(n) is multiplicative with a(p^e) = p^(2*e - 1)*(p^(e+1) + p^e - 1), A069097(n) is multiplicative with A069097(p^e) = p^(e-1)*(p^e*(p+1)-1), so a(p^e) = p^e*A069097(p^e). (End)

A187528 T(n,k)=Number of (n+1)X(n+1) 0..k arrays with each 2X2 subblock determinant nonzero and the array of 2X2 subblock determinants symmetric under 90 degree rotation.

Original entry on oeis.org

6, 50, 0, 192, 8, 104, 512, 74, 3790, 0, 1126, 280, 35026, 1476, 9346, 2146, 784, 220802, 20554, 3607148, 0, 3760, 1970, 727842, 273102, 164460556, 296232, 4278774, 6112, 3580, 2327574, 992410
Offset: 1

Views

Author

R. H. Hardin Mar 10 2011

Keywords

Comments

Table starts
.......6......50.......192....512...1126....2146.3760.6112
.......0.......8........74....280....784....1970.3580
.....104....3790.....35026.220802.727842.2327574
.......0....1476.....20554.273102.992410
....9346.3607148.164460556
.......0..296232
.4278774

Examples

			Some k=3 solutions for 5X5
..1..2..3..1..1....1..2..3..1..3....3..2..1..1..2....1..1..3..2..3
..0..2..2..0..2....0..3..3..0..3....1..0..1..2..2....3..0..3..3..3
..1..2..3..1..2....1..2..3..1..3....2..1..1..1..2....2..1..2..1..2
..1..0..1..1..0....2..1..3..2..3....2..2..1..0..1....3..3..3..0..3
..2..2..3..1..2....1..2..3..1..3....2..1..1..2..1....2..1..2..1..2
		

Crossrefs

Row 1 is A062801

A005353 Number of 2 X 2 matrices with entries mod n and nonzero determinant.

Original entry on oeis.org

0, 6, 48, 168, 480, 966, 2016, 3360, 5616, 8550, 13200, 17832, 26208, 34566, 45840, 59520, 78336, 95526, 123120, 147240, 181776, 219846, 267168, 307488, 372000, 433446, 505440, 580776, 682080, 762150, 892800, 999936, 1138368, 1284486
Offset: 1

Views

Author

Keywords

References

  • T. Brenner, personal communication.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Mathematica
    Table[cnt=0; Do[m={{a, b}, {c, d}}; If[Det[m, Modulus->p] > 0, cnt++ ], {a, 0, p-1}, {b, 0, p-1}, {c, 0, p-1}, {d, 0, p-1}]; cnt, {p, 37}] (* T. D. Noe, Jan 12 2006 *)
    f[p_, e_] := p^(2*e - 1)*(p^(e + 1) + p^e - 1); a[1] = 0; a[n_] := n^4 - Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Oct 31 2023 *)
  • PARI
    a(n) = {my(f = factor(n), p, e); n^4 - prod(i = 1, #f~, p = f[i, 1]; e = f[i, 2];  p^(2*e - 1)*(p^(e + 1) + p^e - 1));} \\ Amiram Eldar, Oct 31 2023

Formula

a(n) = n^4 - A020478(n).
For prime n, a(n) = (n^2-1)(n-1)n. - T. D. Noe, Jan 12 2006

Extensions

More terms from T. D. Noe, Jan 12 2006

A187670 T(n,k)=Number of (n+1)X(n+1) 0..k arrays with each 2X2 subblock nonsingular and the array of 2X2 subblock determinants symmetric about the diagonal and antidiagonal.

Original entry on oeis.org

6, 50, 24, 192, 550, 112, 512, 4044, 11282, 974, 1126, 17716, 174292, 612204, 9928, 2146, 56080, 1549398, 36461174, 65533922, 197152, 3760, 150166, 6839146, 835707780
Offset: 1

Views

Author

R. H. Hardin Mar 12 2011

Keywords

Comments

Table starts
......6.......50......192.......512....1126...2146.3760
.....24......550.....4044.....17716...56080.150166
....112....11282...174292...1549398.6839146
....974...612204.36461174.835707780
...9928.65533922
.197152

Examples

			Some k=3 solutions for 5X5
..0..2..2..0..3....0..2..2..2..3....0..2..2..2..1....0..2..2..2..3
..2..1..0..1..0....2..2..0..1..1....2..2..0..1..1....2..2..0..1..1
..2..0..3..0..2....2..0..2..0..2....2..0..1..1..3....2..0..1..0..2
..0..1..0..1..2....0..1..0..2..2....3..1..0..2..2....0..1..0..2..3
..3..2..2..2..0....1..1..2..3..1....2..1..2..2..0....1..1..2..2..1
		

Crossrefs

Row 1 is A062801

A187699 T(n,k)=Number of (n+1)X(n+1) 0..k arrays with each 2X2 subblock determinant nonzero and the array of 2X2 subblock determinants symmetric under horizontal and vertical reflection.

Original entry on oeis.org

6, 50, 0, 192, 8, 104, 512, 74, 7954, 0, 1126, 280, 87258, 1548, 9350, 2146, 784, 692410, 22738, 15128848, 0, 3760, 1970, 2363474, 320674, 1089964504, 454640, 4280018, 6112, 3580, 10839282, 1147854
Offset: 1

Views

Author

R. H. Hardin Mar 12 2011

Keywords

Comments

Table starts
.......6.......50........192....512....1126.....2146.3760.6112
.......0........8.........74....280.....784.....1970.3580
.....104.....7954......87258.692410.2363474.10839282
.......0.....1548......22738.320674.1147854
....9350.15128848.1089964504
.......0...454640
.4280018

Examples

			Some k=3 solutions for 5X5
..1..0..1..1..2....3..2..3..1..0....2..1..3..2..3....1..2..3..1..2
..0..1..1..0..1....3..3..3..0..3....1..2..3..1..3....2..1..3..2..1
..1..1..2..1..2....2..1..2..1..1....2..1..3..2..3....1..2..3..1..2
..1..0..1..1..1....3..0..3..3..0....3..0..3..3..3....0..3..3..0..3
..3..1..2..1..2....3..1..3..2..1....3..1..2..1..2....1..2..3..1..2
		

Crossrefs

Row 1 is A062801
Row 2 is A187529

A064276 Number of 2 X 2 singular integer matrices with elements from {0,...,n} up to row and column permutation.

Original entry on oeis.org

1, 5, 13, 25, 42, 62, 90, 118, 155, 195, 243, 287, 352, 404, 472, 548, 629, 697, 797, 873, 986, 1094, 1202, 1294, 1443, 1559, 1687, 1823, 1984, 2100, 2296, 2420, 2597, 2769, 2937, 3125, 3366, 3514, 3702, 3906, 4167, 4331, 4611, 4783, 5040, 5320, 5548
Offset: 0

Views

Author

Vladeta Jovovic, Sep 24 2001

Keywords

Examples

			There are 5 binary singular matrices up to row and column permutation:
[0 0] [1 0] [1 1] [1 0] [1 1]
[0 0] [0 0] [0 0] [1 0] [1 1].
		

Crossrefs

Formula

a(n) = (A059306(n)+(n+1)*(2*n+3))/4.

Extensions

More terms from David Wasserman, Jul 16 2002

A064368 Number of 2 X 2 symmetric singular matrices with entries from {0,...,n}.

Original entry on oeis.org

1, 4, 7, 10, 15, 18, 21, 24, 29, 36, 39, 42, 47, 50, 53, 56, 65, 68, 75, 78, 83, 86, 89, 92, 97, 108, 111, 118, 123, 126, 129, 132, 141, 144, 147, 150, 163, 166, 169, 172, 177, 180, 183, 186, 191, 198, 201, 204, 213, 228, 239, 242, 247, 250, 257, 260, 265, 268
Offset: 0

Views

Author

Vladeta Jovovic, Sep 27 2001

Keywords

Crossrefs

Programs

  • Mathematica
    f[p_, e_] := p^Floor[e/2]; a[0] = 0; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; With[{max = 100}, 1 + Range[0, max] + 2 * Accumulate[Array[a, max + 1, 0]]] (* Amiram Eldar, Nov 07 2024 *)
  • PARI
    a(n) = n + 1 + 2*sum(k=1, n, sumdiv(k, d, issquare(d)*eulerphi(sqrtint(d)))) \\ Michel Marcus, Jun 17 2013

Formula

a(n) = n + 1 + 2*Sum_{k=1..n} Sum_{d^2|k} phi(d), where phi = Euler totient function A000010.
a(n) ~ (n/zeta(2)) * (log(n) + 3*gamma - 1 + zeta(2) - 2*zeta'(2)/zeta(2)), where gamma is Euler's constant (A001620). - Amiram Eldar, Nov 07 2024
Showing 1-10 of 12 results. Next