OFFSET
0,2
COMMENTS
LINKS
A. Karttunen, Table of n, a(n) for n = 0..4095
MAPLE
A163894 := proc(n)
local i, a355, a, itr ;
if n = 0 then
return 0 ;
end if;
a := 0 ;
for i from 0 do
a355 := A163355(i) ;
for itr from 2 to n do
a355 := A163355(a355) ;
end do:
if a355 <> i then
return i ;
end if;
end do:
end proc:
seq(A163894(n), n=0..100) ; # R. J. Mathar, Nov 22 2023
PROG
(MIT Scheme:)
(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))))))
(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))))))
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Sep 19 2009
STATUS
approved