cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-3 of 3 results.

A058084 Smallest m such that binomial(m,k) = n for some k.

Original entry on oeis.org

0, 2, 3, 4, 5, 4, 7, 8, 9, 5, 11, 12, 13, 14, 6, 16, 17, 18, 19, 6, 7, 22, 23, 24, 25, 26, 27, 8, 29, 30, 31, 32, 33, 34, 7, 9, 37, 38, 39, 40, 41, 42, 43, 44, 10, 46, 47, 48, 49, 50, 51, 52, 53, 54, 11, 8, 57, 58, 59, 60, 61, 62, 63, 64, 65, 12, 67, 68, 69, 8, 71, 72, 73, 74, 75, 76
Offset: 1

Views

Author

Fabian Rothelius, Nov 25 2000

Keywords

Comments

Index of first row of Pascal's triangle (A007318) containing n.

Examples

			a(28)=8 because 28 is first found in row 8 of Pascal's triangle (where the first row is counted as 0).
		

Crossrefs

Programs

  • Haskell
    import Data.List (findIndex); import Data.Maybe (fromJust)
    a058084 n = fromJust $ findIndex (elem n) a007318_tabl
    -- Reinhard Zumkeller, Nov 09 2011
    
  • 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 *)
  • 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
    
  • Python
    def A058084(n):
        if n == 1: return 0
        c = [1]
        for m in range(n):
            d = [1]
            for i in range(m):
                a = c[i]+c[i+1]
                if a == n:
                    return m+1
                d.append(a)
            c = d+[1] # Chai Wah Wu, Aug 23 2025

Formula

a(A006987(n)) < A006987(n); a(A137905(n)) = A137905(n). - Reinhard Zumkeller, Mar 20 2009
A007318(a(n), A357327(n)) = n. - Pontus von Brömssen, Sep 24 2022

Extensions

More terms from James Sellers, Nov 27 2000

A374959 a(n) is the least k such that binomial(A349958(n), k) is a multiple of n.

Original entry on oeis.org

0, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 2, 1, 1, 2, 1, 3, 2, 4, 1, 3, 1, 2, 1, 2, 1, 3, 1, 1, 3, 2, 3, 2, 1, 4, 2, 3, 1, 3, 1, 3, 2, 8, 1, 5, 1, 2, 2, 6, 1, 4, 2, 3, 2, 2, 1, 3, 1, 2, 4, 1, 4, 4, 1, 2, 6, 4, 1, 5, 1, 2, 2, 4, 5, 2, 1, 3, 1, 2, 1, 3, 3, 4, 3
Offset: 1

Views

Author

Rémy Sigrist, Jul 25 2024

Keywords

Examples

			For n = 12: the first multiple of 12 in Pascal's triangle appears in row 9; this row contains: 1, 9, 36, 84, 126, 126, 84, 36, 9, 1; the first multiple of 12 (36), appears at (0-based) index 2; so a(12) = 2.
		

Crossrefs

Programs

  • PARI
    a(n) = { my (r = [1 % n], j); for (i = 0, oo, if (vecmin(r, &j)==0, return (j-1), r = (concat(0, r) + concat(r, 0)) % n;);); }
    
  • Python
    from math import comb
    def A374959(n): return next(k for j in range(n+1) for k in range(j+1) if not (comb(j,k) % n)) # Chai Wah Wu, Jul 30 2024

A375571 a(n) is the unique integer k such that A008949(A375570(n),k) = n.

Original entry on oeis.org

0, 1, 1, 2, 1, 1, 2, 3, 1, 1, 2, 1, 1, 1, 3, 4, 1, 1, 1, 1, 1, 2, 1, 1, 1, 3, 1, 1, 2, 1, 4, 5, 1, 1, 1, 1, 2, 1, 1, 1, 1, 3, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 1, 1, 1, 1, 1, 5, 6, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 1

Views

Author

Pontus von Brömssen, Aug 19 2024

Keywords

Crossrefs

Formula

A008949(A375570(n),a(n)) = n.
a(2^n) = n.
a(2^n-1) = n-1.
Showing 1-3 of 3 results.