There are $100$ cards with numbers from $1$ to $100$ on the table.Andriy and Nick took the same number of cards in a way such that the following condition holds:if Andriy has a card with a number $n$ then Nick has a card with a number $2n+2$.What is the maximal number of cards that could be taken by the two guys?
1. **Identify the relationship between the cards:**
   If Andriy has a card with number \( n \), then Nick has a card with number \( 2n + 2 \). This relationship forms a sequence where each term is derived from the previous term using the formula \( a_{k+1} = 2a_k + 2 \).

2. **Form sequences (chains) based on the given relationship:**
   We start with the smallest number and generate sequences until the numbers exceed 100. For example:
   - Starting with 1: \( 1 \rightarrow 4 \rightarrow 10 \rightarrow 22 \rightarrow 46 \rightarrow 94 \)
   - Starting with 2: \( 2 \rightarrow 6 \rightarrow 14 \rightarrow 30 \rightarrow 62 \)
   - Starting with 3: \( 3 \rightarrow 8 \rightarrow 18 \rightarrow 38 \rightarrow 78 \)
   - Continue this process for all starting numbers up to 100.

3. **List the sequences:**
   - \( 1 \rightarrow 4 \rightarrow 10 \rightarrow 22 \rightarrow 46 \rightarrow 94 \)
   - \( 2 \rightarrow 6 \rightarrow 14 \rightarrow 30 \rightarrow 62 \)
   - \( 3 \rightarrow 8 \rightarrow 18 \rightarrow 38 \rightarrow 78 \)
   - \( 5 \rightarrow 12 \rightarrow 26 \rightarrow 54 \)
   - \( 7 \rightarrow 16 \rightarrow 34 \rightarrow 70 \)
   - \( 9 \rightarrow 20 \rightarrow 42 \rightarrow 86 \)
   - \( 11 \rightarrow 24 \rightarrow 50 \)
   - \( 13 \rightarrow 28 \rightarrow 58 \)
   - \( 15 \rightarrow 32 \rightarrow 66 \)
   - \( 17 \rightarrow 36 \rightarrow 74 \)
   - \( 19 \rightarrow 40 \rightarrow 82 \)
   - \( 21 \rightarrow 44 \rightarrow 90 \)
   - \( 23 \rightarrow 48 \rightarrow 98 \)
   - \( 25 \rightarrow 52 \)
   - \( 27 \rightarrow 56 \)
   - \( 29 \rightarrow 60 \)
   - \( 31 \rightarrow 64 \)
   - \( 33 \rightarrow 68 \)
   - \( 35 \rightarrow 72 \)
   - \( 37 \rightarrow 76 \)
   - \( 39 \rightarrow 80 \)
   - \( 41 \rightarrow 84 \)
   - \( 43 \rightarrow 88 \)
   - \( 45 \rightarrow 92 \)
   - \( 47 \rightarrow 96 \)
   - \( 49 \rightarrow 100 \)
   - \( 51 \)
   - \( 53 \)
   - \( 55 \)
   - \( 57 \)
   - \( 59 \)
   - \( 61 \)
   - \( 63 \)
   - \( 65 \)
   - \( 67 \)
   - \( 69 \)
   - \( 71 \)
   - \( 73 \)
   - \( 75 \)
   - \( 77 \)
   - \( 79 \)
   - \( 81 \)
   - \( 83 \)
   - \( 85 \)
   - \( 87 \)
   - \( 89 \)
   - \( 91 \)
   - \( 93 \)
   - \( 95 \)
   - \( 97 \)
   - \( 99 \)

4. **Count the total number of cards in the sequences:**
   - There are 25 sequences that end before reaching 100.
   - There are 25 sequences that end exactly at 100.
   - Each sequence can be paired with another sequence, so the total number of cards taken by both Andriy and Nick is \( 2 \times 25 = 50 \).

5. **Adjust for the maximum number of cards:**
   - Since each sequence can be paired, the maximum number of cards taken by both Andriy and Nick is 50.

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