login
Cycle length of n under bijection A264965 / A264966.
4

%I #7 Dec 06 2015 21:07:25

%S 1,1,1,1,1,2,1,2,1,1,1,5,1,5,3,2,1,5,1,5,1,2,3,5,1,5,3,1,1,5,1,22,2,3,

%T 9,7,1,22,9,3,1,22,2,7,4,2,9,1,1,7,9,4,4,7,1,5,1,3,9,5,1,1,3,2,2,5,2,

%U 22,1,2,9,18,1,7,3,4,4,18,4,7,1,2,3,18,1,3,10,3,10,18,1,3,8,6,3,22,2,22,9,4,4,18,3,17,10,4,10,6,1,3,3,6,1,18,4,17,8,3,3,10,1,7

%N Cycle length of n under bijection A264965 / A264966.

%C By convention: a(n) = 0 if the cycle where n resides can be proven to be infinite. a(n) = -1 is the placeholder value if the cycle where n resides is only suspected to be infinite.

%C Is n=262 the first representative of runaway cycle? See A264972 and A264973.

%H Antti Karttunen, <a href="/A264969/b264969.txt">Table of n, a(n) for n = 0..261</a>

%e A264965(5) = 7 and A264965(7) = 5, thus a(5) = a(7) = 2.

%o (Scheme)

%o ;; Very naive program which succumbs to the first infinite cycle:

%o (define (A264969 n) (let loop ((s 1) (next (A264965 n))) (if (equal? next n) s (loop (+ 1 s) (A264965 next)))))

%Y Cf. A264965, A264966, A264972, A264973.

%K nonn

%O 0,6

%A _Antti Karttunen_, Dec 06 2015