A007997 a(n) = ceiling((n-3)(n-4)/6).
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
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.
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
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;
Links
- Reinhard Zumkeller, Rows n = 1..150 of triangle, flattened
- Stackexchange, Question 142323
- Index entries for sequences related to subset sums modulo m
Crossrefs
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.
0, 0, 1, 1, 2, 4, 6, 7, 10, 12, 16, 19, 22, 26
Offset: 1
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).
Links
- S. A. Burr, B. Grünbaum and N. J. A. Sloane, The Orchard Problem, Geometriae Dedicata, 2 (1974), 397-424.
- Zhao Hui Du, Orchard Planting Problem [From _Zhao Hui Du_, Nov 20 2008] [Seems to concentrate on the 4 trees per line version. - _N. J. A. Sloane_, Oct 16 2010]
- Noam D. Elkies, On some points-and-lines problems and configurations, arXiv:math/0612749 [math.MG], 2006; [Concerned with other versions of the problem].
- Erich Friedman, Table of values and bounds for up to 25 trees
- Z. Füredi and I. Palasti, Arrangements of lines with a large number of triangles, Proc. Amer. Math. Soc., 92(4):561-566, 1984.
- B. Green, T. Tao, On sets defining few ordinary lines, arXiv:1208.4714. (Shows that a(n) = [n(n-3)/6]+1 for all sufficiently large n.)
- R. Padmanabhan, Alok Shukla, Orchards in elliptic curves over finite fields, arXiv:2003.07172 [math.NT], 2020.
- Ed Pegg, Jr., Cultivating New Solutions for the Orchard-Planting Problem
- Ed Pegg, Jr., Illustration showing that a(15) >= 31 [Another version that uses all 31 triples from -7 to 7 which sum to 0 (mod 15). Coordinates are: {-7, {-1 - Sqrt[3], -1 + 2 Sqrt[3]}}, {-6, {2 (2 + Sqrt[3]), -5}}, {-5, {0, -3}}, {-4, {-2 (2 + Sqrt[3]), -1}}, {-3, {-2, 1}}, {-2, {2, -1}}, {-1, {2 (2 + Sqrt[3]), 1}}, {0, {0, 3}}, {1, {-2 (2 + Sqrt[3]), 5}}, {2, {1 + Sqrt[3], 1 - 2 Sqrt[3]}}, {3, {-2 (2 + Sqrt[3]), -1 - 2 Sqrt[3]}}, {4, {-2 - Sqrt[3], 1}}, {5, {0, 0}}, {6, {2 + Sqrt[3], -1}}, {7, {2 (2 + Sqrt[3]), 1 + 2 Sqrt[3]}}]
- Ed Pegg, Jr., Illustration showing that a(15) >= 31 and a(16) >= 37
- Ed Pegg, Jr., Illustration for a(16) = 37 [Based on a drawing in Burr-Grünbaum-Sloane (1974). The bottom left point is at -(sqrt(3), sqrt(5)). Note that 3 points and one line are at infinity.]
- Ed Pegg, Jr., Illustrations of constructions for 9 through 28 trees.
- G. B. Purdy and J. W. Smith, Lines, circles, planes and spheres, Discrete Comput. Geom., 44 (2010), 860-882. [Makes use of A003035 in a formula. - _N. J. A. Sloane_, Oct 19 2017]
- N. J. A. Sloane, Illustration of initial terms (from Grünbaum-Burr-Sloane paper)
- J. Solymosi and M. Stojakovic, Many collinear k-tuples with no k + 1 collinear points, Discrete & Computational Geometry, October 2013, Volume 50, Issue 3, pp 811-820; also arXiv 1107.0327, 2013.
- Eric Weisstein's World of Mathematics, Orchard-Planting Problem.
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.
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
Comments
In other words, the independence number of the (n-1)-triangular grid graph.
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
Links
- Colin Barker, Table of n, a(n) for n = 1..1000
- A. V. Geramita, D. Gregory, and L. Roberts, Monomial ideals and points in projective space, J. Pure Applied Alg 40 (1986), pp. 33-62.
- Stan Wagon, Graph Theory Problems from Hexagonal and Traditional Chess, The College Mathematics Journal, Vol. 45, No. 4, September 2014, pp. 278-287.
- Eric Weisstein's World of Mathematics, Independence Number
- Eric Weisstein's World of Mathematics, Triangular Grid Graph
- Index entries for linear recurrences with constant coefficients, signature (2,-1,1,-2,1).
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.
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
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 ...
Links
- Alois P. Heinz, Rows n = 1..150, flattened
- Eric Stephen Barnes, The construction of perfect and extreme forms I, Acta Arith., 5 (1959); see pp. 65-66.
- Michiel Kosters, The subset sum problem for finite abelian groups, J. Combin. Theory Ser. A 120 (2013), 527-530.
- Jiyou Li and Daqing Wan, Counting subset sums of finite abelian groups, J. Combin. Theory Ser. A 119 (2012), 170-182; see pp. 171-172.
- K. G. Ramanathan, Some applications of Ramanujan's trigonometrical sum C_m(n), Proc. Indian Acad. Sci., Sect. A 20 (1944), 62-69; see p. 66.
- R. D. von Sterneck, Ein Analogon zur additiven Zahlentheorie, Sitzungsber. Akad. Wiss. Sapientiae Math.-Naturwiss. Kl. 111 (1902), 1567-1601 (Abt. IIa).
- R. D. von Sterneck, Über ein Analogon zur additiven Zahlentheorie, Jahresbericht der Deutschen Mathematiker-Vereinigung 12 (1903), 110-113.
Crossrefs
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
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.
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
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}.
Links
Crossrefs
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).
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
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)
Von Sterneck (1902, 1903) dealt with this problem. In his notation, we need to find (n)i, the number of integer solutions of the congruence n = x_1 + ... + x_i (mod M) such that 0 <= x_1 < x_2 < ... < x_i < M, where (his n) = 0, (his M) = (our n), and (his i) = 4. He gave several formulas for solving this problem for various cases of his M (M = prime, M = product of two primes, M = power of 2, etc.). - _Petros Hadjicostas, Aug 20 2019
References
- E. V. McLaughlin, Numbers of factorizations in non-unique factorial domains, Senior Thesis, Allegeny College, Meadville, PA, April 2004.
Links
- Vincenzo Librandi, Table of n, a(n) for n = 1..1000
- Eric Stephen Barnes, The construction of perfect and extreme forms I, Acta Arith., 5 (1959); see pp. 65-66.
- David Broadhurst and Xavier Roulleau, Number of partitions of modular integers, arXiv:2502.19523 [math.NT], 2025. See pp. 4, 14, 19.
- K. G. Ramanathan, Some applications of Ramanujan's trigonometrical sum C_m(n), Proc. Indian Acad. Sci., Sect. A 20 (1944), 62-69; see p. 66.
- R. D. von Sterneck, Ein Analogon zur additiven Zahlentheorie, Sitzungsber. Akad. Wiss. Sapientiae Math.-Naturwiss. Kl. 111 (1902), 1567-1601 (Abt. IIa). [Accessible only in the USA through the HathiTrust Digital Library.]
- R. D. von Sterneck, Über ein Analogon zur additiven Zahlentheorie, Jahresbericht der Deutschen Mathematiker-Vereinigung 12 (1903), 110-113. [This is a summary of the 1902 paper.]
- Index entries for linear recurrences with constant coefficients, signature (2,0,-2,2,-2,0,2,-1).
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
Comments
Examples
References
Links
Crossrefs
Programs
Haskell
Maple
Mathematica
PARI
Formula