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.

A007997 a(n) = ceiling((n-3)(n-4)/6).

Original entry on oeis.org

0, 0, 1, 1, 2, 4, 5, 7, 10, 12, 15, 19, 22, 26, 31, 35, 40, 46, 51, 57, 64, 70, 77, 85, 92, 100, 109, 117, 126, 136, 145, 155, 166, 176, 187, 199, 210, 222, 235, 247, 260, 274, 287, 301, 316, 330, 345, 361, 376, 392, 409, 425, 442, 460, 477, 495, 514, 532, 551, 571, 590, 610
Offset: 3

Views

Author

Keywords

Comments

Number of solutions to x+y+z=0 (mod m) with 0<=x<=y<=z
Nonorientable genus of complete graph on n nodes.
Also (with different offset) Molien series for alternating group A_3.
(1+x^3 ) / ((1-x)*(1-x^2)*(1-x^3)) is the Poincaré series [or Poincare series] (or Molien series) for H^*(S_6, F_2).
a(n+5) is the number of necklaces with 3 black beads and n white beads.
The g.f./x^5 is Z(C_3,x), the 3-variate cycle index polynomial for the cyclic group C_3, with substitution x[i]->1/(1-x^i), i=1,2,3. Therefore by Polya enumeration a(n+5) is the number of cyclically inequivalent 3-necklaces whose 3 beads are labeled with nonnegative integers such that the sum of labels is n, for n=0,1,2,... . See A102190 for Z(C_3,x). - Wolfdieter Lang, Feb 15 2005
a(n+1) is the number of pairs (x,y) with x and y in {0,...,n}, x = (y mod 3), and x+y < n. - Clark Kimberling, Jul 02 2012
From Gus Wiseman, Oct 17 2020: (Start)
Also the number of 3-part integer compositions of n - 2 that are either weakly increasing or strictly decreasing. For example, the a(5) = 1 through a(13) = 15 compositions are:
(111) (112) (113) (114) (115) (116) (117) (118) (119)
(122) (123) (124) (125) (126) (127) (128)
(222) (133) (134) (135) (136) (137)
(321) (223) (224) (144) (145) (146)
(421) (233) (225) (226) (155)
(431) (234) (235) (227)
(521) (333) (244) (236)
(432) (334) (245)
(531) (532) (335)
(621) (541) (344)
(631) (542)
(721) (632)
(641)
(731)
(821)
(End)

Examples

			For m=7 (n=12), the 12 solutions are xyz = 000 610 520 511 430 421 331 322 662 653 644 554.
		

References

  • A. Adem and R. J. Milgram, Cohomology of Finite Groups, Springer-Verlag, 2nd. ed., 2004, p. 204.
  • D. J. Benson, Polynomial Invariants of Finite Groups, Cambridge, 1993, p. 105.
  • J. L. Gross and T. W. Tucker, Topological Graph Theory, Wiley, 1987; see \bar{I}(n) p. 221.
  • J. L. Gross and J. Yellen, eds., Handbook of Graph Theory, CRC Press, 2004; p. 740.
  • E. V. McLaughlin, Numbers of factorizations in non-unique factorial domains, Senior Thesis, Allegeny College, Meadville, PA, 2004.

Crossrefs

Apart from initial term, same as A058212.
A001399(n-6)*2 = A069905(n-3)*2 = A211540(n-1)*2 counts the strict case.
A014311 intersected with A225620 U A333256 ranks these compositions.
A218004 counts these compositions of any length.
A000009 counts strictly decreasing compositions.
A000041 counts weakly increasing compositions.
A001523 counts unimodal compositions, with complement counted by A115981.
A007318 and A097805 count compositions by length.
A032020 counts strict compositions, ranked by A233564.
A333149 counts neither increasing nor decreasing strict compositions.

Programs

  • Haskell
    a007997 n = ceiling $ (fromIntegral $ (n - 3) * (n - 4)) / 6
    a007997_list = 0 : 0 : 1 : zipWith (+) a007997_list [1..]
    -- Reinhard Zumkeller, Dec 18 2013
    
  • Maple
    x^5*(1+x^3)/((1-x)*(1-x^2)*(1-x^3));
    seq(ceil(binomial(n,2)/3), n=0..63); # Zerinvary Lajos, Jan 12 2009
    a := n -> (n*(n-7)-2*([1,1,-1][n mod 3 +1]-7))/6;
    seq(a(n), n=3..64); # Peter Luschny, Jan 13 2015
  • Mathematica
    k = 3; Table[Apply[Plus, Map[EulerPhi[ # ]Binomial[n/#, k/# ] &, Divisors[GCD[n, k]]]]/n, {n, k, 30}] (* Robert A. Russell, Sep 27 2004 *)
    Table[Ceiling[((n-3)(n-4))/6],{n,3,100}] (* or *) LinearRecurrence[ {2,-1,1,-2,1},{0,0,1,1,2},100] (* Harvey P. Dale, Jan 21 2014 *)
  • PARI
    a(n)=(n^2-7*n+16)\6 \\ Charles R Greathouse IV, Sep 24 2015

Formula

a(n) = a(n-3) + n - 2, a(0)=0, a(1)=0, a(2)=1 [Offset 0]. - Paul Barry, Jul 14 2004
G.f.: x^5*(1+x^3)/((1-x)*(1-x^2)*(1-x^3)) = x^5*(1-x+x^2)/((1-x)^2*(1-x^3)).
a(n+5) = Sum_{k=0..floor(n/2)} C(n-k,L(k/3)), where L(j/p) is the Legendre symbol of j and p. - Paul Barry, Mar 16 2006
a(3)=0, a(4)=0, a(5)=1, a(6)=1, a(7)=2, a(n) = 2*a(n-1) - a(n-2) + a(n-3) - 2*a(n-4) + a(n-5). - Harvey P. Dale, Jan 21 2014
a(n) = (n^2 - 7*n + 14 - 2*(-1)^(2^(n + 1 - 3*floor((n+1)/3))))/6. - Luce ETIENNE, Dec 27 2014
a(n) = A001399(n-3) + A001399(n-6). Compare to A140106(n) = A001399(n-3) - A001399(n-6). - Gus Wiseman, Oct 17 2020
a(n) = (40 + 3*(n - 7)*n - 4*cos(2*n*Pi/3) - 4*sqrt(3)*sin(2*n*Pi/3))/18. - Stefano Spezia, Dec 14 2021
Sum_{n>=5} 1/a(n) = 6 - 2*Pi/sqrt(3) + 2*Pi*tanh(sqrt(5/3)*Pi/2)/sqrt(15). - Amiram Eldar, Oct 01 2022

A061857 Triangle in which the k-th item in the n-th row (both starting from 1) is the number of ways in which we can add 2 distinct integers from 1 to n in such a way that the sum is divisible by k.

Original entry on oeis.org

0, 1, 0, 3, 1, 1, 6, 2, 2, 1, 10, 4, 4, 2, 2, 15, 6, 5, 3, 3, 2, 21, 9, 7, 5, 4, 3, 3, 28, 12, 10, 6, 6, 4, 4, 3, 36, 16, 12, 8, 8, 5, 5, 4, 4, 45, 20, 15, 10, 9, 7, 6, 5, 5, 4, 55, 25, 19, 13, 11, 9, 8, 6, 6, 5, 5, 66, 30, 22, 15, 13, 10, 10, 7, 7, 6, 6, 5, 78, 36, 26, 18, 16, 12, 12, 9, 8, 7, 7
Offset: 1

Author

Antti Karttunen, May 11 2001

Keywords

Comments

Since the sum of two distinct integers from 1 to n can be as much as 2n-1, this triangular table cannot show all the possible cases. For larger triangles showing all solutions, see A220691 and A220693. - Antti Karttunen, Feb 18 2013 [based on Robert Israel's mail, May 07 2012]

Examples

			The second term on the sixth row is 6 because we have 6 solutions: {1+3, 1+5, 2+4, 2+6, 3+5, 4+6} and the third term on the same row is 5 because we have solutions {1+2,1+5,2+4,3+6,4+5}.
Triangle begins:
   0;
   1,  0;
   3,  1,  1;
   6,  2,  2,  1;
  10,  4,  4,  2,  2;
  15,  6,  5,  3,  3,  2;
  21,  9,  7,  5,  4,  3,  3;
  28, 12, 10,  6,  6,  4,  4,  3;
  36, 16, 12,  8,  8,  5,  5,  4,  4;
  45, 20, 15, 10,  9,  7,  6,  5,  5,  4;
		

Crossrefs

This is the lower triangular region of square array A220691. See A220693 for all nonzero solutions.
The left edge (first diagonal) of the triangle: A000217, the second diagonal is given by C(((n+(n mod 2))/2), 2)+C(((n-(n mod 2))/2), 2) = A002620, the third diagonal by A058212, the fourth by A001971, the central column by A042963? trinv is given at A054425. Cf. A061865.

Programs

  • Haskell
    a061857 n k = length [()| i <- [2..n], j <- [1..i-1], mod (i + j) k == 0]
    a061857_row n = map (a061857 n) [1..n]
    a061857_tabl = map a061857_row [1..]
    -- Reinhard Zumkeller, May 08 2012
    
  • Maple
    [seq(DivSumChoose2Triangle(j),j=1..120)]; DivSumChoose2Triangle := (n) -> nops(DivSumChoose2(trinv(n-1),(n-((trinv(n-1)*(trinv(n-1)-1))/2))));
    DivSumChoose2 := proc(n,k) local a,i,j; a := []; for i from 1 to (n-1) do for j from (i+1) to n do if(0 = ((i+j) mod k)) then a := [op(a),[i,j]]; fi; od; od; RETURN(a); end;
  • Mathematica
    a[n_, 1] := n*(n-1)/2; a[n_, k_] := Module[{r}, r = Reduce[1 <= i < j <= n && Mod[i + j, k] == 0, {i, j}, Integers]; Which[Head[r] === Or, Length[r], Head[r] === And, 1, r === False, 0, True, Print[r, " not parsed"]]]; Table[a[n, k], {n, 1, 13}, {k, 1, n}] // Flatten (* Jean-François Alcover, Mar 04 2014 *)
  • Scheme
    (define (A061857 n) (A220691bi (A002024 n) (A002260 n))) ;; Antti Karttunen, Feb 18 2013. Needs A220691bi from A220691.

Formula

From Robert Israel, May 08 2012: (Start)
Let n+1 = b mod k with 0 <= b < k, q = (n+1-b)/k. Let k = c mod 2, c = 0 or 1.
If b = 0 or 1 then a(n,k) = q^2*k/2 + q*b - 2*q - b + 1 + c*q/2.
If b >= (k+3)/2 then a(n,k) = q^2*k/2 + q*b - 2*q + b - 1 - k/2 + c*(q+1)/2.
Otherwise a(n,k) = q^2*k/2 + q*b - 2*q + c*q/2. (End)

Extensions

Offset corrected by Reinhard Zumkeller, May 08 2012

A003035 Maximal number of 3-tree rows in n-tree orchard problem.

Original entry on oeis.org

0, 0, 1, 1, 2, 4, 6, 7, 10, 12, 16, 19, 22, 26
Offset: 1

Keywords

Comments

It is known that a(15) is 31 or 32, a(16)=37 and a(17) is 40, 41 or 42. - N. J. A. Sloane, Feb 11 2013

References

  • P. Brass et al., Research Problems in Discrete Geometry, Springer, 2005.
  • S. A. Burr, in The Mathematical Gardner, Ed. D. A. Klarner, p. 94, Wadsworth, 1981.
  • S. A. Burr, B. Grünbaum and N. J. A. Sloane, The Orchard Problem, Geometriae Dedicata, 2 (1974), 397-424.
  • Jean-Paul Delahaye, Des points qui s'alignent... ou pas, "Logique et calcul" column, "Pour la science", June 2021.
  • H. E. Dudeney, Amusements in Mathematics, Nelson, London, 1917, page 56.
  • Paul Erdos and George Purdy. Extremal problems in geometry, Chapter 17, pages 809-874 in R. L. Graham et al., eds., Handbook of Combinatorics, 2 vols., MIT Press, 1995. See Section 3.7.
  • M. Gardner, Time Travel and Other Mathematical Bewilderments. Freeman, NY, 1988, Chap. 22.
  • B. Grünbaum, Arrangements and Spreads. American Mathematical Society, Providence, RI, 1972, p. 22.
  • John Jackson, Rational Amusements for Winter Evenings, London, 1821.
  • F. Levi, Geometrische Konfigurationen, Hirzel, Leipzig, 1929.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A006065 (4 trees/row), A008997 (5 trees per row), A058212.

Extensions

13 and 14 trees result from Zhao Hui Du, Nov 20 2008
Replaced my old picture with link to my write-up. - Ed Pegg Jr, Feb 02 2018

A239438 Maximal number of points that can be placed on a triangular grid of side n so that there is no pair of adjacent points.

Original entry on oeis.org

1, 1, 3, 4, 6, 7, 10, 12, 15, 19, 22, 26, 31, 35, 40, 46, 51, 57, 64, 70, 77, 85, 92, 100, 109, 117, 126, 136, 145, 155, 166, 176, 187, 199, 210, 222, 235, 247, 260, 274, 287, 301, 316, 330, 345, 361, 376, 392, 409
Offset: 1

Author

Heinrich Ludwig, Mar 18 2014

Keywords

Comments

In other words, the independence number of the (n-1)-triangular grid graph.
Apart from a(3) and a(5) same as A007997(n+4) and A058212(n+2). - Eric W. Weisstein, Jun 14 2017
Also the independence number of the n-triangular honeycomb king graph. - Eric W. Weisstein, Sep 06 2017

Examples

			On a triangular grid of side 5 at most a(5) = 6 points (X) can be placed so that there is no pair of adjacent points.
      X
     . .
    X . X
   . . . .
  X . X . X
		

Crossrefs

Programs

  • Mathematica
    Table[1/18 (Piecewise[{{28, n == 2 || n == 4}}, 10] + 3 n (3 + n) + 8 Cos[(2 n Pi)/3]), {n, 0, 20}] (* Eric W. Weisstein, Jun 14 2017 *)
  • PARI
    Vec(x*(x^9-2*x^8+2*x^7-3*x^6+3*x^5-2*x^4+2*x^3-2*x^2+x-1)/((x-1)^3*(x^2+x+1)) + O(x^100)) \\ Colin Barker, Feb 08 2015

Formula

a(n) = ceiling(n(n+1)/6) for n > 5, see Geramita, Gregory, & Roberts theorem 5.4. - Charles R Greathouse IV, Dec 04 2014
G.f.: x*(x^9-2*x^8+2*x^7-3*x^6+3*x^5-2*x^4+2*x^3-2*x^2+x-1) / ((x-1)^3*(x^2+x+1)). - Colin Barker, Feb 08 2015

Extensions

Extended by Charles R Greathouse IV, Dec 04 2014

A267632 Triangle T(n, k) read by rows: the k-th column of the n-th row lists the number of ways to select k distinct numbers (k >= 1) from [1..n] so that their sum is divisible by n.

Original entry on oeis.org

1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 2, 2, 1, 1, 1, 2, 4, 3, 1, 0, 1, 3, 5, 5, 3, 1, 1, 1, 3, 7, 9, 7, 3, 1, 0, 1, 4, 10, 14, 14, 10, 4, 1, 1, 1, 4, 12, 22, 26, 20, 12, 5, 1, 0, 1, 5, 15, 30, 42, 42, 30, 15, 5, 1, 1, 1, 5, 19, 42, 66, 76, 66, 43, 19, 5, 1, 0
Offset: 1

Author

Dimitri Papadopoulos, Jan 18 2016

Keywords

Comments

Row less the last element is palindrome for n=odd or n=power of 2 where n is the row number (observation-conjecture).
From Petros Hadjicostas, Jul 13 2019: (Start)
By reading carefully the proof of Lemma 5.1 (pp. 65-66) in Barnes (1959), we see that he actually proved a general result (even though he does not state it in the lemma).
According to the definition of this sequence, for 1 <= k <= n, T(n, k) is the number of unordered sets b_1, b_2, ..., b_k of k distinct integers from 1..n such that b_1 + b_2 + ... + b_k = 0 (mod n). The proof of Lemma 5.1 in Barnes (1959) implies that T(n, k) = (1/n) * Sum_{s | gcd(n, k)} (-1)^(k - (k/s)) * phi(s) * binomial(n/s, k/s) for 1 <= k <= n.
For fixed k >= 1, the g.f. of the column (T(n, k): n >= 1) (with T(n, k) = 0 for 1 <= n < k) is (x^k/k) * Sum_{s|k} phi(s) * (-1)^(k - (k/s)) / (1 - x^s)^(k/s), which generalizes Herbert Kociemba's formula from A032801.
Barnes' (1959) formula is a special case of Theorem 4 (p. 66) in Ramanathan (1944). If R(n, k, v) is the number of unordered sets b_1, b_2, ..., b_k of k distinct integers from 1..n such that b_1 + b_2 + ... + b_k = v (mod n), then he proved that R(n, k, v) = (1/n) * Sum_{s | gcd(n,k)} (-1)^(k - (k/s)) * binomial(n/s, k/s) * C_s(v), where C_s(v) = A054535(s, v) = Sum_{d | gcd(s,v)} d * Moebius(s/d) is Ramanujan's sum (even though it was first discovered around 1900 by the Austrian mathematician R. D. von Sterneck).
Because C_s(v = 0) = phi(s), we get Barnes' (implicit) result; i.e., R(n, k, v=0) = T(n, k) for 1 <= k <= n.
For k=2, we have R(n, k=2, v=0) = T(n, k=2) = A004526(n-1) for n >= 1. For k=3, we have R(n, k=3, v=0) = T(n, k=3) = A058212(n) for n >= 1. For k=4, we have R(n, k=4, v=0) = A032801(n) for n >= 1. For k=5, we have R(n, k=5, v=0) = T(n, k=5) = A008646(n-5) for n >= 5.
The reason we have T(2*m+1, k) = A037306(2*m+1, k) = A047996(2*m+1, k) for m >= 0 and k >= 1 is the following. When n = 2*m + 1, all divisors s of gcd(n, k) are odd. In such a case, k - (k/s) is even for all k >= 1, and thus (-1)^(k - (k/s)) = 1, and thus T(n = 2*m+1, k) = (1/n) * Sum_{s | gcd(n, k)} phi(s) * binomial(n/s, k/s) = A037306(2*m+1, k) = A047996(2*m+1, k).
By summing the products of the g.f. of column k times y^k from k = 1 to k = infinity, we get the bivariate g.f. for the array: Sum_{n, k >= 1} T(n, k)*x^n*y^k = Sum_{s >= 1} (phi(s)/s) * log((1 - x^s + (-x*y)^s)/(1 - x^s)) = -x/(1 - x) - Sum_{s >= 1} (phi(s)/s) * log(1 - x^s + (-x*y)^s).
Letting y = 1 in the above bivariate g.f., we get the g.f. of the sequence (Sum_{1 <= k <= n} T(n, k): n >= 1) is -x/(1 - x) - Sum_{s >= 1} (phi(s)/s) * log(1 - x^s + (-x)^s) = -x/(1 - x) + Sum_{m >= 0} (phi(2*m + 1)/(2*m + 1)) * log(1 - 2*x^(2*m+1)), which is the g.f. of sequence A082550. Hence, sequence A082550 consists of the row sums.
There is another important interpretation of this array T(n, k) which is related to some of the references for sequence A047996, but because the discussion is too lengthy, we omit the details.
(End)

Examples

			For n = 5, there is one way to pick one number (5), two ways to pick two numbers (1+4, 2+3), two ways to pick 3 numbers (1+4+5, 2+3+5), one way to pick 4 numbers (1+2+3+4), and one way to pick 5 numbers (1+2+3+4+5) so that their sum is divisible by 5. Therefore, T(5,1) = 1, T(5,2) = 2, T(5,3) = 2, T(5,4) = 1, and T(5,5) = 1.
Table for T(n,k) begins as follows:
n\k 1 2   3    4    5    6    7    8    9   10
1   1
2   1 0
3   1 1   1
4   1 1   1    0
5   1 2   2    1    1
6   1 2   4    3    1    0
7   1 3   5    5    3    1    1
8   1 3   7    9    7    3    1    0
9   1 4  10   14   14   10    4    1    1
10  1 4  12   22   26   20   12    5    1    0
...
		

Programs

  • Maple
    A267632 := proc(n,k)
        local a,msel,p;
        a := 0 ;
        for msel in combinat[choose](n,k) do
            if modp(add(p,p=msel),n) = 0 then
                a := a+1 ;
            end if;
        end do:
        a;
    end proc: # R. J. Mathar, May 15 2016
    # second Maple program:
    b:= proc(n, m, s) option remember; expand(`if`(n=0,
          `if`(s=0, 1, 0), b(n-1, m, s)+x*b(n-1, m, irem(s+n, m))))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=1..n))(b(n$2, 0)):
    seq(T(n), n=1..14);  # Alois P. Heinz, Aug 27 2018
  • Mathematica
    f[k_, n_] :=  Length[Select[Select[Subsets[Range[n]], Length[#] == k &], IntegerQ[Total[#]/n] &]];MatrixForm[Table[{n, Table[f[k, n], {k, n}]}, {n, 10}]] (* Dimitri Papadopoulos, Jan 18 2016 *)

Formula

T(2n+1, k) = A037306(2n+1, k) = A047996(2n+1, k).
From Petros Hadjicostas, Jul 13 2019: (Start)
T(n, k) = (1/n) * Sum_{s | gcd(n, k)} (-1)^(k - (k/s)) * phi(s) * binomial(n/s, k/s) for 1 <= k <= n.
G.f. for column k >= 1: (x^k/k) * Sum_{s|k} phi(s) * (-1)^(k - (k/s)) / (1 - x^s)^(k/s).
Bivariate g.f.: Sum_{n, k >= 1} T(n, k)*x^n*y^k = -x/(1 - x) - Sum_{s >= 1} (phi(s)/s) * log(1 - x^s + (-x*y)^s).
(End)
Sum_{k=1..n} k * T(n,k) = A309122(n). - Alois P. Heinz, Jul 13 2019

A220691 Table A(i,j) read by antidiagonals in order A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), ..., where A(i,j) is the number of ways in which we can add 2 distinct integers from the range 1..i in such a way that the sum is divisible by j.

Original entry on oeis.org

0, 0, 1, 0, 0, 3, 0, 1, 1, 6, 0, 0, 1, 2, 10, 0, 0, 1, 2, 4, 15, 0, 0, 1, 1, 4, 6, 21, 0, 0, 0, 2, 2, 5, 9, 28, 0, 0, 0, 1, 2, 3, 7, 12, 36, 0, 0, 0, 1, 2, 3, 5, 10, 16, 45, 0, 0, 0, 0, 2, 2, 4, 6, 12, 20, 55, 0, 0, 0, 0, 1, 3, 3, 6, 8, 15, 25, 66, 0, 0, 0, 0
Offset: 1

Author

Antti Karttunen, Feb 18 2013

Keywords

Examples

			The upper left corner of this square array starts as:
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
   1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, ...
   3, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, ...
   6, 2, 2, 1, 2, 1, 1, 0, 0, 0, 0, ...
  10, 4, 4, 2, 2, 2, 2, 1, 1, 0, 0, ...
  15, 6, 5, 3, 3, 2, 3, 2, 2, 1, 1, ...
Row 1 is all zeros, because it's impossible to choose two distinct integers from range [1]. A(2,1) = 1, as there is only one possibility to choose a pair of distinct numbers from the range [1,2] such that it is divisible by 1, namely 1+2. Also A(2,3) = 1, as 1+2 is divisible by 3.
A(4,1) = 2, as from [1,2,3,4] one can choose two pairs of distinct numbers whose sum is even: {1+3} and {2+4}.
		

Crossrefs

Transpose: A220692. The lower triangular region of this square array is given by A061857, which leaves out about half of the nonzero terms. A220693 is another variant giving 2n-1 terms from the beginning of each row, thus containing all the nonzero terms of this array.
The left column of the table: A000217. The following cases should be checked: the second column: A002620, the third column: A058212 (after the first two terms), the fourth column: A001971.

Programs

  • Mathematica
    a[n_, 1] := n*(n-1)/2; a[n_, k_] := Module[{r}, r = Reduce[1 <= i < j <= n && Mod[i + j, k] == 0, {i, j}, Integers]; Which[Head[r] === Or, Length[r], Head[r] === And, 1, r === False, 0, True, Print[r, " not parsed"]]]; Table[a[n-k+1, k], {n, 1, 13} , {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Mar 04 2014 *)

Formula

See Robert Israel's formula at A061857.

A032801 Number of unordered sets a, b, c, d of distinct integers from 1..n such that a+b+c+d = 0 (mod n).

Original entry on oeis.org

0, 0, 0, 0, 1, 3, 5, 9, 14, 22, 30, 42, 55, 73, 91, 115, 140, 172, 204, 244, 285, 335, 385, 445, 506, 578, 650, 734, 819, 917, 1015, 1127, 1240, 1368, 1496, 1640, 1785, 1947, 2109, 2289, 2470, 2670, 2870, 3090, 3311, 3553, 3795, 4059, 4324, 4612, 4900, 5212, 5525
Offset: 1

Keywords

Comments

From Petros Hadjicostas, Jul 12 2019: (Start)
By reading carefully the proof of Lemma 5.1 (pp. 65-66) in Barnes (1959), we see that he actually proved a general result (even though he does not state it in the lemma). For 1 <= k <= n, let T(n, k) be the number of unordered sets b_1, b_2, ..., b_k of k distinct integers from 1..n such that b_1 + b_2 + ... + b_k = 0 (mod n). The proof of Lemma 5.1 in the paper implies that T(n, k) = (1/n) * Sum_{s | gcd(n, k)} (-1)^(k - (k/s)) * phi(s) * binomial(n/s, k/s).
For fixed k >= 1, the g.f. of the sequence (T(n, k): n >= 1) (with T(n, k) = 0 for 1 <= n < k) is (x^k/k) * Sum_{s|k} phi(s) * (-1)^(k - (k/s)) / (1 - x^s)^(k/s).
For k = 4, we get T(n, k=4) = (1/n) * Sum_{d | gcd(n, 4)} (-1)^(4/s) * phi(d) * binomial(n/d, 4/d), which agrees with Barnes' 3-part formula in Lemma 5.1 and with the formula in N. J. A. Sloane's Maple program below. It also agrees with Colin Barker's formula below.
For k = 4, the g.f. is (x^4/4) * Sum_{s|4} phi(s) * (-1)^(4/s) /(1 - x^s)^(4/s), which agrees with Herbert Kociemba's g.f. below.
Barnes' (1959) formula is a special case of Theorem 4 (p. 66) in Ramanathan (1944). If R(n, k, v) is the number of unordered sets b_1, b_2, ..., b_k of k distinct integers from 1..n such that b_1 + b_2 + ... + b_k = v (mod n), then he proved that R(n, k, v) = (1/n) * Sum_{s | gcd(n,k)} (-1)^(k - (k/s)) * binomial(n/s, k/s) * C_s(v), where C_s(v) = A054533(s, v) is Ramanujan's sum (even though it was discovered first around 1900 by the Austrian mathematician R. D. von Sterneck).
Because C_s(v = 0) = phi(s), we get Barnes' (implicit) result; i.e., R(n, k, v=0) = T(n, k) and a(n) = R(n, k=4, v=0) = T(n, k=4).
For k=2, we have R(n, k=2, v=0) = T(n, k=2) = A004526(n-1) for n >= 1. For k=3, we have R(n, k=3, v=0) = T(n, k=3) = A058212(n) for n >= 1. For k=5, we have R(n, k=5, v=0) = T(n, k=5) = A008646(n-5) for n >= 5.
(End)

References

  • E. V. McLaughlin, Numbers of factorizations in non-unique factorial domains, Senior Thesis, Allegeny College, Meadville, PA, April 2004.

Crossrefs

Programs

  • Maple
    f := n-> if n mod 2 <> 0 then (n-1)*(n-2)*(n-3)/24 elif n mod 4 = 0 then (n-4)*(n^2-2*n+6)/24 else (n-2)*(n^2-4*n+6)/24; fi;
  • Mathematica
    CoefficientList[Series[(x^3 / 4) (1 / (1 - x)^4 + 1 / (1 - x^2)^2 - 2 / (1 - x^4)), {x, 0, 60}],x] (* Vincenzo Librandi, Jul 13 2019 *)

Formula

G.f.: x^5*(1+x-x^2+x^3)/((-1+x)^4*(1+x)^2*(1+x^2)). - Herbert Kociemba, Oct 22 2016
a(n) = (-6 * (4 + 2*(-1)^n + (-i)^n + i^n) + (25 + 3*(-1)^n)*n - 12*n^2 + 2*n^3)/48, where i = sqrt(-1). - Colin Barker, Oct 23 2016
a(n) = -A008610(-n), per formulae of Ralf Stephan (A008610) and C. Barker (above). Also, A008610(n) - a(n+4) = (1+(-1)^signum(n mod 4))/2, i.e., (1,0,0,0,1,0,0,0,...) repeating (offset 0). - Gregory Gerard Wojnar, Jul 09 2022

Extensions

Offset changed by David A. Corneth, Oct 23 2016
Showing 1-7 of 7 results.