Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Search: a063865 -id:a063865
     Sort: relevance | references | number | modified | created      Format: long | short | data
A063865(4n-3).
+20
3
2, 8, 70, 722, 8220, 99820, 1265204, 16547220, 221653776, 3025553180, 41931984034, 588491482334, 8346638665718, 119447839104366, 1722663727780132, 25011714460877474, 365301750223042066, 5363288299585278800
OFFSET
1,1
LINKS
Ray Chandler, Table of n, a(n) for n = 1..835 (terms < 10^1000)
FORMULA
a(n) = 2*A104456(n).
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Jul 07 2008
STATUS
approved
Irregular triangle read by rows giving coefficients in expansion of Product_{k=1..n} (1 + x^k).
+10
82
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 3, 4, 4, 4, 5, 5, 5, 5, 4, 4, 4, 3, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 3, 4, 5, 5, 6, 7, 7, 8, 8, 8, 8, 8, 7, 7, 6, 5, 5, 4, 3, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 3, 4
OFFSET
0,11
COMMENTS
Or, triangle T(n,k) read by rows, giving number of subsets of {1,2,...,n} with sum k. - Roger CUCULIERE (cuculier(AT)imaginet.fr), Nov 19 2000
Row n consists of A000124(n) terms. These are also the successive vectors (their nonzero elements) when one starts with the infinite vector (of zeros) with 1 inserted somewhere and then shifts it one step (right or left) and adds to the original, then shifts the result two steps and adds, three steps and adds, etc. - Antti Karttunen, Feb 13 2002
T(n,k) = number of partitions of k into distinct parts <= n. Triangle of distribution of Wilcoxon's signed rank statistic. - Mitch Harris, Mar 23 2006
T(n,k) = number of binary words of length n in which the sum of the positions of the 0's is k. Example: T(4,5)=2 because we have 0110 (sum of the positions of the 0's is 1+4=5) and 1001 (sum of the positions of the 0's is 2+3=5). - Emeric Deutsch, Jul 23 2006
A fair coin is flipped n times. You receive i dollars for a "success" on the i-th flip, 1<=i<=n. T(n,k)/2^n is the probability that you will receive exactly k dollars. Your expectation is n(n+1)/4 dollars. - Geoffrey Critzer, May 16 2010
From Gus Wiseman, Jan 02 2023: (Start)
With offset 1, also the number of integer compositions of n whose partial sums add up to k for k = n..n(n+1)/2. For example, row n = 6 counts the following compositions:
6 15 24 33 42 51 141 231 321 411 1311 2211 3111 12111 21111 111111
114 123 132 222 312 1131 1221 2121 11121 11211
213 1113 1122 1212 2112 1111
(End)
REFERENCES
A. V. Yurkin, New binomial and new view on light theory, (book), 2013, 78 pages, no publisher listed.
LINKS
Steven R. Finch, Signum equations and extremal coefficients, February 7, 2009. [Cached copy, with permission of the author]
FindStat - Combinatorial Statistic Finder, The major index of an integer composition
Alexander Rosa and Štefan Znám, A combinatorial problem in the theory of congruences. (Russian), Mat.-Fys. Casopis Sloven. Akad. Vied 15 1965 49-59. [Annotated scanned copy] See Table 1.
F. Wilcoxon, Individual Comparisons by Ranking Methods, Biometrics Bulletin, v. 1, no. 6 (1945), pp. 80-83.
A. V. Yurkin, On similarity of systems of geometrical and arithmetic triangles, in Mathematics, Computing, Education Conference XIX, 2012.
A. V. Yurkin, New view on the diffraction discovered by Grimaldi and Gaussian beams, arXiv preprint arXiv:1302.6287 [physics.optics], 2013.
A. V. Yurkin, Symmetric triangle of Pascal and non-linear arithmetic parallelepiped, Book Manuscript, Research Gate 2015.
FORMULA
From Mitch Harris, Mar 23 2006: (Start)
T(n,k) = T(n-1, k) + T(n-1, k-n), T(0,0)=1, T(0,k) = 0, T(n,k) = 0 if k < 0 or k > (n+1 choose 2).
G.f.: (1+x)*(1+x^2)*...*(1+x^n). (End)
Sum_{k>=0} k * T(n,k) = A001788(n). - Alois P. Heinz, Feb 09 2017
max_{k>=0} T(n,k) = A025591(n). - Alois P. Heinz, Jan 20 2023
EXAMPLE
Triangle begins:
1;
1, 1;
1, 1, 1, 1;
1, 1, 1, 2, 1, 1, 1;
1, 1, 1, 2, 2, 2, 2, 2, 1, 1, 1;
1, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 2, 2, 1, 1, 1;
1, 1, 1, 2, 2, 3, 4, 4, 4, 5, 5, 5, 5, 4, 4, 4, 3, 2, 2, 1, 1, 1;
...
Row n = 4 counts the following binary words, where k = sum of positions of zeros:
1111 0111 1011 0011 0101 0110 0001 0010 0100 1000 0000
1101 1110 1001 1010 1100
Row n = 5 counts the following strict partitions of k with all parts <= n (0 is the empty partition):
0 1 2 3 4 5 42 43 53 54 532 542 543 5431 5432 54321
21 31 32 51 52 431 432 541 5321 5421
41 321 421 521 531 4321
MAPLE
with(gfun, seriestolist); map(op, [seq(seriestolist(series(mul(1+(z^i), i=1..n), z, binomial(n+1, 2)+1)), n=0..10)]); # Antti Karttunen, Feb 13 2002
# second Maple program:
g:= proc(n) g(n):= `if`(n=0, 1, expand(g(n-1)*(1+x^n))) end:
T:= n-> seq(coeff(g(n), x, k), k=0..degree(g(n))):
seq(T(n), n=0..10); # Alois P. Heinz, Nov 19 2012
MATHEMATICA
Table[CoefficientList[ Series[Product[(1 + t^i), {i, 1, n}], {t, 0, 100}], t], {n, 0, 8}] // Grid (* Geoffrey Critzer, May 16 2010 *)
CROSSREFS
Rows reduced modulo 2 and interpreted as binary numbers: A068052, A068053. Rows converge towards A000009.
Row sums give A000079.
Cf. A285101 (multiplicative encoding of each row), A285103 (number of odd terms on row n), A285105 (number of even terms).
Row lengths are A000124.
A reciprocal version is (A033999, A219977, A291983, A291984, A291985, ...).
A negative version is A231599.
A version for partitions is A358194, reversed partitions A264034.
KEYWORD
tabf,nonn,easy,nice
AUTHOR
N. J. A. Sloane, Mar 22 2000
STATUS
approved
Cake numbers: maximal number of pieces resulting from n planar cuts through a cube (or cake): C(n+1,3) + n + 1.
(Formerly M1100 N0419)
+10
79
1, 2, 4, 8, 15, 26, 42, 64, 93, 130, 176, 232, 299, 378, 470, 576, 697, 834, 988, 1160, 1351, 1562, 1794, 2048, 2325, 2626, 2952, 3304, 3683, 4090, 4526, 4992, 5489, 6018, 6580, 7176, 7807, 8474, 9178, 9920, 10701, 11522, 12384, 13288, 14235, 15226
OFFSET
0,2
COMMENTS
Note that a(n) = a(n-1) + A000124(n-1). This has the following geometrical interpretation: Define a number of planes in space to be in general arrangement when
(1) no two planes are parallel,
(2) there are no two parallel intersection lines,
(3) there is no point common to four or more planes.
Suppose there are already n-1 planes in general arrangement, thus defining the maximal number of regions in space obtainable by n-1 planes and now one more plane is added in general arrangement. Then it will cut each of the n-1 planes and acquire intersection lines which are in general arrangement. (See the comments on A000124 for general arrangement with lines.) These lines on the new plane define the maximal number of regions in 2-space definable by n-1 straight lines, hence this is A000124(n-1). Each of this regions acts as a dividing wall, thereby creating as many new regions in addition to the a(n-1) regions already there, hence a(n) = a(n-1) + A000124(n-1). - Peter C. Heinig (algorithms(AT)gmx.de), Oct 19 2006
More generally, we have: A000027(n) = binomial(n,0) + binomial(n,1) (the natural numbers), A000124(n) = binomial(n,0) + binomial(n,1) + binomial(n,2) (the Lazy Caterer's sequence), a(n) = binomial(n,0) + binomial(n,1) + binomial(n,2) + binomial(n,3) (Cake Numbers). - Peter C. Heinig (algorithms(AT)gmx.de), Oct 19 2006
If Y is a 2-subset of an n-set X then, for n>=3, a(n-3) is the number of 3-subsets of X which do not have exactly one element in common with Y. - Milan Janjic, Dec 28 2007
a(n) is the number of compositions (ordered partitions) of n+1 into four or fewer parts or equivalently the sum of the first four terms in the n-th row of Pascal's triangle. - Geoffrey Critzer, Jan 23 2009
{a(k): 0 <= k < 4} = divisors of 8. - Reinhard Zumkeller, Jun 17 2009
a(n) is also the maximum number of different values obtained by summing n consecutive positive integers with all possible 2^n sign combinations. This maximum is first reached when summing the interval [n, 2n-1]. - Olivier Gérard, Mar 22 2010
a(n) contains only 5 perfect squares > 1: 4, 64, 576, 67600, and 75203584. The incidences of > 0 are given by A047694. - Frank M Jackson, Mar 15 2013
Given n tiles with two values - an A value and a B value - a player may pick either the A value or the B value. The particular tiles are [n, 0], [n-1, 1], ..., [2, n-2] and [1, n-1]. The sequence is the number of different final A:B counts. For example, with n=4, we can have final total [5, 3] = [4, _] + [_, 1] + [_, 2] + [1, _] = [_, 0] + [3, _] + [2, _] + [_, 3], so a(4) = 2^4 - 1 = 15. The largest and smallest final A+B counts are given by A077043 and A002620 respectively. - Jon Perry, Oct 24 2014
For n>=3, a(n) is also the number of maximal cliques in the (n+1)-triangular graph (the 4-triangular graph has a(3)=8 maximal cliques). - Andrew Howroyd, Jul 19 2017
a(n) is the number of binary words of length n matching the regular expression 1*0*1*0*. Coincidentally, A000124 counts binary words of the form 0*1*0*. See Alexandersson and Nabawanda for proof. - Per W. Alexandersson, May 15 2021
For n > 0, let the n-dimensional cube, {0,1}^n be provided with the Hamming distance, d. Given an element x in {0,1}^n, a(n) is the number of elements y in {0,1}^n such that d(x, y) <= 3. Example: n = 4. Let x = (0,0,0,0) be in {0,1}^4.
d(x,y) = 0: y in {(0,0,0,0)}.
d(x,y) = 1: y in {(1,0,0,0), (0,1,0,0), (0,0,1,0), (0,0,0,1)}.
d(x,y) = 2: y in {(1,1,0,0), (1,0,1,0), (1,0,0,1), (0,1,1,0), (0,1,0,1), (0,0,1,1)}.
d(x,y) = 3: y in {(1,1,1,0), (1,1,0,1), (1,0,1,1), (0,1,1,1)}.
All these y are at a distance <= 3 from (0,0,0,0), so a(4) = 15. (See Peter C. Heinig's formula). - Yosu Yurramendi, Dec 14 2021
For n >= 2, a(n) is the number of distinct least squares regression lines fitted to n points (j,y_j), 1 <= j <= n, where each y_j is 0 or 1. The number of distinct lines with exactly k 1's among y_1, ..., y_n is A077028(n,k). The number of distinct slopes is A123596(n). - Pontus von Brömssen, Mar 16 2024
REFERENCES
V. I. Arnold (ed.), Arnold's Problems, Springer, 2004, comments on Problem 1990-11 (p. 75), pp. 503-510. Numbers N_3.
R. B. Banks, Slicing Pizzas, Racing Turtles and Further Adventures in Applied Mathematics, Princeton Univ. Press, 1999. See p. 27.
L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 72, Problem 2.
H. E. Dudeney, Amusements in Mathematics, Nelson, London, 1917, page 177.
N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
T. H. Stickels, Mindstretching Puzzles. Sterling, NY, 1994 p. 85.
W. A. Whitworth, DCC Exercises in Choice and Chance, Stechert, NY, 1945, p. 30.
A. M. Yaglom and I. M. Yaglom: Challenging Mathematical Problems with Elementary Solutions. Vol. I. Combinatorial Analysis and Probability Theory. New York: Dover Publications, Inc., 1987, p. 13, #45 (First published: San Francisco: Holden-Day, Inc., 1964)
LINKS
P. Alexandersson and O. Nabawanda, Peaks are preserved under run-sorting, arXiv:2104.04220 [math.CO], 2021.
A. M. Baxter and L. K. Pudwell, Ascent sequences avoiding pairs of patterns, 2014.
M. L. Cornelius, Variations on a geometric progression, Mathematics in School, 4 (No. 3, May 1975), p. 32. (Annotated scanned copy)
F. Javier de Vega, An extension of Furstenberg's theorem of the infinitude of primes, arXiv:2003.13378 [math.NT], 2020.
Zachary Hoelscher, Semicomplete Arithmetic Sequences, Division of Hypercubes, and the Pell Constant, arXiv:2102.07083 [math.NT], 2021. Mentions this sequence.
Marie Lejeune, On the k-binomial equivalence of finite words and k-binomial complexity of infinite words, Ph. D. Thesis, Université de Liège (Belgium, 2021).
D. A. Lind, On a class of nonlinear binomial sums, Fib. Quart., 3 (1965), 292-298.
Svante Linusson, The number of M-sequences and f-vectors, Combinatorica, vol 19 no 2 (1999) 255-266.
Toufik Mansour, Howard Skogman, and Rebecca Smith, Sorting inversion sequences, arXiv:2401.06662 [math.CO], 2024. See page 7.
Ângela Mestre and José Agapito, Square Matrices Generated by Sequences of Riordan Arrays, J. Int. Seq., Vol. 22 (2019), Article 19.8.4.
Sebastian Mizera and Sabrina Pasterski, Celestial Geometry, arXiv:2204.02505 [hep-th], 2022.
Alexsandar Petojevic, The Function vM_m(s; a; z) and Some Well-Known Sequences, Journal of Integer Sequences, Vol. 5 (2002), Article 02.1.7.
Simon Plouffe, Approximations de séries génératrices et quelques conjectures, Dissertation, Université du Québec à Montréal, 1992; arXiv:0911.4975 [math.NT], 2009.
Simon Plouffe, 1031 Generating Functions, Appendix to Thesis, Montreal, 1992
D. J. Price, Some unusual series occurring in n-dimensional geometry, Math. Gaz., 30 (1946), 149-150.
L. Pudwell and A. Baxter, Ascent sequences avoiding pairs of patterns, 2014.
Luis Manuel Rivera, Integer sequences and k-commuting permutations, arXiv preprint arXiv:1406.3081 [math.CO], 2014.
Eric Weisstein's World of Mathematics, Cake Number
Eric Weisstein's World of Mathematics, Cube Division by Planes
Eric Weisstein's World of Mathematics, Cylinder Cutting
Eric Weisstein's World of Mathematics, Maximal Clique
Eric Weisstein's World of Mathematics, Space Division by Planes
Eric Weisstein's World of Mathematics, Triangular Graph
Reinhard Zumkeller, Enumerations of Divisors
FORMULA
a(n) = (n+1)*(n^2-n+6)/6 = (n^3 + 5*n + 6) / 6.
G.f.: (1 - 2*x + 2x^2)/(1-x)^4. - [Simon Plouffe in his 1992 dissertation.]
E.g.f.: (1 + x + x^2/2 + x^3/6)*exp(x).
a(n) = binomial(n,3) + binomial(n,2) + binomial(n,1) + binomial(n,0). - Peter C. Heinig (algorithms(AT)gmx.de), Oct 19 2006
Paraphrasing the previous comment: the sequence is the binomial transform of [1,1,1,1,0,0,0,...]. - Gary W. Adamson, Oct 23 2007
From Ilya Gutkovskiy, Jul 18 2016: (Start)
a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4).
a(n) = Sum_{k=0..n} A152947(k+1).
Inverse binomial transform of A134396.
Sum_{n>=0} a(n)/n! = 8*exp(1)/3. (End)
a(n) = -A283551(-n). - Michael Somos, Jul 07 2022
EXAMPLE
a(4)=15 because there are 15 compositions of 5 into four or fewer parts. a(6)=42 because the sum of the first four terms in the 6th row of Pascal's triangle is 1+6+15+20=42. - Geoffrey Critzer, Jan 23 2009
For n=5, (1, 3, 5, 7, 9, 11, 13, 17, 19, 21, 23, 25, 35) and their opposite are the 26 different sums obtained by summing 5,6,7,8,9 with any sign combination. - Olivier Gérard, Mar 22 2010
G.f. = 1 + 2*x + 4*x^2 + 8*x^3 + 15*x^4 + 26*x^5 + 42*x^6 + 64*x^7 + ... - Michael Somos, Jul 07 2022
MAPLE
A000125 := n->(n+1)*(n^2-n+6)/6;
MATHEMATICA
Table[(n^3 + 5 n + 6)/6, {n, 0, 50}] (* Harvey P. Dale, Jan 19 2013 *)
LinearRecurrence[{4, -6, 4, -1}, {1, 2, 4, 8}, 50] (* Harvey P. Dale, Jan 19 2013 *)
Table[Binomial[n, 3] + n, {n, 20}] (* Eric W. Weisstein, Jul 21 2017 *)
PROG
(PARI) a(n)=(n^2+5)*n/6+1 \\ Charles R Greathouse IV, Jun 15 2011
(PARI) Vec((1-2*x+2*x^2)/((1-x)^4) + O(x^100)) \\ Altug Alkan, Oct 16 2015
(Magma) [(n^3+5*n+6)/6: n in [0..50]]; // Vincenzo Librandi, Nov 08 2014
(Python)
def A000125_gen(): # generator of terms
a, b, c = 1, 1, 1
while True:
yield a
a, b, c = a+b, b+c, c+1
it = A000125_gen()
A000125_list = [next(it) for _ in range(50)] # Cole Dykstra, Aug 03 2022
KEYWORD
nonn,easy,nice
EXTENSIONS
Minor typo in comments corrected by Mauro Fiorentini, Jan 02 2018
STATUS
approved
Maximal coefficient of Product_{k<=n} (1 + x^k). Number of solutions to +- 1 +- 2 +- 3 +- ... +- n = 0 or 1.
+10
51
1, 1, 1, 2, 2, 3, 5, 8, 14, 23, 40, 70, 124, 221, 397, 722, 1314, 2410, 4441, 8220, 15272, 28460, 53222, 99820, 187692, 353743, 668273, 1265204, 2399784, 4559828, 8679280, 16547220, 31592878, 60400688, 115633260, 221653776, 425363952, 817175698
OFFSET
0,4
COMMENTS
If k is allowed to approach infinity, this gives the partition numbers A000009.
a(n) is the maximal number of subsets of {1,2,...,n} that share the same sum.
LINKS
T. D. Noe, Alois P. Heinz and Ray Chandler, Table of n, a(n) for n = 0..3339 (terms < 10^1000, first 201 terms from T. D. Noe, next 200 terms from Alois P. Heinz)
Dorin Andrica and Ioan Tomescu, On an Integer Sequence Related to a Product of Trigonometric Functions, and Its Combinatorial Relevance , Journal of Integer Sequences, Vol. 5 (2002), Article 02.2.4.
Vlad-Florin Dragoi and Valeriu Beiu, Fast Reliability Ranking of Matchstick Minimal Networks, arXiv:1911.01153 [cs.DM], 2019.
Steven R. Finch, Signum equations and extremal coefficients, February 7, 2009. [Cached copy, with permission of the author]
Erich Friedman and Mike Keith, Magic Carpets, J. Int Sequences, 3 (2000), Article 00.2.5.
Susumu Kubo, Partially Ordered Sets Corresponding to the Partition Problem, arXiv:2405.05544 [cs.DM], 2024. See pp. 2, 16.
Marco Mondelli, S. Hamed Hassani, and Rüdiger Urbanke, Construction of Polar Codes with Sublinear Complexity, arXiv preprint arXiv:1612.05295 [cs.IT], 2016-2017. See Sect. I.
Robert A. Proctor, Solution of two difficult combinatorial problems with linear algebra, American Mathematical Monthly 89, 721-734.
Blair D. Sullivan, On a conjecture of Adrica and Tomescu, J. Int. Sequences 16 (2013), Article 13.3.1.
FORMULA
a(n) = A063865(n) + A063866(n).
a(n) ~ sqrt(6/Pi) * 2^n / n^(3/2) [conjectured by Andrica and Tomescu (2002) and proved by Sullivan (2013)]. - Vaclav Kotesovec, Mar 17 2020
More precise asymptotics: a(n) ~ sqrt(6/Pi) * 2^n / n^(3/2) * (1 - 6/(5*n) + 589/(560*n^2) - 39/(50*n^3) + ...). - Vaclav Kotesovec, Dec 30 2022
a(n) = max_{k>=0} A053632(n,k). - Alois P. Heinz, Jan 20 2023
MAPLE
b:= proc(n, i) option remember; `if`(n>i*(i+1)/2, 0,
`if`(i=0, 1, b(n+i, i-1)+b(abs(n-i), i-1)))
end:
a:=n-> b(0, n)+b(1, n):
seq(a(n), n=0..40); # Alois P. Heinz, Mar 10 2014
MATHEMATICA
f[n_, s_] := f[n, s]=Which[n==0, If[s==0, 1, 0], Abs[s]>(n*(n+1))/2, 0, True, f[n-1, s-n]+f[n-1, s+n]]; Table[Which[Mod[n, 4]==0||Mod[n, 4]==3, f[n, 0], Mod[n, 4]==1||Mod[n, 4]==2, f[n, 1]], {n, 0, 40}]
(* Second program: *)
p = 1; Flatten[{1, Table[p = Expand[p*(1 + x^n)]; Max[CoefficientList[p, x]], {n, 1, 50}]}] (* Vaclav Kotesovec, May 04 2018 *)
b[n_, i_] := b[n, i] = If[n > i(i+1)/2, 0, If[i == 0, 1, b[n+i, i-1] + b[Abs[n-i], i-1]]];
a[n_] := b[0, n] + b[1, n]; a /@ Range[0, 40] (* Jean-François Alcover, Feb 17 2020, after Alois P. Heinz *)
PROG
(PARI) a(n)=if(n<0, 0, polcoeff(prod(k=1, n, 1+x^k), n*(n+1)\4))
(Python)
from collections import Counter
def A025591(n):
c = {0:1, 1:1}
for i in range(2, n+1):
d = Counter(c)
for k in c:
d[k+i] += c[k]
c = d
return max(c.values()) # Chai Wah Wu, Jan 31 2024
KEYWORD
nonn,nice
STATUS
approved
Number of ways of writing 0 as Sum_{k=-n..n} e(k)*k, where e(k) is 0 or 1.
(Formerly M1155 N0439)
+10
31
2, 4, 8, 20, 52, 152, 472, 1520, 5044, 17112, 59008, 206260, 729096, 2601640, 9358944, 33904324, 123580884, 452902072, 1667837680, 6168510256, 22903260088, 85338450344, 318995297200, 1195901750512, 4495448217544, 16940411201280, 63983233268592
OFFSET
0,1
COMMENTS
The 4-term sequence 2,4,8,20 is the answer to the "Solitaire Army" problem, or checker-jumping puzzle. It is too short to have its own entry. See Conway et a;., Winning Ways, Vol. 2, pp. 715-717. - N. J. A. Sloane, Mar 01 2018
Number of subsets of {-n..n} with sum 0. Also the number of subsets of {0..2n} that are empty or have mean n. For median instead of mean we have twice A024718. - Gus Wiseman, Apr 23 2023
REFERENCES
L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 294.
E. R. Berlekamp, J. H. Conway and R. K. Guy, Winning Ways, Academic Press, NY, 2 vols., 1982, see pp. 715-717.
N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
Ray Chandler, Table of n, a(n) for n = 0..1668 (terms < 10^1000; terms 0..200 from T. D. Noe, terms 201..400 from Alois P. Heinz)
Eunice Y. S. Chan and R. M. Corless, Narayana, Mandelbrot, and A New Kind of Companion Matrix, arXiv preprint arXiv:1606.09132 [math.CO], 2016.
R. C. Entringer, Representation of m as Sum_{k=-n..n} epsilon_k k, Canad. Math. Bull., 11 (1968), 289-293.
Steven R. Finch, Signum equations and extremal coefficients, February 7, 2009. [Cached copy, with permission of the author]
J. H. van Lint, Representations of 0 as Sum_{k = -N..N} epsilon_k*k, Proc. Amer. Math. Soc., 18 (1967), 182-184.
FORMULA
Constant term of Product_{k=-n..n} (1+x^k).
a(n) = Sum_i A067059(2n+1-i, i) = 2+2*Sum_j A047997(n, j); i.e., sum of alternate antidiagonals of A067059 and two more than twice row sums of A047997. - Henry Bottomley, Aug 11 2002
a(n) = A004171(n) - 2*A181765(n).
Coefficient of x^(n*(n+1)/2) in 2*Product_{k=1..n} (1+x^k)^2. - Sean A. Irvine, Oct 03 2011
From Gus Wiseman, Apr 23 2023: (Start)
a(n) = 2*A047653(n).
a(n) = A070925(2n+1) + 1.
a(n) = 2*A133406(2n+1).
a(n) = 2*(A212352(n) + 1).
a(n) = A222955(2n+1).
a(n) = 2*(A362046(2n) + 1).
(End)
EXAMPLE
From Gus Wiseman, Apr 23 2023: (Start)
The a(0) = 2 through a(2) = 8 subsets of {-n..n} with sum 0 are:
{} {} {}
{0} {0} {0}
{-1,1} {-1,1}
{-1,0,1} {-2,2}
{-1,0,1}
{-2,0,2}
{-2,-1,1,2}
{-2,-1,0,1,2}
(End)
MAPLE
b:= proc(n, i) option remember; `if`(n>i*(i+1)/2, 0,
`if`(i=0, 1, 2*b(n, i-1)+b(n+i, i-1)+b(abs(n-i), i-1)))
end:
a:=n-> 2*b(0, n):
seq(a(n), n=0..40); # Alois P. Heinz, Mar 10 2014
MATHEMATICA
a[n_] := SeriesCoefficient[ Product[1+x^k, {k, -n, n}], {x, 0, 0}]; a[0] = 2; Table[a[n], {n, 0, 24}](* Jean-François Alcover, Nov 28 2011 *)
nmax = 26; d = {2}; a1 = {};
Do[
i = Ceiling[Length[d]/2];
AppendTo[a1, If[i > Length[d], 0, d[[i]]]];
d = PadLeft[d, Length[d] + 2 n] + PadRight[d, Length[d] + 2 n] +
2 PadLeft[PadRight[d, Length[d] + n], Length[d] + 2 n];
, {n, nmax}];
a1 (* Ray Chandler, Mar 15 2014 *)
Table[Length[Select[Subsets[Range[-n, n]], Total[#]==0&]], {n, 0, 5}] (* Gus Wiseman, Apr 23 2023 *)
PROG
(PARI) a(n)=polcoeff(prod(k=-n, n, 1+x^k), 0)
(Haskell) a000980 n = length $ filter ((== 0) . sum) $ subsequences [-n..n]
CROSSREFS
A047653(n) = a(n)/2.
Bisection of A084239. Cf. A063865, A141000.
A007318 counts subsets by length, A327481 by integer mean.
A327475 counts subsets with integer mean, A000975 integer median.
KEYWORD
nonn,nice
EXTENSIONS
More terms from Michael Somos, Jun 10 2000
STATUS
approved
a(n) is the number of times that sums 3 +- 5 +- 7 +- 11 +- ... +- prime(2n+1) of the first 2n odd primes is zero. There are 2^(2n-1) choices for the sign patterns.
+10
27
0, 0, 1, 2, 7, 19, 63, 197, 645, 2172, 7423, 25534, 89218, 317284, 1130526, 4033648, 14515742, 52625952, 191790090, 702333340, 2585539586, 9570549372, 35562602950, 131774529663, 491713178890, 1842214901398, 6909091641548
OFFSET
1,4
COMMENTS
The frequency of each possible sum is computed by the Mathematica program without explicitly computing the individual sums. Let S = 3 + 5 + 7 + ... + prime(2n+1). Because the primes do not grow very fast, it is easy to show that, for n > 2, all even numbers between -S+20 and S-20 occur at least once as a sum.
a(n) is the maximal number of subsets of {prime(2), prime(3), ..., prime(n+1)} that share the same sum. Cf. A025591, A083527.
See A238894 for a more general sequence that looks at all sums formed. - T. D. Noe, Mar 07 2014
LINKS
Ray Chandler, Table of n, a(n) for n = 1..1000 (first 100 terms from T. D. Noe)
FORMULA
a(n) = A022897(2n). - M. F. Hasler, Aug 08 2015
EXAMPLE
a(3) = 1 because there is only one sign pattern of the first six odd primes that yields zero: 3 + 5 + 7 - 11 + 13 - 17.
MATHEMATICA
d={1, 0, 0, 1}; nMax=32; zeroLst={}; Do[p=Prime[n+1]; d=PadLeft[d, Length[d]+p]+PadRight[d, Length[d]+p]; If[0==Mod[n, 2], AppendTo[zeroLst, d[[(Length[d]+1)/2]]]], {n, 2, nMax}]; zeroLst/2
PROG
(PARI) A083309(n, rhs=0, firstprime=2)={rhs-=prime(firstprime); my(p=vector(2*n-2+bittest(rhs, 0), i, prime(i+firstprime))); sum(i=1, 2^#p-1, sum(j=1, #p, (-1)^bittest(i, j-1)*p[j])==rhs)} \\ For illustrative purpose, too slow for n >> 10. - M. F. Hasler, Aug 08 2015
CROSSREFS
Cf. A022894 (use all primes in the sum), A022895 (r.h.s. = 1), A022896 (r.h.s. = 2), A022897 (interleaved 0 for odd number of terms), ..., A022903 (using primes >= 7), A022904, A022920; A261061 - A261063 and A261044 (r.h.s. = -1); A261057, A261059, A261060, A261045 (r.h.s. = -2).
KEYWORD
nonn
AUTHOR
T. D. Noe, Apr 29 2003
STATUS
approved
Number of solutions to k_1 + 2*k_2 + ... + n*k_n = 0, where k_i are from {-1,0,1}, i=1..n.
(Formerly M2656)
+10
22
1, 1, 1, 3, 7, 15, 35, 87, 217, 547, 1417, 3735, 9911, 26513, 71581, 194681, 532481, 1464029, 4045117, 11225159, 31268577, 87404465, 245101771, 689323849, 1943817227, 5494808425, 15568077235, 44200775239, 125739619467
OFFSET
0,4
COMMENTS
Also, number of maximally stable towers of 2 X 2 LEGO blocks.
REFERENCES
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
P. J. S. Watson, On "LEGO" towers, J. Rec. Math., 12 (No. 1, 1979-1980), 24-27.
LINKS
Ray Chandler, Table of n, a(n) for n = 0..2106 (terms < 10^1000; first 101 terms from T. D. Noe)
D. Andrica and O. Bagdasar, Some remarks on 3-partitions of multisets, Electron. Notes Discrete Math., TCDM'18 (2018).
Dorin Andrica and Ovidiu Bagdasar, On k-partitions of multisets with equal sums, The Ramanujan J. (2021) Vol. 55, 421-435.
Andrei Asinowski, Axel Bacher, Cyril Banderier, and Bernhard Gittenberger, Analytic combinatorics of lattice paths with forbidden patterns, the vectorial kernel method, and generating functions for pushdown automata, Laboratoire d'Informatique de Paris Nord (LIPN 2019).
Steven R. Finch, Signum equations and extremal coefficients [Broken link]
Steven R. Finch, Signum equations and extremal coefficients, February 7, 2009. [Cached copy, with permission of the author]
P. J. S. Watson, On "LEGO" towers, J. Rec. Math., 12 (No. 1, 1979-1980), 24-27. (Annotated scanned copy)
FORMULA
Coefficient of x^(n*(n+1)/2) in Product_{k=1..n} (1+x^k+x^(2*k)).
Equivalently, the coefficient of x^0 in Product_{k=1..n} (1/x^k + 1 + x^k). - Paul D. Hanna, Jul 10 2018
a(n) ~ 3^(n + 1) / (2 * sqrt(Pi) * n^(3/2)). - Vaclav Kotesovec, Jul 11 2018
a(n) = (1/(2*Pi))*Integral_{t=0..2*Pi} ( Product_{k=1..n} (1+2*cos(k*t)) ) dt. - Ovidiu Bagdasar, Aug 08 2018
EXAMPLE
For n=4 there are 7 solutions: (-1,-1,1,0), (-1,0,-1,1), (-1,1,1,-1), (0,0,0,0), (1,-1,-1,1), (1,0,1,-1), (1,1,-1,0).
MATHEMATICA
f[0] = 1; f[n_] := Coefficient[Expand@ Product[1 + x^k + x^(2k), {k, n}], x^(n(n + 1)/2)]; Table[f@n, {n, 0, 28}] (* Robert G. Wilson v, Nov 10 2006 *)
PROG
(Maxima) a(n):=coeff(expand(product(1+x^k+x^(2*k), k, 1, n)), x, binomial(n+1, 2));
makelist(a(n), n, 0, 24);
CROSSREFS
KEYWORD
easy,nonn
EXTENSIONS
More terms from David Wasserman, Mar 29 2005
Edited by N. J. A. Sloane, Nov 07 2006. This is a merging of two sequences which, thanks to the work of Søren Eilers, we now know are identical.
STATUS
approved
Number of solutions to 1 +- 2 +- 3 +- ... +- n = 0.
+10
21
0, 0, 1, 1, 0, 0, 4, 7, 0, 0, 35, 62, 0, 0, 361, 657, 0, 0, 4110, 7636, 0, 0, 49910, 93846, 0, 0, 632602, 1199892, 0, 0, 8273610, 15796439, 0, 0, 110826888, 212681976, 0, 0, 1512776590, 2915017360, 0, 0, 20965992017, 40536016030, 0, 0, 294245741167
OFFSET
1,7
COMMENTS
Consider the set { 1,2,3,...,n }. Sequence gives number of ways this set can be partitioned into 2 subsets with equal sums. For example, when n = 7, { 1,2,3,4,5,6,7} can be partitioned in 4 ways: {1,6,7} {2,3,4,5}; {2,5,7} {1,3,4,6}; {3,4,7} {1,2,5,6} and {1,2,4,7} {3,5,6}. - sorin (yamba_ro(AT)yahoo.com), Mar 24 2007
The "equal sums" of Sorin's comment are the positive terms of A074378 (Even triangular numbers halved). In the current sequence a(n) <> 0 iff n is the positive index (A014601) of an even triangular number (A014494). - Rick L. Shepherd, Feb 09 2010
a(n) is the number of partitions of n(n-3)/4 into distinct parts not exceeding n-1. - Alon Amit, Oct 18 2017
a(n) is the coefficient of x^(n*(n+1)/4-1) of Product_{k=2..n} (1+x^k). - Jianing Song, Nov 19 2021
LINKS
Alois P. Heinz and Ray Chandler, Table of n, a(n) for n = 1..3342 (terms < 10^1000, first 1000 terms from Alois P. Heinz)
Larry Glasser, A formula for A058377, Jul 29 2019
FORMULA
a(n) is half the coefficient of q^0 in product('(q^(-k)+q^k)', 'k'=1..n) for n >= 1. - Floor van Lamoen, Oct 10 2005
a(4n+1) = a(4n+2) = 0. - Michael Somos, Apr 15 2007
a(n) = [x^n] Product_{k=1..n-1} (x^k + 1/x^k). - Ilya Gutkovskiy, Feb 01 2024
EXAMPLE
1+2-3=0, so a(3)=1;
1-2-3+4=0, so a(4)=1;
1+2-3+4-5-6+7=0, 1+2-3-4+5+6-7=0, 1-2+3+4-5+6-7=0, 1-2-3-4-5+6+7=0, so a(7)=4.
MAPLE
b:= proc(n, i) option remember; local m; m:= i*(i+1)/2;
`if`(n>m, 0, `if`(n=m, 1, b(abs(n-i), i-1) +b(n+i, i-1)))
end:
a:= n-> `if`(irem(n-1, 4)<2, 0, b(n, n-1)):
seq(a(n), n=1..60); # Alois P. Heinz, Oct 30 2011
MATHEMATICA
f[n_, s_] := f[n, s] = Which[n == 0, If[s == 0, 1, 0], Abs[s] > (n*(n + 1))/2, 0, True, f[n - 1, s - n] + f[n - 1, s + n]]; Table[ f[n, 0]/2, {n, 1, 50}]
PROG
(PARI) list(n) = my(poly=vector(n), v=vector(n)); poly[1]=1; for(k=2, n, poly[k]=poly[k-1]*(1+'x^k)); for(k=1, n, if(k%4==1||k%4==2, v[k]=0, v[k]=polcoeff(poly[k], k*(k+1)/4-1))); v \\ Jianing Song, Nov 19 2021
KEYWORD
nonn
AUTHOR
Naohiro Nomoto, Dec 19 2000
EXTENSIONS
More terms from Sascha Kurz, Mar 25 2002
Edited and extended by Robert G. Wilson v, Oct 24 2002
STATUS
approved
Number of solutions to +- 1 +- 2 +- 3 +- ... +- n = 1.
+10
18
0, 1, 1, 0, 0, 3, 5, 0, 0, 23, 40, 0, 0, 221, 397, 0, 0, 2410, 4441, 0, 0, 28460, 53222, 0, 0, 353743, 668273, 0, 0, 4559828, 8679280, 0, 0, 60400688, 115633260, 0, 0, 817175698, 1571588177, 0, 0, 11243980807, 21704569869, 0, 0, 156860869714
OFFSET
0,6
LINKS
Ray Chandler, Table of n, a(n) for n = 0..3340 (terms < 10^1000; first 101 terms from T. D. Noe)
FORMULA
a(n) equals the coefficient of x in Product_{k=1..n} (x^k + 1/x^k). - Paul D. Hanna, Jul 10 2018
MATHEMATICA
f[n_, s_] := f[n, s]=Which[n==0, If[s==0, 1, 0], Abs[s]>(n*(n+1))/2, 0, True, f[ n-1, s-n]+f[n-1, s+n]]; a[n_] := f[n, 1]
nmax = 50; d = {1}; a1 = {};
Do[
i = Ceiling[Length[d]/2] + 1;
AppendTo[a1, If[i > Length[d], 0, d[[i]]]];
d = PadLeft[d, Length[d] + 2 n] + PadRight[d, Length[d] + 2 n];
, {n, nmax}];
a1 (* Ray Chandler, Mar 14 2014 *)
CROSSREFS
KEYWORD
nonn,easy,nice
AUTHOR
N. J. A. Sloane, following a suggestion by J. H. Conway, Aug 27 2001
EXTENSIONS
More terms from Dean Hickerson and Vladeta Jovovic, Aug 28 2001
STATUS
approved
Number of solutions to +- 1 +- 2^2 +- 3^2 +- 4^2 +- ... +- n^2 = 0.
+10
18
0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 2, 10, 0, 0, 86, 114, 0, 0, 478, 860, 0, 0, 5808, 10838, 0, 0, 55626, 100426, 0, 0, 696164, 1298600, 0, 0, 7826992, 14574366, 0, 0, 100061106, 187392994, 0, 0, 1223587084, 2322159814, 0, 0, 16019866270, 30353305134, 0, 0
OFFSET
1,7
COMMENTS
Twice A083527.
Number of partitions of the half of the n-th-square-pyramidal number into parts that are distinct square numbers in the range 1 to n^2. Example: a(7)=2 since, squarePyramidal(7)=140 and 70=1+4+16+49=9+25+36. - Hieronymus Fischer, Oct 20 2010
Erdős & Surányi prove that this sequence is unbounded. More generally, there are infinitely many ways to write a given number k as such a sum. - Charles R Greathouse IV, Nov 05 2012
The expansion and integral representation formulas below are due to Andrica & Tomescu. The asymptotic formula is a conjecture; see Andrica & Ionascu. - Jonathan Sondow, Nov 11 2013
LINKS
Alois P. Heinz and Ray Chandler, Table of n, a(n) for n = 1..500 (first 240 terms from Alois P. Heinz)
D. Andrica and E. J. Ionascu, Variations on a result of Erdős and Surányi, INTEGERS 2013 slides.
Dorin Andrica and Ioan Tomescu, On an Integer Sequence Related to a Product of Trigonometric Functions, and Its Combinatorial Relevance, J. Integer Sequences, 5 (2002), Article 02.2.4.
P. Erdős and J. Surányi, Egy additív számelméleti probléma (in Hungarian; Russian and German summaries), Mat. Lapok 10 (1959), pp. 284-290.
FORMULA
Constant term in the expansion of (x + 1/x)(x^4 + 1/x^4)..(x^n^2 + 1/x^n^2).
a(n)=0 for any n == 1 or 2 (mod 4).
Integral representation: a(n)=((2^n)/pi)*int_0^pi prod_{k=1}^n cos(x*k^2) dx
Asymptotic formula: a(n) = (2^n)*sqrt(10/(pi*n^5))*(1+o(1)) as n-->infty; n == -1 or 0 (mod 4).
a(n) = 2 * A083527(n). - T. D. Noe, Mar 12 2009
min{n : a(n) > 0} = A231015(0) = 7. - Jonathan Sondow, Nov 06 2013
EXAMPLE
For n=8 the a(8)=2 solutions are: +1-4-9+16-25+36+49-64=0 and -1+4+9-16+25-36-49+64=0.
MAPLE
From Pietro Majer, Mar 15 2009: (Start)
N:=60: p:=1: a:=[]: for n from 1 to N do p:=expand(p*(x^(n^2)+x^(-n^2))):
a:=[op(a), coeff(p, x, 0)]: od:a; (End)
# second Maple program:
b:= proc(n, i) option remember; local m; m:= (1+(3+2*i)*i)*i/6;
`if`(n>m, 0, `if`(n=m, 1, b(abs(n-i^2), i-1) +b(n+i^2, i-1)))
end:
a:= n-> `if`(irem(n-1, 4)<2, 0, 2*b(n^2, n-1)):
seq(a(n), n=1..60); # Alois P. Heinz, Nov 05 2012
MATHEMATICA
b[n_, i_] := b[n, i] = With[{m = (1+(3+2*i)*i)*i/6}, If[n>m, 0, If[n == m, 1, b[ Abs[n-i^2], i-1] + b[n+i^2, i-1]]]]; a[n_] := If[Mod[n-1, 4]<2, 0, 2*b[n^2, n-1]]; Table[a[n], {n, 1, 60}] (* Jean-François Alcover, Mar 13 2015, after Alois P. Heinz *)
PROG
(PARI) a(n)=2*sum(i=0, 2^(n-1)-1, sum(j=1, n-1, (-1)^bittest(i, j-1)*j^2)==n^2) \\ Charles R Greathouse IV, Nov 05 2012
(Python)
from itertools import count, islice
from collections import Counter
def A158092_gen(): # generator of terms
ccount = Counter({0:1})
for i in count(1):
bcount = Counter()
for a in ccount:
bcount[a+(j:=i**2)] += ccount[a]
bcount[a-j] += ccount[a]
ccount = bcount
yield(ccount[0])
A158092_list = list(islice(A158092_gen(), 20)) # Chai Wah Wu, Jan 29 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Pietro Majer, Mar 12 2009
EXTENSIONS
a(51)-a(56) from R. H. Hardin, Mar 12 2009
Edited by N. J. A. Sloane, Sep 15 2009
STATUS
approved

Search completed in 0.031 seconds