There are several different solutions:
Solution 1: The function f:{1,…,2008}→{1,…,2008} given by f(i)=ai is a bijection. Let us consider its inverse f−1:{1,…,2008}→{1,…,2008}. The condition that i∈{a1,…,ai} for i≥2 is equivalent to f−1(i)∈{1,…,i} for all i≥2. Therefore, there are two choices for f−1(2), two choices for f−1(3) (since one of {1,2,3} has been 'used already' for f−1(2)), two choices for f−1(4), ..., two choices for f−1(2008). Thus there are 22007 possibilities for the function f−1. Therefore there are 22007 such sequences.
Solution 2: We will say that a 2008-tuple is good if it has the required properties. Let A=(a1,...,a2008) be a good 2008-tuple. Let SA={i:2≤i≤2008 and ai=i}. We will show that A↦SA is a bijection between the set of good 2008-tuples and the set of subsets of {2,...,2008}.
First we observe that the function i↦ai is a bijection from {1,...,2008} to itself.
Lemma: If A is good then for each i=1,...,2008, either ai=1 or ai≥i.
Proof: This is obvious for i=1 and i=2. Suppose that i≥3 and ai∈{2,...,i−1}. Property (a) implies in particular that ai=aj for j=1,2,...,ai−1. That is,
ai∈/{a1,a2,...,aai−1}.
Therefore we must have aai=ai. Therefore i=ai (bijectivity again) which contradicts our assumption that ai<i. □
Now suppose that A is a good 2008-tuple and that SA={n1,n2,...,nk} where n1<n2<⋯<nk. Clearly ai=i for all i∈/SA∪{1}. So for i∈S∪{1} we must have ai∈S∪{1} also. That is to say, i↦ai is a bijection SA∪{1}→SA∪{1}. Now the lemma above clearly implies that a1=an1,anj=nj+1 for j=1,...,k−1 and ank=1. In other words A is determined by the set SA. So A↦SA is an injection.
Now suppose that S={n1,...,nk}⊂{2,...,2008}. Let ai=i for all i∈/S. Define a1=n1,anj=nj+1 for j=1,...,k−1 and let ank=1. Then is easily seen that A=(a1,...,a2008) is good and clearly SA=S. Therefore A↦SA is a surjection. □
Solution 3: (By induction.) We claim that, for integers n≥2,
the number of bijections f:{1,…,n}→{1,…,n} such that i∈{1,…,f(i)} for all i≥2, is 2n−1. Let us call such functions good. This easily checked for n=2. Suppose that the statement is true for some n=2,…,k where k≥2. Now consider a good function f:{1,…,k+1}→{1,…,k+1}. There are 2008 possible choices for f(1). If f(1)=1 then we must have f(i)=i for all i, so there is one such function. If f(1)>1, then f(i)=i for i=2,…,f(1)−1. Now it is easy to see that the number of possible such functions f is the same as the number of good functions from {1,…,k−f(1)} to itself. The induction hypothesis implies that there are 2k−f(1)−1 of these. Therefore, the number of good functions on {1,…,k+1} is
1+2k−1+2k−2+⋯+2+1=2k.
This completes the induction step.