A349954 a(n) is the number of extrema that result from iterating the reduced Collatz function R(k) = A139391(k) on 2n-1 to yield 1.
0, 2, 1, 2, 3, 2, 1, 2, 1, 4, 1, 2, 5, 20, 3, 18, 5, 2, 3, 8, 19, 4, 1, 18, 3, 4, 1, 20, 5, 8, 3, 18, 3, 6, 1, 18, 21, 2, 3, 6, 3, 20, 1, 4, 7, 16, 3, 18, 21, 4, 5, 14, 7, 18, 19, 10, 1, 4, 3, 6, 17, 12, 19, 4, 21, 4, 5, 6, 15, 10, 1, 18, 19, 22, 3, 2, 5, 14
Offset: 1
Keywords
Examples
a(10) = 4 because 2n+1 = 19 and iterating R on 19 gives 4 extrema: 19 -> 29 -> 11 -> 17 -> 1 max min max min. The corresponding path of n, 10 -> 15 -> 6 -> 9 -> 1, is shown in the tree below, where the paths for n up to 100 are given and a(n) is the depth from n to 1. n a(n) ----------------------------------------------------------------------------- ---- 98 74 22 37 49 147 65 111 21 14 86 \__\__28_/ 42 100 20 95 21 55 73 83 97 129 63_____/ 225 19 54 36 \___\__\__\___\__16 24 48 32 72 18 \__\____________________\________81 61 243__/__/ 17 \______\___46 92 16 69 207 15 52 78 14 117__/ 13 62 88 12 93 297 11 70 94 84 56 10 105 79 141 189__/ 9 20 30__/ 106 142 8 \__45 159 53 213 7 68 34 60 40 90 160 80 6 29 153 77 85 13 51 17 67 89 135_/___/ 1215 405 5 \__22 50 58 44 66 26 64 96 \__10__/__/__/__/ 82 456 304 4 5 19 25 33 75 87 99_/ 39 729_/ 59 15 47 123 1539__/ 31 41 3 \__\__\___\__\__\__4 \___6____/___/ 76 38 2 8 18 \___12_____/__/ 2 \_________9 11 43 71 171 57 3 \__\_______27 91 35 23 7 1 \__\__\___\___\__\__\_______________1__/__/__/__/ 0
Programs
-
Python
def R(k): c = 3*k+1; return c//(c&-c) def A349954(n): if n == 1: return 0 ct = 1; m = R(2*n-1); d = m - 2*n + 1 while m > 1: if (R(m) - m)*d < 0: ct += 1; d = -d m = R(m) return ct
Comments