%I #11 Nov 22 2023 05:04:18
%S 0,2,4,2,4,2,24,2,4,2,4,2,33,2,4,2,4,2,24,2,4,2,4,2,76,2,4,2,4,2,24,2,
%T 4,2,4,2,33,2,4,2,4,2,24,2,4,2,4,2,76,2,4,2,4,2,24,2,4,2,4,2,33,2,4,2,
%U 4,2,24,2,4,2,4,2,390,2,4,2,4,2,24,2,4,2,4,2,33,2,4,2,4,2,24,2,4,2,4
%N The least i for which A163355^n(i) is not equal to i, 0 if no such i exists, i.e., when A163355^n = A001477.
%C A163355^n means n-fold application of A163355, i.e., A163355^2 = A163905, A163355^3 = A163915. By convention A163355^0 = A001477.
%H A. Karttunen, <a href="/A163894/b163894.txt">Table of n, a(n) for n = 0..4095</a>
%p A163894 := proc(n)
%p local i,a355,a,itr ;
%p if n = 0 then
%p return 0 ;
%p end if;
%p a := 0 ;
%p for i from 0 do
%p a355 := A163355(i) ;
%p for itr from 2 to n do
%p a355 := A163355(a355) ;
%p end do:
%p if a355 <> i then
%p return i ;
%p end if;
%p end do:
%p end proc:
%p seq(A163894(n),n=0..100) ; # _R. J. Mathar_, Nov 22 2023
%o (MIT Scheme:)
%o (define (A163894 n) (if (zero? n) 0 (let loop ((i 1) (n-th_power (compose-fun-to-n-th-power a163355 n))) (cond ((not (= i (n-th_power i))) i) (else (loop (1+ i) n-th_power))))))
%o (define (compose-fun-to-n-th-power fun n) (cond ((zero? n) (lambda (x) x)) (else (lambda (x) (fun ((compose-fun-to-n-th-power fun (- n 1)) x))))))
%Y See A163890, A163895, A163896.
%K nonn
%O 0,2
%A _Antti Karttunen_, Sep 19 2009