A225089
a(n) = floor(2^A006666(m)/3^A006667(m)) - m, where m = 2n + 1.
Original entry on oeis.org
0, 0, 0, 0, 0, 1, 1, 0, 2, 0, 1, 2, 1, 2, 1, 0, 1, 4, 3, 1, 0, 3, 2, 4, 4, 2, 5, 5, 4, 3, 5, 0, 6, 3, 2, 8, 7, 6, 8, 2, 7, 0, 10, 6, 5, 4, 7, 8, 10, 9, 8, 4, 3, 10, 9, 11, 14, 9, 12, 7, 6, 10, 9, 0, 14, 13, 12, 7, 6, 5, 10, 17, 13, 15, 0, 13, 12, 16, 15, 5, 8
Offset: 1
a(9) = 3 because floor(2^A006666(19)/3^A006667(19)) - 19 = floor(2^14 /3^6) - 19 = floor(22.474622) - 19 = 22 - 19 = 3.
-
A:= proc(n) if type(n, 'even') then n/2; else 3*n+1 ; end if; end proc:
B:= proc(n) a := 0 ; x := n ; while x > 1 do x := A(x) ; a := a+1 ; end do; a ; end proc:
C:= proc(n) a := 0 ; x := n ; while x > 1 do if type(x, 'even') then x := x/2 ; else x := 3*x+1 ; a := a+1 ; end if; end do; a ; end proc:
D:= proc(n) C(n) ; end proc:
A006666:= proc(n) B(n)- C(n) ; end:
A006667:= proc(n) C(n)- D(n) ; end:
G:= proc(n) floor(2^A006666 (n)/3^A006667 (n)) ; end:
for i from 1 to 100 do: printf(`%d, `, G(i)-i):od:
-
Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; nn = 100; t = {}; n = 0; While[Length[t] < nn, n++; c = Collatz[n]; ev = Length[Select[c, EvenQ]]; od = Length[c] - ev - 1; AppendTo[t, Floor[2^ev/3^od]-n]]; t
A324037
The minimal number of iterations to reach 1 of the modified reduced Collatz function, defined for odd numbers 1 + 2*n in A324036 (assuming the Collatz conjecture).
Original entry on oeis.org
0, 2, 1, 6, 7, 5, 3, 7, 4, 8, 2, 6, 9, 48, 7, 46, 10, 5, 8, 14, 47, 11, 6, 45, 9, 10, 4, 49, 12, 13, 8, 47, 10, 11, 5, 44, 50, 5, 9, 15, 9, 48, 3, 12, 12, 40, 7, 46, 51, 10, 10, 38, 16, 43, 49, 30, 4, 13, 8, 14, 41, 19, 47, 20, 52, 11, 11, 16, 39, 17, 6
Offset: 0
a(4) = 7 because 1 + 2*4 = 9 and the 7 fs iterations acting on 9 are 7, 11, 17, 13, 3, 5, 1.
Compare this to the reduced Collatz map given in A075677 which needs only 6 = A075680(5) iterations 7, 11, 17, 13, 5, 1. The additional step in the fs case follows 13 == 5 mod(8).
A351122
Irregular triangle read by rows in which row n lists the number of divisions by 2 after tripling steps in the Collatz 3x+1 trajectory of 2n+1 until it reaches 1.
Original entry on oeis.org
1, 4, 4, 1, 1, 2, 3, 4, 2, 1, 1, 2, 3, 4, 1, 2, 3, 4, 3, 4, 1, 1, 1, 5, 4, 2, 3, 4, 1, 3, 1, 2, 3, 4, 6, 1, 1, 5, 4, 2, 1, 3, 1, 2, 3, 4, 1, 2, 1, 1, 1, 1, 2, 2, 1, 2, 1, 1, 2, 1, 1, 1, 2, 3, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 3, 1, 1, 1, 4, 2, 2, 4, 3, 1, 1, 5, 4, 3, 1, 2, 3, 4
Offset: 1
Triangle starts at T(1,0):
n\k 0 1 2 3 4 5 6 7 8 ...
1: 1 4
2: 4
3: 1 1 2 3 4
4: 2 1 1 2 3 4
5: 1 2 3 4
6: 3 4
7: 1 1 1 5 4
8: 2 3 4
9: 1 3 1 2 3 4
10: 6
11: 1 1 5 4
12: 2 1 3 1 2 3 4
13: 1 2 1 1 1 1 2 2 1 2 1 1 2 ... (see A372362)
...
For n=6, the trajectory of 2*n+1 = 13 is as follows. The tripling steps ("=>") are followed by runs of 3 and then 4 halvings ("->"), so row n=6 is 3, 4.
13 => 40 -> 20 -> 10 -> 5 => 16 -> 8 -> 4 -> 2 -> 1
triple \------------/ triple \---------------/
3 halvings 4 halvings
Runs of halvings are divisions by 2^T(n,k). Row n=11 is 1, 1, 5, 4 and its steps starting from 2*n+1 = 23 reach 1 by a nested expression
(((((((23*3+1)/2^1)*3+1)/2^1)*3+1)/2^5)*3+1)/2^4 = 1.
Cf.
A372362 (row 13, the first 41 terms).
-
row(n) = my(m=2*n+1, list=List()); while (m != 1, if (m%2, m = 3*m+1, my(nb = valuation(m,2)); m/=2^nb; listput(list, nb));); Vec(list); \\ Michel Marcus, Jul 18 2022
A171870
For odd numbers x, a(x) is the number of complex numbers z in the zx + 1 problem giving the same number of iterations as the 3x + 1 problem requires to reach 1.
Original entry on oeis.org
0, 1, 0, 4, 5, 3, 1, 4, 2, 5, 0, 3, 6, 40, 4, 38, 7, 2, 5, 10, 39, 8, 3, 37, 6, 6, 1, 40, 9, 9, 4, 38, 7, 7, 2, 36, 41, 2, 5, 10, 5, 39, 0, 8, 8, 32, 3, 37, 42, 6, 6, 30, 11, 35, 40, 23, 1, 9, 4, 9, 33, 14, 38, 14, 43, 7, 7, 12, 31, 12, 2, 36, 41, 41, 5, 2, 10, 29, 10, 17, 34, 5, 39, 22, 15, 44, 8
Offset: 1
For x=17, a(9)=2 is in the sequence because the associated polynomial of 17 is 17z^2 + 52z + 160 with degree 2.
-
nextOddK[n_] := Module[{m=3n+1}, While[EvenQ[m], m=m/2]; m]; (* assumes odd n *) Table[m=n; cnt=0; If[n>1, While[m=nextOddK[m]; cnt++; m!=1]]; cnt-1, {n, 1, 200, 2}]
A224504
a(n) = number of terms in row n of A214850.
Original entry on oeis.org
2, 3, 6, 3, 3, 5, 3, 5, 4, 6, 4, 5, 4, 3, 8, 2, 3, 6, 3, 8, 6, 3, 8, 6, 2, 6, 8, 3, 4, 4, 4, 6, 4, 3, 8, 8, 2, 3, 7, 3, 8, 12, 3, 4, 8, 2, 8, 8, 3, 4, 8, 4, 8, 9, 4, 10, 6, 2, 5, 8, 2, 8, 6, 4, 6, 5, 3, 8, 4, 3, 8, 9, 4, 6, 7, 3, 8, 4, 4, 8, 5, 4, 8, 6, 5, 6
Offset: 1
a(18) = 6 because there exist 6 finite groups given by row 18 of A214850 where p = 2, 4, 6, 8, 12 and 18. The Collatz trajectory of the number 2*18 + 1 = 37 with odd numbers is T(37,k) = {37, 7, 11, 17, 13, 5, 1}, and the 6 groups G(p) are:
G(2) = {T(37,k)/2Z} = {1}
G(4) = {T(37,k)/4Z} = {1, 3}
G(6) = {T(37,k)/6Z} = {1, 5}
G(8) = {T(37,k)/8Z} = {1, 3, 5, 7}
G(12) = {T(37,k)/12Z} = {1, 5, 7, 11}
G(18) = {T(37,k)/18Z} = {1, 5, 7, 11, 13, 17}
G(18) is a cyclic group because the element 5 (or 11) generates the group:
5^1 == 5, 5^2 == 7, 5^3 == 17, 5^4 == 13, 5^5 == 11, 5^6 == 1 (mod 18).
G(8) is not a cyclic group.
a(170) = 32 because there exist 32 finite groups with two elements given by row 170 of A214850 where p = 2, 4, 6, 8, 10, 12, 18, 20, 24, 30, 34, 36, 38, 40, 60, 68, 72, 76, 90, 102, 114, 120, 136, 152, 170, 180, 190, 204, 228, 306, 340, 342. The Collatz trajectory of the number 2*170 + 1 = 341 with odd numbers is T(341,k) = {1, 341}.
A265099
Least k such that floor(2^A006666(k)/3^A006667(k)) - k = n.
Original entry on oeis.org
1, 6, 9, 19, 18, 27, 33, 37, 36, 50, 43, 56, 59, 66, 57, 74, 78, 72, 97, 87, 86, 98, 112, 119, 118, 134, 123, 115, 114, 130, 149, 148, 157, 135, 179, 144, 153, 187, 220, 174, 173, 172, 197, 196, 255, 224, 238, 219, 236, 203, 249, 268, 247, 246, 230, 229, 228
Offset: 0
a(0) = 1 because A006666(1) = 0 and A006667(1) = 0 => floor(2^0/3^0) - 1 = 1 - 1 = 0;
a(1) = 6 because A006666(6) = 6 and A006667(6) = 2 => floor(2^6/3^2) - 6 = floor(64/9) - 6 = 7 - 6 = 1.
-
lst={};Do[Collatz[k_]:=NestWhileList[If[EvenQ[#],#/2,3 #+1]&,k,#>1&];nn=500;t={};k=0;While[Length[t]
A271082
Triangle read by rows, the coefficients of the (3x+1)-polynomials.
Original entry on oeis.org
1, -3, 3, 1, -30, 5, -15, 7, 1, 2, 4, 16, -1920, 9, 1, 4, 8, 16, 64, -7680, 11, 1, 2, 8, -960, 13, 1, -120, 15, 1, 2, 4, 8, -3840, 17, 1, 4, -480, 19, 1, 2, 16, 32, 128, -15360, 21, -63, 23, 1, 2, 4, -1920, 25, 1, 4, 8, 64, 128, 512, -61440
Offset: 1
Triangle begins:
1, -3,
3, 1, -30,
5, -15,
7, 1, 2, 4, 16, -1920,
9, 1, 4, 8, 16, 64, -7680,
11, 1, 2, 8, -960,
13, 1, -120,
15, 1, 2, 4, 8, -3840,
17, 1, 4, -480,
19, 1, 2, 16, 32, 128, -15360,
21, -63,
23, 1, 2, 4, -1920,
25, 1, 4, 8, 64, 128, 512, -61440,
The corresponding polynomials are:
+----+-----------------------------------------------------------+
| x | Polynomials f(z) including the factor (z - 3) |
+----+-----------------------------------------------------------+
| 1 | z - 3 |
| 3 | 3z^2 + z - 30 |
| 5 | 5z - 15 |
| 7 | 7z^5 + z^4 + 2z^3 + 4z^2 + 16^z - 1920 |
| 9 | 9z^6 + z^5 + 4z^4 + 8z^3 + 16z^2 + 64z - 7680 |
| 11 | 11z^4 + z^3 + 2z^2 + 8z - 960 |
| 13 | 13z^2 + z -120 |
| 15 | 15z^5 + z^4 + 2z^3 + 4z^2 + 8z - 3840 |
| 17 | 17z^3 + z^2 + 4z - 480 |
| 19 | 19z^6 + z^5 + 2z^4 + 16z^3 + 32z^2 + 128z - 15360 |
| 21 | 21z - 63 |
| 23 | 23z^4 + z^3 + 2z^2 + 4z - 1920 |
+----+-----------------------------------------------------------+
+----+-----------------------------------------------------------+
| x | Polynomials f(z)/(z - 3) |
+----+-----------------------------------------------------------+
| 1 | 1 |
| 3 | 3z + 10 |
| 5 | 5 |
| 7 | 7z^4 + 22z^3 + 68z^2 + 208z +640 |
| 9 | 9z^5 + 28z^4 + 88z^3 + 272z^2 + 832z + 2560 |
| 11 | 11z^3 + 34z^2 + 104z + 320 |
| 13 | 13z + 40 |
| 15 | 15z^4 + 46z^3 + 140z^2 + 424z + 1280 |
| 17 | 17z^2 + 52z + 160 |
| 19 | 19z^5 + 58z^4 + 176z^3 + 544z^2 + 1664z + 5120 |
| 21 | 21 |
| 23 | 23z^3 + 70 z^2 + 212z + 640 |
+----+-----------------------------------------------------------+
-
for m from 1 by 2 to 27 do: T:=array(1..50,[0$50]):U:=array(1..50,[0$50]):
n:=m:ii:=2:xx1:=2:pp1:=0:s:=0:U[1]:=n:U[2]:=1:
for q from 1 to 100 while(xx1<>1)do:
n1:=3*n+1:
for p from 1 to 50 do:
p1:=2^p:x1:=floor(n1/p1):x0:=irem(n1,p1):
if x0=0 and xx1<> 1
then
pp1:=p:xx1:=x1:
else
fi:
od:
T[ii]:=pp1:n1:=x1:n:=xx1:ii:=ii+1:od:s:=0:
for j from 1 to ii-3 do:
s:=s+T[j]:U[j+2]:=2^s:
od:
s:=s+T[ii-2]:s1:=2^s:s:=s+T[ii-1]:
s2:=2^s:U[ii]:=s1-s2:
W:=array(1..ii-1,[0$ii-1]):
W[1]:=U[1]:
for l from 2 to ii-1 do:
W[l]:=U[l+1]:
od:
print(m):
print(W):
od:
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.
Original entry on oeis.org
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
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
A351123
Irregular triangle read by rows: row n lists the partial sums of the number of divisions by 2 after each tripling step in the Collatz trajectory of 2n+1.
Original entry on oeis.org
1, 5, 4, 1, 2, 4, 7, 11, 2, 3, 4, 6, 9, 13, 1, 3, 6, 10, 3, 7, 1, 2, 3, 8, 12, 2, 5, 9, 1, 4, 5, 7, 10, 14, 6, 1, 2, 7, 11, 2, 3, 6, 7, 9, 12, 16, 1, 3, 4, 5, 6, 7, 9, 11, 12, 14, 15, 16, 18, 19, 20, 21, 23, 26, 27, 28, 30, 31, 33, 34, 35, 36, 37, 38, 41, 42, 43, 44, 48, 50, 52, 56, 59, 60, 61, 66, 70
Offset: 1
Triangle starts at T(1,0):
n\k 0 1 2 3 4 5 6 7 8 9 10 ...
1: 1 5
2: 4
3: 1 2 4 7 11
4: 2 3 4 6 9 13
5: 1 3 6 10
6: 3 7
7: 1 2 3 8 12
8: 2 5 9
...
E.g., row 3 of A351122 is [1, 1, 2, 3, 4]; its partial sums are [1, 2, 4, 7, 11].
-
orow(n) = my(m=2*n+1, list=List()); while (m != 1, if (m%2, m = 3*m+1, my(nb = valuation(m,2)); m/=2^nb; listput(list, nb));); Vec(list); \\ A351122
row(n) = my(v = orow(n)); vector(#v, k, sum(i=1, k, v[i])); \\ Michel Marcus, Jul 18 2022
A349873
Smallest odd value such that any Collatz trajectory in which it occurs contains exactly n odd values other than '1'.
Original entry on oeis.org
21, 3, 69, 45, 15, 9, 51, 33, 87, 57, 39, 105, 135, 363, 123, 339, 219, 159, 393, 519, 681, 897, 603, 111, 297, 1581, 1053, 351, 933, 621, 207, 549, 183, 243, 645, 429, 285, 189, 63, 165, 27, 147, 195, 129, 171, 231, 609, 411, 543, 1449, 975, 327, 873, 1185, 1527, 1017
Offset: 1
a(1)=21 as 21 occurs solely in Collatz trajectories starting with 21*2^k, and these trajectories all contain one single odd value other than 1. No value smaller than 21 satisfies these requirements. In particular, a(1) does not equal 5 since 5 is part of Collatz trajectories that contain multiple odd values other than 1 (e.g., ...,13,40,20,10,5,16,8,4,2,1).
a(2)=3 as 3 occurs solely in Collatz trajectories starting with 3*2^k, and these trajectories all contain exactly two odd values other than 1 (namely 3 and 5).
-
oddsteps(n)={my(s=0); while(n!=1, if(n%2,n=(3*n+1);s++); n/=2); s}
a(n)={forstep(k=3, oo, 6, if(oddsteps(k)==n, return(k)))} \\ Andrew Howroyd, Dec 19 2021
-
oddsteps(n)=my(s); while(n>1, n+=n>>1+1; if(!bitand(n,1), n >>= valuation(n,2)); s++); s
first(n)=my(v=vector(n),r=n,t); forstep(k=3,oo,2, t=oddsteps(k); if(t<=n && v[t]==0, v[t]=k; if(r-- == 0, return(v)))) \\ Charles R Greathouse IV, Dec 22 2021
Comments