0
$\begingroup$

I was looking at the pattern of odd entries in Pascal’s triangle and noticed that every row contains an even count of odd numbers. This is easy to justify, but it led me to wonder how the exact count of odd entries behaves from row to row, and whether any closed formulas or structural results are known.

Let $$ a_n=\sum_{k=0}^n f\!\left(\binom{n}{k}\right),\qquad f(m)= \begin{cases} 0 & \text{if } m \text{ is even},\\ 1 & \text{if } m \text{ is odd}. \end{cases} $$ Thus $a_n$ counts the odd entries in row $n$ of Pascal’s triangle.

Notes on the sequence $a_n$:

  1. for $n>0$ $a_{2^n}=2$
  2. $a_{n}>2$ for $n$ which isn't a power of $2$

Both of these follows from this post.

I am interested in the following questions:

  1. Is there a closed form for $a_n$?
    I suspect that no simple exact formula exists.

  2. Is it true that $a_n$ is always a power of $2$?
    Empirically this appears to hold for all $n\le 1000$ (checked by computer), but I have not been able to prove it.

  3. Does the sequence $(a_n)$ contain a divergent subsequence?

Here is a simple but not so effecient python code to find $a_n$

import math
a=[1,2]
def f(n):
    if n%2==0:
        return 0
    else:
        return 1

for i in range (2,5000+1):
    s=0
    for j in range (0,i+1):
        s=s+f(math.comb(i,j))
    a.append(s)        

print(a)    
$\endgroup$
1

1 Answer 1

4
$\begingroup$

By Lucas' theorem, $\binom{n}{k}$ is odd iff the set of indices at which a 1 appears in the binary expansion of $k$ is a subset of the set of 1-indices of the binary expansion of $n$.

So you don't really get a closed formula in terms of $n$ for question 1, but $a_n = 2^k$ where $k$ is the number of 1s in the binary expansion of $n$. Thus the answer to question 2 is positive, and for question 3 you can e.g. note that $a_{2^n - 1} = 2^n$.

$\endgroup$

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.