%I #24 Sep 28 2024 12:35:59
%S 1,4,7,4,4,7,10,4,4,10,13,7,4,13,16,10,4,7,19,7,7,19,13,7,10,22,7,10,
%T 22,10,7,22,25,10,13,25,10,7,25,28,13,16,13,13,25,28,22,10,10,31,16,
%U 10,13,16,19,31,10,10,13,34,13,13,34,19,10,25,13,16,34,19
%N The nested recursive P312 function, a(n) = 3 + a(n-a(n-2))) for n>=1, a(n) = 1 for n<1.
%H Alois P. Heinz, <a href="/A376549/b376549.txt">Table of n, a(n) for n = 0..20000</a>
%H S. Wolfram, <a href="https://writings.stephenwolfram.com/2024/09/nestedly-recursive-functions/">Nestedly Recursive Functions</a>, 2024.
%F a(n) mod 3 = 1.
%p a:= proc(n) option remember; `if`(n<1, 1, 3 + a(n-a(n-2))) end:
%p seq(a(n), n=0..75); # _Alois P. Heinz_, Sep 28 2024
%t ResourceFunction["RecursiveFunction"][f[n]->3+f[n-f[n-2]], {n <= 0 -> 1}][Range[50]]
%Y Cf. A002024, A016777.
%K nonn
%O 0,2
%A _Ed Pegg Jr_, Sep 27 2024