A270814 a(1)=0; thereafter a(2k)=k+a(k), a(2k+1)=6k+4+a(6k+4).
0, 1, 46, 3, 31, 49, 281, 7, 330, 36, 248, 55, 106, 288, 679, 15, 197, 339, 500, 46, 127, 259, 610, 67, 633, 119, 101413, 302, 413, 694, 101073, 31, 808, 214, 505, 357, 498, 519, 2305, 66, 101290, 148, 1295, 281, 452, 633, 100932, 91, 757, 658, 1079, 145, 346, 101440, 102261, 330, 1596, 442, 2128
Offset: 1
Keywords
Links
- Seiichi Manyama, Table of n, a(n) for n = 1..20000
- Seiichi Manyama, Table of n, a(n) for n = 1..650289
- Index entries for sequences related to 3x+1 (or Collatz) problem
Crossrefs
Programs
-
Maple
A270814 := proc(n) local a, traj ; a := 0 ; traj := n ; while traj > 1 do if type(traj, 'even') then traj := traj/2 ; else traj := 3*traj+1 ; end if; a := a+traj ; end do: return a; end proc: [seq(A270814(n),n=1..60)];
-
PARI
a(n) = my(ret=n-1); while((n>>=valuation(n,2)) > 1, ret+=5*n+2; n=3*n+1); ret; \\ Kevin Ryde, Dec 10 2022
Extensions
Typo in definition corrected by Gionata Neri, Apr 08 2016
Comments