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.

A220182 Number of changes of parity in the Collatz trajectory of n.

This page as a plain text file.
%I A220182 #143 Apr 02 2025 23:15:17
%S A220182 0,1,4,1,2,5,10,1,12,3,8,5,4,11,10,1,6,13,12,3,2,9,8,5,14,5,82,11,10,
%T A220182 11,78,1,16,7,6,13,12,13,22,3,80,3,18,9,8,9,76,5,14,15,14,5,4,83,82,
%U A220182 11,20,11,20,11,10,79,78,1,16,17,16,7,6,7,74,13,84,13
%N A220182 Number of changes of parity in the Collatz trajectory of n.
%C A220182 For n < 10^10, if n <> 27, f(n) is finite, f(n) < 3n + 1. If n = 27 = 3^3, f(n) = 82 = 81 + 1 = 3^4 + 1 = 3n + 1. I conjecture that for any n <> 27, f(n) is finite, f(n) < 3n + 1. - _Sergey Pavlov_, Jun 02 2019. Note that this conjecture is stronger than the Collatz conjecture. - _Andrey Zabolotskiy_,  Jun 13 2019
%D A220182 R. K. Guy, Unsolved Problems in Number Theory, E16
%H A220182 T. D. Noe, <a href="/A220182/b220182.txt">Table of n, a(n) for n = 1..10000</a>
%H A220182 <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a>
%F A220182 a(n) = a(A139391(n)) + (n mod 2) + 1 for n >= 2. - _Alan Michael Gómez Calderón_, Apr 01 2025
%e A220182 For n=5, Collatz trajectory for 5 is: 5,16,8,4,2,1; hence the number of transitions between odd and even parity is a(5)=2.
%e A220182 Similarly for n=11, Collatz trajectory gives 11,34,17,52,26,13,40,20,10,5,16,8,4,2,1; implies that a(11)=8.
%t A220182 Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; parity[n_] := If[OddQ[n], 1, 0]; Table[p = parity /@ Collatz[n]; If[OddQ[n], 2*Total[p] - 2, 2*Total[p] - 1], {n, 100}] (* _T. D. Noe_, Feb 24 2013 *)
%o A220182 (PARI) next_iter(n) = if(n%2==0, return(n/2), return(3*n+1))
%o A220182 parity(n) = n%2
%o A220182 a(n) = my(x=n, par=parity(x), i=0); while(x > 1, x=next_iter(x); if(parity(x)!=par, i++; par=parity(x))); i \\ _Felix Fröhlich_, Jun 02 2019
%Y A220182 Cf. A006577, A006667, A139391.
%K A220182 nonn,look
%O A220182 1,3
%A A220182 _Jayanta Basu_, Feb 20 2013