%I #34 Mar 20 2021 16:03:35
%S 1,1,2,2,3,3,3,4,4,4,4,5,5,5,5,5,6,6,6,6,6,6,7,7,7,7,7,7,7,8,8,8,8,8,
%T 8,8,8,9,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,
%U 11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13
%N a(n) = (a^5)(n-1) + a(n-a(n-1)) = a(a(a(a(a(n-1))))) + a(n-a(n-1)), a(1) = a(2) = 1.
%C Multi-recursive sequence suggested by A004001: 5th level.
%C If A004001 is a level 2 recursion, A087817 is a level 3, and A087836 is a level 4, then this sequence is the 5th level. Other multi-recursives approximate this sequence for initial terms: A087845, A087847 Benoit Cloitre's sequence is: d = Table[Ceiling[n^.56], {n, 1, digits}].
%C Satisfies a(n) = A002024(n-1) up to n=2280, but is strictly larger thereafter. The graph shows an interesting "phase break" (author's terms in A087836) just after 2281. Are there other such "irregularities" to be expected (when a(n) attains 2281, or later)? - _M. F. Hasler_, Apr 20 2014
%H M. F. Hasler, <a href="/A107436/b107436.txt">Table of n, a(n) for n = 1..10000</a>
%e From n=2 to n=2280, a(n)=A002024(n-1); in particular, a(2280)=68 is preceded by 67 copies of 67. But a(2281) = a(a(a(a(a(2280))))) + a(2281-a(2280)) = a(a(a(a(68)))) + a(2281-68) = a(a(a(12))) + a(2213) = a(a(5)) + 67 =69. - _M. F. Hasler_, Apr 21 2014
%p a := proc(n) option remember; `if`(n<3,1,(a@@(5))(n-1)+a(n-a(n-1))) end; # _Peter Luschny_, Apr 23 2014
%t a[1] = a[2] = 1; a[n_Integer?Positive] := a[n] = Nest[a, n-1, 5] + a[n - a[n - 1]]; Table[a[n], {n, 1, 255}]
%o (PARI) a107436=[1,1]; A107436(n)={if(n>#a107436, a107436=concat(a107436,vector(n-#a107436)), a107436[n] && return(a107436[n])); t=A107436(n-1); a107436[n]=A107436(n-t)+A107436(A107436(A107436(A107436(t))))} \\ _M. F. Hasler_, Apr 21 2014
%Y Cf. A028310, A004001, A087817, A087836, A087845, A087847.
%K nonn
%O 1,3
%A _Roger L. Bagula_, May 26 2005