OFFSET
0,3
COMMENTS
Number of subsets of [n] in which exactly half of the elements are triangular numbers: a(6) = 20: {}, {1,2}, {1,4}, {1,5}, {2,3}, {2,6}, {3,4}, {3,5}, {4,6}, {5,6}, {1,2,3,4}, {1,2,3,5}, {1,2,4,6}, {1,2,5,6}, {1,3,4,5}, {1,4,5,6}, {2,3,4,6}, {2,3,5,6}, {3,4,5,6}, {1,2,3,4,5,6}. - Alois P. Heinz, Oct 11 2022
LINKS
Paul D. Hanna, Table of n, a(n) for n = 0..1000
EXAMPLE
G.f.: A(x) = 1 + x + 2*x^2 + 3*x^3 + 6*x^4 + 10*x^5 + 20*x^6 +...
Terms are shown below in parenthesis as they appear in Pascals triangle:
(1);
1,(1);
1,(2),1;
1,3,(3),1;
1,4,(6),4,1;
1,5,(10),5,1;
1,6,15,(20),15,6,1;
1,7,21,(35),35,21,7,1;
1,8,28,(56),70,56,28,8,1;
1,9,36,(84),126,126,84,36,9,1;
1,10,45,120,(210),252,210,120,45,10,1; ...
PROG
(PARI) {a(n)=binomial(n, (sqrtint(8*n+1)-1)\2)}
(Python)
from math import comb, isqrt
def A180272(n): return comb(n, (isqrt(n+1<<3)+1>>1)-1) # Chai Wah Wu, Oct 17 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Paul D. Hanna, Jan 17 2011
STATUS
approved