cp's OEIS Frontend

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.

A334226 a(n) is the number of times that the number 3*k+1 from the Collatz trajectory of n is greater than n.

This page as a plain text file.
%I A334226 #33 Jan 01 2022 08:11:49
%S A334226 0,0,2,0,1,2,5,0,6,1,4,1,2,5,5,0,2,5,5,0,1,3,3,0,6,1,40,3,4,4,38,0,7,
%T A334226 2,2,2,3,4,9,0,39,1,5,1,2,3,37,0,3,4,4,0,1,40,40,0,5,1,5,3,4,38,38,0,
%U A334226 3,3,3,0,1,2,35,0,40,1,3,1,2,6,6,0,4,38,38,0,1,4,4,0,3,1,31,2,3,36,36,0,41,2,2,0
%N A334226 a(n) is the number of times that the number 3*k+1 from the Collatz trajectory of n is greater than n.
%C A334226 The Collatz trajectory of the number n is a sequence starting with n and ending with 1 (obtained for the first time), constructed using even steps k to k/2 and odd steps k to 3*k+1. a(n) is the number of times in the Collatz trajectory of n that the number 3*k+1, obtained after the odd step k to 3*k+1, is greater than n. Alternatively, a(n) represents the number of odd terms in the Collatz trajectory of n that are greater than (n-1)/3. a(1)=0 since the Collatz trajectory of 1 has no steps.
%H A334226 Michael De Vlieger, <a href="/A334226/b334226.txt">Table of n, a(n) for n = 1..10000</a>
%F A334226 a(n) <= A006667(n). - _David A. Corneth_, May 20 2020
%e A334226 The Collatz trajectory of n=3 is 3, (10), 5, (16), 8, 4, 2, 1. It happens twice that the number 3*k+1 in this process is greater than n (those numbers 3*k+1 are in parentheses), so a(3)=2.
%t A334226 a[n_] := Block[{c = NestWhileList[ If[ EvenQ@ #, #/2, 3 # + 1] &, n, #>1 & ]}, Length@ Select[ Range[2, Length[c]], OddQ[c[[# - 1]]] && c[[#]] > n &]]; Array[a, 90] (* _Giovanni Resta_, May 19 2020 *)
%o A334226 (PARI) a(n) = my(res=0, cn=n); while(n>1, if(bitand(n,1), n=3*n+1; if(n>cn, res++);, n>>=1)); res \\ _David A. Corneth_, May 20 2020
%Y A334226 Cf. A006667.
%K A334226 nonn
%O A334226 1,3
%A A334226 _Hamid Kulosman_, May 11 2020
%E A334226 More terms from _Giovanni Resta_, May 19 2020