A374843 Number of indices i in [n] such that in the trajectory of i for the Collatz (3x+1) problem the sum and the number of terms are coprime or the trajectory is not finite.
1, 2, 3, 4, 4, 5, 6, 7, 8, 9, 10, 11, 12, 12, 12, 13, 14, 14, 14, 14, 14, 15, 16, 17, 17, 18, 18, 19, 20, 21, 22, 22, 23, 23, 23, 24, 25, 26, 27, 28, 29, 30, 30, 31, 32, 33, 34, 35, 36, 37, 37, 38, 38, 39, 40, 40, 40, 40, 40, 40, 40, 40, 40, 41, 42, 43, 44, 45
Offset: 1
Keywords
Examples
a(5) = 4 = 1 + 1 + 1 + 1 + 0, because gcd(1,1) = gcd(2,3) = gcd(8,49) = gcd(3,7) = 1 and gcd(6,36) > 1. a(1000) = 606 -> sqrt(6*1000/a(1000)) = 3.14658387763... .
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..20000
- Manon Bischoff, Pi is everywhere, even in the Collatz problem (in German), Spektrum der Wissenschaft, 2022
- Jean-Paul Delahaye, The number Pi is everywhere (in French), interstices, 2017
- Alois P. Heinz, Plot of sqrt(6*n/a(n)) - Pi for n = 1..1000000
- Wikipedia, Basel Problem
- Wikipedia, Collatz Conjecture
- Wikipedia, Iverson bracket
- Index entries for sequences related to 3x+1 (or Collatz) problem
- Index entries for sequences related to the number Pi
Programs
-
Maple
b:= proc(n) option remember; [n, 1]+ `if`(n=1, 0, b(`if`(n::even, n/2, 3*n+1))) end: a:= proc(n) option remember; `if`(n<1, 0, a(n-1)+1-signum(igcd(b(n)[])-1)) end: seq(a(n), n=1..68);
-
Mathematica
b[n_] := b[n] = {n, 1} + If[n == 1, {0, 0}, b[If[EvenQ[n], n/2, 3*n + 1]]]; a[n_] := a[n] = If[n < 1, 0, a[n - 1] + 1 - Sign[GCD @@ b[n] - 1]]; Table[a[n], {n, 1, 68}] (* Jean-François Alcover, Sep 04 2024, after Alois P. Heinz *)
Comments