using System.Collections.Generic;
public static void Main()
int startValue = Int32.Parse(Console.ReadLine());
List<int> progressionCollatc = GetCollatc(startValue);
foreach (int output in progressionCollatc)
Console.WriteLine(output);
public static List<int> GetCollatc(int startValue)
List<int> progressionCollatc = new List<int>();
progressionCollatc.Add(startValue);
int tempoparyValue = startValue;
while (tempoparyValue != 1)
if (tempoparyValue % 2 == 0)
tempoparyValue = Convert.ToInt32(tempoparyValue / 2);
progressionCollatc.Add(Convert.ToInt32(tempoparyValue));
tempoparyValue = tempoparyValue * 3 + 1;
progressionCollatc.Add(tempoparyValue);
return progressionCollatc;