%I #4 Apr 09 2014 10:16:34
%S 1,1,2,1,3,1,3,3,2,1,2,3,5,1,1,2,2,2,3,2,3,3,3,3,4,1,1,2,2,2,3,2,3,3,
%T 3,3,4,1,1,2,2,2,3,2,3,3,3,3,4,1,1,2,2,2,3,2,3,3,3,3,4,1,1,2,2,2,3,2,
%U 3,3,3,3,4,1,1,2,2,2,3,2,3,3,3,3,4,1,1,2,2,2,3,2,3,3,3,3,4,1,1,2,2,2,3,2,3
%N a(1)=1. a(n) = the largest integer such that the finite sequence (a(n-1),a(n-2),...a(n-a(n))) occurs somewhere as a subsequence in the finite sequence (a(1),a(2),...,a(n-1)).
%C a(n+12) = a(n) for all n >= 14.
%H "Hagman", <a href="http://groups.google.com.sg/group/sci.math/browse_thread/thread/68765197f2771468">Sci Math Thread</a>
%e The subsequence of terms a(27) through a(29) in reversed order is (a(29),a(28),a(27)) = (3,3,2). This occurs in the first 29 terms of sequence A145652 like so: 1,1,2,1,3,1,(3,3,2),1,2,3,5,1,1,2,2,2,3,2,2,5,1,1,2,2,2,3,3. On the other hand, the subsequence of terms a(26) to a(29) in reversed order, (3,3,2,2) does not occur anywhere among the first 29 terms of sequence A145652. Since there are three terms in (3,3,2), then a(30) = 3.
%K nonn
%O 1,3
%A _Leroy Quet_, Oct 15 2008, corrected Oct 20 2008