login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A003016
Number of occurrences of n as an entry in rows <= n of Pascal's triangle (A007318).
(Formerly M0227)
17
0, 3, 1, 2, 2, 2, 3, 2, 2, 2, 4, 2, 2, 2, 2, 4, 2, 2, 2, 2, 3, 4, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
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
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
EXTENSIONS
More terms from Erich Friedman
Edited by N. J. A. Sloane, Nov 18 2007, at the suggestion of Max Alekseyev
STATUS
approved