# A Collatz-like sequence

Nick Hobson nickh at qbyte.org
Tue Feb 27 00:35:40 CET 2007

```Hi Seqfans,

Is this Collatz-like sequence of interest?  a(0) = 0; for n > 0, a(n) =
a(n-1)/2 if a(n-1) is even and not already in the sequence, otherwise a(n)
= 3*a(n-1) + 1.  The first few terms...

0, 1, 4, 2, 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 25, 76,
38, 19, 58, 29, 88, 44, 133, 400, 200, 100, 50, 151, 454, 227, 682, 341,
1024, 512, 256, 128, 64, 32, 97, 292, 146, 73, 220, 110, 55, 166, 83, 250,
125, 376, 188, 94, 47, 142, 71, 214, 107, 322, 161, 484, 242, 121, 364,
182, 91, 274, 137, 412, 206, 103, 310, 155, 466, 233, 700, 350, 175, 526,
263, 790, 395, 1186, 593, 1780, 890, 445, 1336, 668, 334, 167, 502, 251,
754, 377, 1132, 566, 283, 850, 425, 1276, 638, 319, 958, 479, 1438, 719,
2158, 1079, 3238, 1619, 4858, 2429, 7288, 3644, 1822, 911, ...

It's easy to see that, apart from 0, the sequence misses multiples of 3.
The sequence below shows the index where n first appears, or None if
never.  The first non-multiple of 3 that is not present in the first 10
million terms is 43925.  Does the sequence a(n) eventually hit every
non-multiple of 3?

0, 1, 3, None, 2, 15, None, 4, 17, None, 14, 6, None, 11, 182, None, 16,
8, None, 21, 13, None, 5, 145, None, 18, 10, None, 181, 23, None, 349, 41,
None, 7, 147, None, 178, 20, None, 12, 346, None, 183, 25, None, 144, 56,
None, 188, 30, None, 9, 149, None, 48, 180, None, 22, 317, None, 141, 348,
None, 40, 185, None, 322, 159, None, 146, 58, None, 45, 177, None, 19,
164, None, 3450, 151, None, 345, 50, None, 738, 588, None, 24, 319, None,
68, 143, None, 55, 637, None, 42, 187, None, ... .

The idea of a "memory" was inspired by Recaman's sequence (A005132): a(0)
= 0; for n > 0, a(n) = a(n-1) - n if that number is positive and not
already in the sequence, otherwise a(n) = a(n-1) + n.

Nick

```