|
|
A227428
|
|
Number of twos in row n of triangle A083093.
|
|
9
|
|
|
0, 0, 1, 0, 0, 2, 1, 2, 4, 0, 0, 2, 0, 0, 4, 2, 4, 8, 1, 2, 4, 2, 4, 8, 4, 8, 13, 0, 0, 2, 0, 0, 4, 2, 4, 8, 0, 0, 4, 0, 0, 8, 4, 8, 16, 2, 4, 8, 4, 8, 16, 8, 16, 26, 1, 2, 4, 2, 4, 8, 4, 8, 13, 2, 4, 8, 4, 8, 16, 8, 16, 26, 4, 8, 13, 8, 16, 26, 13, 26, 40
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,6
|
|
COMMENTS
|
"The number of entries with value r in the n-th row of Pascal's triangle modulo k is found to be 2^{#_r^k (n)}, where now #_r^k (n) gives the number of occurrences of the digit r in the base-k representation of the integer n." [Wolfram] - R. J. Mathar, Jul 26 2017 [This is not correct: there are entries in the sequence that are not powers of 2. - Antti Karttunen, Jul 26 2017]
|
|
LINKS
|
|
|
FORMULA
|
a(n) = (1/2)*Sum_{k = 0..n} mod(C(n,k)^2 - C(n,k), 3). - Peter Bala, Dec 17 2020
|
|
EXAMPLE
|
Example of Wilson's formula: a(26) = 13 = 2^(0-1)*(3^3-1) = 26/2, where A062756(26)=0, A081603(26)=3, 26=(222)_3. - R. J. Mathar, Jul 26 2017
|
|
MAPLE
|
local a;
a := 0 ;
for k from 0 to n do
a := a+1 ;
end if;
end do:
a ;
end proc:
|
|
MATHEMATICA
|
Table[Count[Mod[Binomial[n, Range[0, n]], 3], 2], {n, 0, 99}] (* Alonso del Arte, Feb 07 2012 *)
|
|
PROG
|
(Haskell)
a227428 = sum . map (flip div 2) . a083093_row
(PARI) A227428(n) = sum(k=0, n, 2==(binomial(n, k)%3)); \\ (Naive implementation, from the description) Antti Karttunen, Jul 26 2017
(Python)
from sympy import binomial
def a(n):
return sum(1 for k in range(n + 1) if binomial(n, k) % 3 == 2)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|