A033478 3x+1 sequence beginning at 3.
3, 10, 5, 16, 8, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1
Offset: 0
References
- C. A. Pickover, The Math Book, Sterling, NY, 2009; see p. 374.
Links
Crossrefs
Row 3 of A347270.
Programs
-
Maple
f:=proc(n) if n mod 2 = 0 then n/2 else 3*n+1; fi; end; g:=proc(n) local i,t1; t1:=[n]; for i from 1 to 120 do t1:=[op(t1),f(t1[nops(t1)])]; od; t1; end; g(3);
-
Mathematica
A033478list[nmax_]:=PadRight[{3,10,5,16,8},nmax+1,{2,1,4}];A033478list[100] (* Paolo Xausa, May 31 2023 *)
-
PARI
a(n)=if(n>4,[2,1,4][n%3+1],[3,10,5,16,8][n+1]) \\ Charles R Greathouse IV, Jun 22 2016
-
PARI
Vec((3 + 10*x + 5*x^2 + 13*x^3 - 2*x^4 - x^5 - 14*x^6 - 7*x^7) / ((1 - x)*(1 + x + x^2)) + O(x^80)) \\ Colin Barker, Oct 04 2019
Formula
From Colin Barker, Oct 04 2019: (Start)
G.f.: (3 + 10*x + 5*x^2 + 13*x^3 - 2*x^4 - x^5 - 14*x^6 - 7*x^7) / ((1 - x)*(1 + x + x^2)).
a(n) = a(n-3) for n>7.
(End)