A340873
a(n) is the number of iterations of A245471 needed to reach 1 starting from n.
Original entry on oeis.org
0, 1, 3, 2, 6, 4, 4, 3, 11, 7, 7, 5, 9, 5, 5, 4, 12, 12, 12, 8, 8, 8, 8, 6, 10, 10, 10, 6, 14, 6, 6, 5, 21, 13, 13, 13, 13, 13, 13, 9, 17, 9, 9, 9, 17, 9, 9, 7, 19, 11, 11, 11, 11, 11, 11, 7, 15, 15, 15, 7, 15, 7, 7, 6, 22, 22, 22, 14, 14, 14, 14, 14, 22, 14
Offset: 1
For n = 10:
- the trajectory of 10 is 10 -> 5 -> 14 -> 7 -> 8 -> 4 -> 2 -> 1,
- so a(10) = 7.
-
a(n) = for (k=0, oo, if (n==1, return (k), n%2, n=bitxor(n, 2*n+1), n=n/2))
A341231
Irregular triangle read by rows giving trajectory from n to reach 1 under the map A245471.
Original entry on oeis.org
1, 2, 1, 3, 4, 2, 1, 4, 2, 1, 5, 14, 7, 8, 4, 2, 1, 6, 3, 4, 2, 1, 7, 8, 4, 2, 1, 8, 4, 2, 1, 9, 26, 13, 22, 11, 28, 14, 7, 8, 4, 2, 1, 10, 5, 14, 7, 8, 4, 2, 1, 11, 28, 14, 7, 8, 4, 2, 1, 12, 6, 3, 4, 2, 1, 13, 22, 11, 28, 14, 7, 8, 4, 2, 1, 14, 7, 8, 4, 2, 1
Offset: 1
Table begins:
1;
2, 1;
3, 4, 2, 1;
4, 2, 1;
5, 14, 7, 8, 4, 2, 1;
6, 3, 4, 2, 1;
7, 8, 4, 2, 1;
8, 4, 2, 1;
9, 26, 13, 22, 11, 28, 14, 7, 8, 4, 2, 1;
10, 5, 14, 7, 8, 4, 2, 1;
11, 28, 14, 7, 8, 4, 2, 1;
12, 6, 3, 4, 2, 1;
13, 22, 11, 28, 14, 7, 8, 4, 2, 1;
14, 7, 8, 4, 2, 1;
15, 16, 8, 4, 2, 1;
16, 8, 4, 2, 1;
...
-
row(n) = { my (r=[n]); while (n>1, r=concat(r, n=if (n%2, bitxor(n, 2*n+1), n/2))); r }
Showing 1-2 of 2 results.
Comments