1. ## Weird Sequence

Let $a_1=1$. For all $n>1$, define

$a_n=\sum_{\substack{i

So $a_2=a_1$ and $a_4=a_1+a_3$.
Find $a_{24}$

2. Hello,

Let n be 24

You're looking for $a_{24} = \sum_{\substack{i<24 \\ \gcd(i,24)=1}} a_i$

All i<24 with gcd(i,24)=1 are :
1,2,5,7,11,13,17,19,23

Hence $a_{24} = a_1+a_2+a_5+a_7+a_{11}+a_{13}+a_{17}+a_{19}+a_{23}$

We already know $a_1$ and $a_2$

- let's calculate $a_5$
$a_5 = \sum_{\substack{i<5 \\ \gcd(i,5)=1}}$
All i<5 with gcd(i,5)=1 are : 1,2,3,4

----> $a_5 = a_1+a_2+a_3+a_4$

-------> $a_{24} = a_1+a_2+a_1+a_2+a_3+a_4+a_7+a_{11}+a_{13}+a_{17}+a _{19}+a_{23}$

$a_4=a_1+a_3$

$a_{24} = 2 a_1+2a_2 + a_3+a_4+a_7+a_{11}+a_{13}+a_{17}+a_{19}+a_{23}$ $= 3 a_1+2a_2 + 2a_3+a_7+a_{11}+a_{13}+a_{17}+a_{19}+a_{23}$

- let's calculate $a_3$
All i<3 with gcd(i,3)=1 are : 1,2
$a_3 = a_1+a_2$

-------> $a_{24} = \dots$

And so on... It's always the same thing : when there is an $a_i$ you don't know the value, get the definition, find all the numbers < i and relatively prime with i and continue...

It's kinda hard to type it on a computer... If you really need all the details, i can help you for some following values

1 1
2 1
3 2
4 3
5 7
6 8
7 22
8 32
9 66
10 91
11 233
12 263
13 729
14 1038
15 2059
16 3119
17 7674
18 8666
19 24014
20 32741

I can't promise this is correct; one small mistake would snowball into larger mistakes later.