A054085 a(n) = order of n in the permutation A054084 of the natural numbers if this order exists; a(n) = -1 otherwise.
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, -1, -1, 16, 16, 16, 16, 16, -1, -1, 16, 16, -1, 16, -1, 16, -1, -1, 16, -1, -1, 16, -1, 16, -1, -1, -1, -1, -1, -1, -1, -1, -1, 16, -1, -1, -1, -1, -1, -1, -1
Offset: 1
Keywords
Examples
3 -> 5 -> 7 -> 10 -> 8 -> 6 -> 4 -> 3, so that 3 has order 7.
Programs
-
Mathematica
a054084[n_] := a054084[n] = If[EvenQ[n], Floor[n/2*GoldenRatio], Floor[(n + 1)/2*GoldenRatio^2]]; Array[a054084[#] &, 40] (* after Jean-François Alcover *) Table[Length[NestWhileList[a054084, a054084[n], # != n &, 1, 10000]] /. (10001 -> -1), {n, 1, 500}] (* Peter J. C. Moses, Jan 26 2022 *)
Extensions
Data truncated by Sean A. Irvine, Jan 23 2022
Edited by Clark Kimberling, Jan 26 2022