%I #74 Oct 31 2022 05:55:01
%S 0,2,1,5,8,3,11,4,14,17,6,20,7,23,26,9,29,10,32,35,12,38,13,41,44,15,
%T 47,16,50,53,18,56,19,59,62,21,65,22,68,71,24,74,25,77,80,27,83,28,86,
%U 89,30,92,31,95,98,33,101,34,104,107,36,110,37,113,116,39,119,40,122
%N a(n) = k/2 if k is even, otherwise (3k+1)/2, where k = n + floor((n+1)/5).
%C A permutation of the nonnegative integers related to the Collatz function (A014682).
%C As this sequence is a permutation, it can be decomposed into cycles.
%C Known finite cycles so far: (0), (1 2), (3 5), (24 44 80 48 86 155 93 167 100 60 36 65 39 71 128 230 138 248 446 803 1445 867 520 312 187 112 67 40).
%C Except for the 0-cycle, it is a necessary (but not sufficient) condition for the smallest number in a cycle that it is in the intersection of A032766 and A047206 (as suggested by _Sebastian Karlsson_, Jan 15 2021).
%C If we generate new sequences by including a variable m into the definition of the original sequence, k = n+floor((n+1)/m*5), a(n) = k/2 if k is even, otherwise (3k+1)/2, then the sequences with m > 1 are not permutations and are in some sense intermediates between A014682 and the original sequence. This may aid in research related to Collatz conjecture as it may help to understand how cycles are modified or disappearing by increasing values of m.
%C Like any permutation this sequence can be written as a product of two involutions. Example:
%C a(n) = p(q(n)) with p = (0)(3 1)(5 2)(6 4)(11 7)(10 8)(26 9)(20 12)... and q = (0)(5 1)(3 2)(11 4)(8 6)(20 7)(47 9)(14 10)... does there exist a nice example with known sequences?
%C The difference between "Collatz function" A014682 and this sequence is that A014682 contains all numbers of the type 3*m + 2 twice (A016789). The modification "+floor((n+1)/5)" removes these duplicates from the sequence. The distances between the removed numbers and the predecessors that stay inside the sequence are of the form 4*m + 3 and found in A004767. Example: A014682(3) = 5 and A014682(10) = 5. 5 = A016789(1) and 10-3 = 7 = A004767(1).
%C A093545 is the inverse permutation: n = A093545(a(n)).
%H Thomas Scheuerle, <a href="/A340615/a340615.svg">Finite cycle starting 24,44,... plotted log2 (vertical: 24,44,... horizontal: 1,2,...)</a>, black lines drawn into the graph show that cycles have an internal structure.
%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the nonnegative integers</a>
%H <a href="/index/Rec#order_10">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,0,2,0,0,0,0,-1).
%H <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a>
%F a(n) = 2*a(n-5) - a(n-10).
%t Array[If[EvenQ@ #, #/2, (3 # + 1)/2] &[# + Floor[(# + 1)/5]] &, 69, 0] (* _Michael De Vlieger_, Jan 13 2021 *)
%o (MATLAB)
%o function a = A340615(max_n)
%o for n = 1:max_n
%o k = (n-1)+floor(((n-1)+1)/5);
%o if floor(k/2) == k/2
%o a(n) = k/2;
%o else
%o a(n) = (k*3+1)/2;
%o end
%o end
%o end
%Y Cf. A014682, A093545 (inverse).
%K nonn,easy
%O 0,2
%A _Thomas Scheuerle_, Jan 13 2021