A340615 a(n) = k/2 if k is even, otherwise (3k+1)/2, where k = n + floor((n+1)/5).
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, 47, 16, 50, 53, 18, 56, 19, 59, 62, 21, 65, 22, 68, 71, 24, 74, 25, 77, 80, 27, 83, 28, 86, 89, 30, 92, 31, 95, 98, 33, 101, 34, 104, 107, 36, 110, 37, 113, 116, 39, 119, 40, 122
Offset: 0
Links
- Thomas Scheuerle, Finite cycle starting 24,44,... plotted log2 (vertical: 24,44,... horizontal: 1,2,...), black lines drawn into the graph show that cycles have an internal structure.
- Index entries for sequences that are permutations of the nonnegative integers
- Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,2,0,0,0,0,-1).
- Index entries for sequences related to 3x+1 (or Collatz) problem
Programs
-
MATLAB
function a = A340615(max_n) for n = 1:max_n k = (n-1)+floor(((n-1)+1)/5); if floor(k/2) == k/2 a(n) = k/2; else a(n) = (k*3+1)/2; end end end
-
Mathematica
Array[If[EvenQ@ #, #/2, (3 # + 1)/2] &[# + Floor[(# + 1)/5]] &, 69, 0] (* Michael De Vlieger, Jan 13 2021 *)
Formula
a(n) = 2*a(n-5) - a(n-10).
Comments