login
a(n) = order of in the permutation A054084 of the natural numbers if this order exists; a(n) = -1 otherwise.
2

%I #10 Jan 26 2022 11:09:35

%S 2,2,7,7,7,7,7,7,9,7,9,9,9,9,9,9,-1,9,-1,9,-1,-1,-1,-1,16,-1,16,-1,16,

%T -1,-1,16,16,16,16,16,-1,-1,16,16,-1,16,-1,16,-1,-1,16,-1,-1,16,-1,16,

%U -1,-1,-1,-1,-1,-1,-1,-1,-1,16,-1,-1,-1,-1,-1,-1,-1

%N a(n) = order of in the permutation A054084 of the natural numbers if this order exists; a(n) = -1 otherwise.

%e 3 -> 5 -> 7 -> 10 -> 8 -> 6 -> 4 -> 3, so that 3 has order 7.

%t a054084[n_] := a054084[n] = If[EvenQ[n], Floor[n/2*GoldenRatio],

%t Floor[(n + 1)/2*GoldenRatio^2]];

%t Array[a054084[#] &, 40] (* after Jean-François Alcover *)

%t Table[Length[NestWhileList[a054084, a054084[n], # != n &, 1,

%t 10000]] /. (10001 -> -1), {n, 1, 500}]

%t (* _Peter J. C. Moses_, Jan 26 2022 *)

%Y Cf. A054083, A054084.

%K sign

%O 1,1

%A _Clark Kimberling_

%E Data truncated by _Sean A. Irvine_, Jan 23 2022

%E Edited by _Clark Kimberling_, Jan 26 2022