OFFSET
1,1
COMMENTS
The sequence is constructed using the following steps:
Start at 1, and color it blue. Go through the Collatz algorithm, highlight each number that is not in 'blue' in 'red' until you reach an already 'red' number or lower number that is 'blue'. Color the next uncolored number 'blue' and repeat.
So starting at 1, 1 becomes blue, then 4 becomes red, 2 becomes red and move to next number. Next uncolored number is 3, so 3 becomes blue. Then 10 becomes red, 5 becomes red, 16 red, 8 red, and 4 is already red so done. Next uncolored number is 6, so 6 becomes blue, etc.
For any number k the expected colors are:
red if k (mod 18) is equal to 2, 4, 5, 8, 10, 11, 13, 14, 16, or 17.
blue if k (mod 18) is equal to 0, 1, 3, 6, 7, 9, 12, or 15
The list here are the numbers that do not fit this pattern.
Observation:
For up to at least 180000 only numbers of the format k (mod 18) = 1 and k (mod 18) = 7 were not fitting the pattern, they were all red instead of blue.
LINKS
P. Stikker, C# code to visualize grid.
P. Stikker, Excel VBA code to visualize grid.
PROG
(C#) // Unsuspected numbers to check in Collatz conjecture
using System;
namespace Collatz {
class Program {
static void Main() {
Console.Write("Enter until which number to check:");
int nMax = int.Parse(Console.ReadLine());
int[] values = new int[nMax + 1], colors = new int[nMax + 1];
for (int i = 1; i < nMax + 1; i++) {
values[i] = i; colors[i] = 0;
}
for (int i = 1; i < nMax + 1; i++) {
if (colors[i] == 0) {
var myNum = i;
do {
myNum = (myNum % 2 == 0 ? myNum / 2 : myNum * 3 + 1);
if (myNum > i) {
if (myNum <= nMax) colors[myNum] = 1;
}
else myNum = 0;
} while (myNum != 0);
}
}
for (int i = 1; i < nMax+1; i++) {
if (i % 18 == 0 || i % 18 == 1 || i % 18 == 3 || i % 18 == 6 ||
i % 18 == 7 || i % 18 == 9 || i % 18 == 12 || i % 18 == 15) {
if (colors[i]==1) Console.WriteLine(i);
}
else {
if (colors[i] == 0) Console.WriteLine(i);
}
}
Console.ReadKey();
}
}
}
(PARI) isokb(k) = (k==0) || (k==1) || (k==3) || (k==6) || (k==7) || (k==9) || (k==12) || (k==15);
isokr(k) = (k==2) || (k==4) || (k==5) || (k==8) || (k==10) || (k==11) || (k==13) || (k==14) || (k==16) || (k==17);
f(n) = if(n%2, 3*n+1, n/2);
nocolor(n, vred, vblue) = !vecsearch(vred, n) && !vecsearch(vblue, n);
chk(nn) = {vblue = []; vred = []; for (n=1, nn, if (nocolor(n, vred, vblue), ok = 1; vblue = vecsort(concat(vblue, n), , 8); ntodo = n; while (1, m = f(ntodo); if (vecsearch(vred, m), break); if ((m<n) && vecsearch(vblue, m), break); if (!vecsearch(vblue, m), vred = vecsort(concat(vred, m), , 8)); ntodo = m; ); ); ); vb = select(x->(!isokb(x%18)), vblue); vr = select(x->(!isokr(x%18)), vred); select(x->x<=nn, vecsort(concat(vr, vb))); } \\ Michel Marcus, Jul 17 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Peter Stikker, Jul 15 2019
STATUS
approved