OFFSET
0,2
COMMENTS
Or, number of occurrences of n as a binomial coefficient. [Except for 1 which occurs infinitely many times. This is the only reason for the restriction "row <= n" in the definition. Any other number can only appear in rows <= n. - M. F. Hasler, Feb 16 2023]
Sequence A138496 gives record values and where they occur. - Reinhard Zumkeller, Mar 20 2008
REFERENCES
L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 93, #47.
C. S. Ogilvy, Tomorrow's Math. 2nd ed., Oxford Univ. Press, 1972, p. 96.
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 0..10000
H. L. Abbott, P. Erdős and D. Hanson, On the numbers of times an integer occurs as a binomial coefficient, Amer. Math. Monthly, (1974), 256-261.
Daniel Kane, New Bounds on the Number of Representations of t as a Binomial Coefficient, INTEGERS, Electronic J. of Combinatorial Number Theory, Vol. 4, Paper A7, 2004.
Kaisa Matomäki, Maksym Radziwill, Xuancheng Shao, Terence Tao, and Joni Teräväinen, Singmaster's conjecture in the interior of Pascal's triangle, arXiv:2106.03335 [math.NT], 2021.
D. Singmaster, How often does an integer occur as a binomial coefficient?, Amer. Math. Monthly, 78 (1971), 385-386.
Eric Weisstein's World of Mathematics, Pascal's Triangle
MATHEMATICA
a[0] = 0; t = {{1}}; a[n_] := Count[ AppendTo[t, Table[ Binomial[n, k], {k, 0, n}]], n, {2}]; Table[a[n], {n, 0, 101}] (* Jean-François Alcover, Feb 20 2012 *)
PROG
(Haskell)
a003016 n = sum $ map (fromEnum . (== n)) $
concat $ take (fromInteger n + 1) a007318_tabl
-- Reinhard Zumkeller, Apr 12 2012
(PARI) {A003016(n)=if(n<4, [0, 3, 1, 2][n+1], my(c=2, k=2, r=sqrtint(2*n)+1, C=r*(r-1)/2); until(, while(C<n && k<r\2, C *= r-k; k += 1; C \= k); C == n && c += 2-(r == 2*k); k >= r\2 && break; C *= r-k; C \= r; r -= 1); c)} \\ M. F. Hasler, Feb 16 2023
(Python)
from math import isqrt # requires python3.8 or higher
def A003016(n):
if n < 4: return[0, 3, 1, 2][n]
cnt = k = 2; r = isqrt(2*n)+1; C = r*(r-1)//2
while True:
while C < n and k < r//2:
C *= r-k; k += 1; C //= k
if C == n: cnt += 2 - (r == 2*k)
if k >= r//2: return cnt
C *= r-k; C //= r; r -= 1 # M. F. Hasler, Feb 16 2023
CROSSREFS
KEYWORD
nonn,nice,easy
AUTHOR
EXTENSIONS
More terms from Erich Friedman
Edited by N. J. A. Sloane, Nov 18 2007, at the suggestion of Max Alekseyev
STATUS
approved