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.

A095143 Triangle, read by rows, formed by reading Pascal's triangle (A007318) mod 9.

Original entry on oeis.org

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

Views

Author

Robert G. Wilson v, May 29 2004

Keywords

Examples

			Triangle begins:
              1;
            1,  1;
          1,  2,  1;
        1,  3,  3,  1;
      1,  4,  6,  4,  1;
    1,  5,  1,  1,  5,  1;
  1,  6,  6,  2,  6,  6,  1;
  ...
		

Crossrefs

Sequences based on the triangles formed by reading Pascal's triangle mod m: A047999 (m = 2), A083093 (m = 3), A034931 (m = 4), A095140 (m = 5), A095141 (m = 6), A095142 (m = 7), A034930 (m = 8), (this sequence) (m = 9), A008975 (m = 10), A095144 (m = 11), A095145 (m = 12), A275198 (m = 14), A034932 (m = 16).

Programs

  • Mathematica
    Mod[ Flatten[ Table[ Binomial[n, k], {n, 0, 13}, {k, 0, n}]], 9]
  • Python
    from math import isqrt, comb
    from gmpy2 import digits
    def A095143(n):
        g = (m:=isqrt(f:=n+1<<1))-(f<=m*(m+1))
        k = n-comb(g+1,2)
        if sum(int(d) for d in digits(k,3))+sum(int(d) for d in digits(g-k,3))-sum(int(d) for d in digits(g,3))>2: return 0
        s, c, d = digits(g,3), 1, 0
        w = (digits(k,3)).zfill(l:=len(s))
        if l == 1: return comb(g,k)%9
        for i in range(0,l-1):
            r, t = s[i:i+2], w[i:i+2]
            if (x:=int(r,3)) < (y:=int(t,3)):
                d += (t[0]>r[0])+(t[1]>r[1])
                if r[1]>=t[1]:
                    c = c*comb(int(r[1],3),int(t[1],3))%9
            else:
                c = c*comb(x,y)%9
        for i in range(1,l-1):
            if w[i]>s[i] or (z:=comb(int(s[i],3),int(w[i],3))) == 3:
                d -= 1
            else:
                c = c*pow(z,-1,9)%9
        return c*3**d%9 # Chai Wah Wu, Jul 19 2025

Formula

T(i, j) = binomial(i, j) mod 9.