A206424 The number of 1's in row n of Pascal's Triangle (mod 3).
1, 2, 2, 2, 4, 4, 2, 4, 5, 2, 4, 4, 4, 8, 8, 4, 8, 10, 2, 4, 5, 4, 8, 10, 5, 10, 14, 2, 4, 4, 4, 8, 8, 4, 8, 10, 4, 8, 8, 8, 16, 16, 8, 16, 20, 4, 8, 10, 8, 16, 20, 10, 20, 28, 2, 4, 5, 4, 8, 10, 5, 10, 14, 4, 8, 10, 8, 16, 20, 10, 20, 28, 5, 10, 14, 10, 20, 28
Offset: 0
Examples
Rows 0-8 of Pascal's Triangle (mod 3) are: 1 So a(0) = 1 1 1 So a(1) = 2 1 2 1 So a(2) = 2 1 0 0 1 . 1 1 0 1 1 . 1 2 1 1 2 1 . 1 0 0 2 0 0 1 1 1 0 2 2 0 1 1 1 2 1 2 1 2 1 2 1
Links
- Reinhard Zumkeller (terms 0..1000) & Antti Karttunen, Table of n, a(n) for n = 0..19683
- R. Garfield and H. S. Wilf, The distribution of the binomial coefficients modulo p, J. Numb. Theory 41 (1) (1992) 1-5
- Marcus Jaiclin, et al. Pascal's Triangle, Mod 2,3,5
- D. L. Wells, Residue counts modulo three for the fibonacci triangle, Appl. Fib. Numbers, Proc. 6th Int Conf Fib. Numbers, Pullman, 1994 (1996) 521-536.
- Avery Wilson, Pascal's Triangle Modulo 3, Mathematics Spectrum, 47-2 - January 2015, pp. 72-75.
Programs
-
Haskell
a206424 = length . filter (== 1) . a083093_row -- Reinhard Zumkeller, Jul 11 2013
-
Mathematica
Table[Count[Mod[Binomial[n, Range[0, n]], 3], 1], {n, 0, 99}] (* Alonso del Arte, Feb 07 2012 *)
-
PARI
A206424(n) = sum(k=0,n,1==(binomial(n,k)%3)); \\ (naive way) Antti Karttunen, Jul 26 2017
-
Python
from sympy.ntheory import digits def A206424(n): s = digits(n,3)[1:] return (3**s.count(2)+1)<
>1 # Chai Wah Wu, Jul 24 2025 -
Scheme
(define (A206424 n) (* (+ (A000244 (A081603 n)) 1) (A000079 (- (A062756 n) 1)))) ;; (fast way) Antti Karttunen, Jul 27 2017
Formula
From Antti Karttunen, Jul 27 2017: (Start)
a(n) = (3^k + 1)*2^(y-1), where y = A062756(n) and k = A081603(n). [See e.g. Wells or Wilson references.]
(End)
From David A. Corneth and Antti Karttunen, Jul 27 2017: (Start)
Based on the first formula above, we have following identities:
a(3n) = a(n).
a(3n+1) = 2*a(n).
a(9n+4) = 4*a(n).
(End)
a(n) = (1/2)*Sum_{k = 0..n} mod(C(n,k) + C(n,k)^2, 3). - Peter Bala, Dec 17 2020
Comments