p1. Determine the number of positive integers less than $2020$ that are written as sum of two powers of $3$.


p2. A student must choose three classes among the branches of Physics, Literature, and Mathematics, to build his $7$-day calendar. Each day he must choose only one of them. The only restriction is that on four consecutive days it must have all three branches. Determine the possible number of calendars that the student can make.


[url=https://artofproblemsolving.com/community/c4h2454972p20439395]p3.[/url] In a triangle $ABC$, the medians $AM$ and $BN$ are drawn, Draw through $N$ a parallel to $BC$ and through $C$ a parallel to $BN$. These two lines intersect at $P$ and let $D$ be the midpoint of $PN$. Show that $CD$ is parallel to $MN$.	


p4. A doctor prescribes his patient to take $48$ pills for $30$ days, at least one and no more than $6$ a day. Prove that no matter how the patient decides to take them, following the doctor's instructions, there are a number of consecutive days when taking exactly $11$ pills.
1. List all powers of \(3\) less than \(2020\). These are:
   \[
   3^0 = 1, \quad 3^1 = 3, \quad 3^2 = 9, \quad 3^3 = 27, \quad 3^4 = 81, \quad 3^5 = 243, \quad 3^6 = 729
   \]
   Thus, the set of powers of \(3\) less than \(2020\) is \(\{1, 3, 9, 27, 81, 243, 729\}\).

2. We need to determine the number of positive integers less than \(2020\) that can be written as the sum of two distinct powers of \(3\). We will consider all possible pairs of these powers.

3. The pairs of distinct powers of \(3\) are:
   \[
   (1, 3), (1, 9), (1, 27), (1, 81), (1, 243), (1, 729), (3, 9), (3, 27), (3, 81), (3, 243), (3, 729), (9, 27), (9, 81), (9, 243), (9, 729), (27, 81), (27, 243), (27, 729), (81, 243), (81, 729), (243, 729)
   \]

4. Calculate the sum for each pair:
   \[
   \begin{aligned}
   &1 + 3 = 4, \\
   &1 + 9 = 10, \\
   &1 + 27 = 28, \\
   &1 + 81 = 82, \\
   &1 + 243 = 244, \\
   &1 + 729 = 730, \\
   &3 + 9 = 12, \\
   &3 + 27 = 30, \\
   &3 + 81 = 84, \\
   &3 + 243 = 246, \\
   &3 + 729 = 732, \\
   &9 + 27 = 36, \\
   &9 + 81 = 90, \\
   &9 + 243 = 252, \\
   &9 + 729 = 738, \\
   &27 + 81 = 108, \\
   &27 + 243 = 270, \\
   &27 + 729 = 756, \\
   &81 + 243 = 324, \\
   &81 + 729 = 810, \\
   &243 + 729 = 972
   \end{aligned}
   \]

5. Verify that all these sums are less than \(2020\). Since all the sums are less than \(2020\), each pair contributes a unique positive integer less than \(2020\).

6. Count the number of pairs. There are \( \binom{7}{2} = 21 \) pairs of distinct powers of \(3\).

7. Additionally, each power of \(3\) itself is a positive integer less than \(2020\). There are \(7\) such powers.

8. Therefore, the total number of positive integers less than \(2020\) that can be written as the sum of two powers of \(3\) is:
   \[
   21 + 7 = 28
   \]

The final answer is \(\boxed{28}\)