OFFSET
1,2
COMMENTS
Index of first row of Pascal's triangle (A007318) containing n.
LINKS
Pontus von Brömssen, Table of n, a(n) for n = 1..10000 (terms 1..1000 from T. D. Noe, with 3 corrections).
FORMULA
EXAMPLE
a(28)=8 because 28 is first found in row 8 of Pascal's triangle (where the first row is counted as 0).
MAPLE
with(combinat): for n from 2 to 150 do flag := 0: for m from 1 to 150 do for k from 1 to m do if binomial(m, k) = n then printf(`%d, `, m); flag := 1; break fi: od: if flag=1 then break fi; od: od:
MATHEMATICA
nmax = 76; t = Table[Binomial[m, k], {m, 0, nmax}, {k, 0, m}]; a[n_] := Position[t, n, 2, 1][[1, 1]]-1; Table[a[n], {n, 1, nmax}] (* Jean-François Alcover, Nov 30 2011 *)
PROG
(Haskell)
import Data.List (findIndex); import Data.Maybe (fromJust)
a058084 n = fromJust $ findIndex (elem n) a007318_tabl
-- Reinhard Zumkeller, Nov 09 2011
(PARI) a(n) = my(k=0); while (!vecsearch(vector((k+2)\2, i, binomial(k, i-1)), n), k++); k; \\ Michel Marcus, Dec 07 2021
CROSSREFS
KEYWORD
nice,nonn,easy
AUTHOR
Fabian Rothelius, Nov 25 2000
EXTENSIONS
More terms from James A. Sellers, Nov 27 2000
STATUS
approved