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.

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

Original entry on oeis.org

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

Views

Author

Keywords

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), (this sequence) (m = 8), A095143 (m = 9), A008975 (m = 10), A095144 (m = 11), A095145 (m = 12), A275198 (m = 14), A034932 (m = 16).

Programs

  • Haskell
    a034930 n k = a034930_tabl !! n !! k
    a034930_row n = a034930_tabl !! n
    a034930_tabl = iterate
       (\ws -> zipWith (\u v -> mod (u + v) 8) ([0] ++ ws) (ws ++ [0])) [1]
    -- Reinhard Zumkeller, Jul 12 2013, Jun 21 2013
    
  • Mathematica
    Mod[ Flatten[ Table[ Binomial[n, k], {n, 0, 13}, {k, 0, n}]], 8] (* Robert G. Wilson v, May 26 2004 *)
  • Python
    from math import comb, isqrt
    def A034930(n):
        g = (m:=isqrt(f:=n+1<<1))-(f<=m*(m+1))
        k = n-comb(g+1,2)
        if k.bit_count()+(g-k).bit_count()-g.bit_count()>2: return 0
        def g1(s,w,e):
            c, d = 1, 0
            if len(s) == 0: return c, d
            a, b = int(s,2), int(w,2)
            if a>=b:
                k = comb(a,b)&7
                j = (~k & k-1).bit_length()
                d += j*e
                k >>= j
                c = c*pow(k,e,8)&7
            else:
                if int(s[0:1],2)Chai Wah Wu, Jul 20 2025

Formula

T(n+1,k) = (T(n,k) + T(n,k-1)) mod 8. - Reinhard Zumkeller, Jul 12 2013