|
|
A309771
|
|
a(n) is the number of odd numbers found in the Collatz trajectory of 6*n + 3 before reaching a number x == 5 (mod 8).
|
|
1
|
|
|
2, 5, 4, 1, 18, 4, 5, 1, 2, 5, 6, 1, 3, 2, 3, 1, 2, 5, 12, 1, 5, 6, 4, 1, 2, 3, 10, 1, 5, 2, 3, 1, 2, 4, 4, 1, 5, 10, 7, 1, 2, 5, 8, 1, 3, 2, 3, 1, 2, 6, 8, 1, 4, 3, 13, 1, 2, 3, 5, 1, 5, 2, 3, 1, 2, 6, 4, 1, 6, 10, 6, 1, 2, 4, 9, 1, 3, 2, 3, 1, 2
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,1
|
|
COMMENTS
|
The number reached at the end of the computation, 8x + 5, will need more than 2 even steps to get to an odd number in the Collatz trajectory.
a(3 + 4*n) = 1 always because 6*(3 + 4*n) + 3 = 21 + 24*n = 8*(3*n + 2) + 5.
There's an interesting pattern in these seemingly chaotic numbers:
a(12 + 32*n) = 3,
a(13 + 32*n) = 2,
a(14 + 32*n) = 3,
a(15 + 32*n) = a(3 + 4(8*n + 3)) = 1,
a(16 + 32*n) = 2.
A general formula for a(n), if it exists, could shed some light on the Collatz problem. The big spike at n=4 (large sequence for 27) seems a mystery for me. For big values of n we don't usually get big a(n), probably because of the presence of patterns like the above (just an observation).
|
|
LINKS
|
|
|
FORMULA
|
Not known for now, a(n) is calculated from computer program and definition of the Collatz function, e.g., f(x) = 3x + 1 if x is odd, or x/2 if x is even.
|
|
EXAMPLE
|
For n = 0, 6*0 + 3 = 3. Collatz sequence of 3 omitting the even numbers: 3, 5. 5 = 8*0 + 5 so the computation stops: 2 odd numbers found.
For n = 1, 6*1 + 3 = 9. Sequence: 9, 7, 11, 17, 13. 13 = 8*1 + 5, halt. a(1) = 5.
|
|
MATHEMATICA
|
Array[Count[NestWhileList[If[EvenQ@ #, #/2, 3 # + 1] &, 6 # + 3, Mod[#, 8] != 5 &], _?OddQ] &, 81, 0] (* Michael De Vlieger, Sep 27 2019 *)
|
|
PROG
|
(C)
#include <stdio.h>
#include <stdlib.h>
int collatzOdd(int n) {
int i = 1;
int r;
while ( (r = n % 8) != 5) {
i++;
if (r == 1) {
n = 6*(n / 8) + 1;
} else {
n = 6*(n / 4) + 5;
}
}
return i;
}
int main(int argc, char *argv[]) {
int i = 0;
while (i <= 20000) {
printf("%d %d\n", i, collatzOdd((6 * i) + 3));
i++;
}
return (EXIT_SUCCESS);
}
|
|
CROSSREFS
|
|
|
KEYWORD
|
easy,nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|