This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A374843 #45 Sep 04 2024 13:17:12 %S A374843 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, %T A374843 18,19,20,21,22,22,23,23,23,24,25,26,27,28,29,30,30,31,32,33,34,35,36, %U A374843 37,37,38,38,39,40,40,40,40,40,40,40,40,40,41,42,43,44,45 %N 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. %C A374843 Terms in the trajectories for the Collatz (3x+1) problem can be used to approximate the value of Pi. This method was found by Roland Yéléhada (see the links below). %H A374843 Alois P. Heinz, <a href="/A374843/b374843.txt">Table of n, a(n) for n = 1..20000</a> %H A374843 Manon Bischoff, <a href="https://www.spektrum.de/kolumne/pi-ist-ueberall-auch-im-collatz-problem/2035834">Pi is everywhere, even in the Collatz problem</a> (in German), Spektrum der Wissenschaft, 2022 %H A374843 Jean-Paul Delahaye, <a href="https://interstices.info/le-nombre-pi-est-partout/">The number Pi is everywhere</a> (in French), interstices, 2017 %H A374843 Alois P. Heinz, <a href="/A374843/a374843.jpg">Plot of sqrt(6*n/a(n)) - Pi for n = 1..1000000</a> %H A374843 Wikipedia, <a href="https://en.wikipedia.org/wiki/Basel_problem">Basel Problem</a> %H A374843 Wikipedia, <a href="https://en.wikipedia.org/wiki/Collatz_conjecture">Collatz Conjecture</a> %H A374843 Wikipedia, <a href="https://en.wikipedia.org/wiki/Iverson_bracket">Iverson bracket</a> %H A374843 <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a> %H A374843 <a href="/index/Ph#Pi314">Index entries for sequences related to the number Pi</a> %F A374843 a(n) = a(n-1) + [gcd(A008908(n), A033493(n)) = 1] for n >= 1 with a(0) = 0, where [] is the Iverson bracket. %F A374843 Limit_{n->oo} sqrt(6*n/a(n)) = Pi = A000796. %F A374843 Limit_{n->oo} a(n)/n = A059956. %F A374843 Limit_{n->oo} n/a(n) = A013661. %e A374843 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. %e A374843 a(1000) = 606 -> sqrt(6*1000/a(1000)) = 3.14658387763... . %p A374843 b:= proc(n) option remember; [n, 1]+ %p A374843 `if`(n=1, 0, b(`if`(n::even, n/2, 3*n+1))) %p A374843 end: %p A374843 a:= proc(n) option remember; `if`(n<1, 0, %p A374843 a(n-1)+1-signum(igcd(b(n)[])-1)) %p A374843 end: %p A374843 seq(a(n), n=1..68); %t A374843 b[n_] := b[n] = {n, 1} + If[n == 1, {0, 0}, b[If[EvenQ[n], n/2, 3*n + 1]]]; %t A374843 a[n_] := a[n] = If[n < 1, 0, a[n - 1] + 1 - Sign[GCD @@ b[n] - 1]]; %t A374843 Table[a[n], {n, 1, 68}] (* _Jean-François Alcover_, Sep 04 2024, after _Alois P. Heinz_ *) %Y A374843 Cf. A000796, A003989, A006370, A006577, A008908, A013661, A033493, A059956. %K A374843 nonn %O A374843 1,2 %A A374843 _Alois P. Heinz_, Jul 22 2024