A275544 Number of distinct terms at a given iteration of the Collatz (or 3x+1) map starting with 0.
1, 2, 4, 8, 15, 29, 56, 108, 208, 400, 766, 1465, 2793, 5314, 10088, 19115, 36156, 68290, 128817, 242720, 456884, 859269, 1614809, 3032673, 5692145, 10678326, 20023239, 37531218, 70323203, 131725663, 246674211, 461819857, 864428716, 1617723538, 3026965088, 5663003895, 10593269487, 19813600282
Offset: 0
Keywords
Examples
a(3) = 8 since x_3 has 8 members and they are all distinct. a(4) = 15 since x_4 has 16 members but the number 1 appears twice.
Links
- Markus Sigg, Table of n, a(n) for n = 0..44
- Wikipedia, Collatz conjecture
Programs
-
Mathematica
nmax = 25; s = {0}; a[0] = 1; Do[s = Join[3s + 1, s/2]; Print[n, " ", a[n] = s//Union//Length], {n, nmax}]; a /@ Range[0, nmax] (* Jean-François Alcover, Nov 16 2019 *)
-
Python
from fractions import Fraction A275544_list, c = [1], [Fraction(0,1)] for _ in range(20): c = set(e for d in c for e in (3*d+1,d/2)) A275544_list.append(len(c)) # Chai Wah Wu, Sep 02 2016
Formula
a(0) = 1; a(n) = 2*a(n-1) - A275545(n), n >= 1.
Extensions
a(27)-a(29) corrected and a(30) added by Chai Wah Wu, Sep 02 2016
a(31)-a(37) from Hugo Pfoertner, Apr 23 2023
Comments