|
|
A006460
|
|
Image of n after 3k iterates of '3x+1' map (k large).
(Formerly M0304)
|
|
3
|
|
|
1, 2, 2, 4, 4, 4, 2, 1, 2, 1, 4, 1, 1, 4, 4, 2, 1, 4, 4, 2, 2, 1, 1, 2, 4, 2, 1, 1, 1, 1, 2, 4, 4, 2, 2, 1, 1, 1, 2, 4, 2, 4, 4, 2, 2, 2, 4, 4, 1, 1, 1, 4, 4, 2, 2, 2, 4, 2, 4, 2, 2, 4, 4, 1, 1, 1, 1, 4, 4, 4, 1, 2, 2, 2, 4, 2, 2, 4, 4, 1, 2, 4, 4, 1, 1, 1, 1, 4, 1, 4, 4, 4, 4, 1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 4
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
REFERENCES
|
R. K. Guy, Unsolved Problems in Number Theory, E16.
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
|
|
LINKS
|
|
|
FORMULA
|
|
|
MATHEMATICA
|
f[n_] := If[EvenQ[n], n/2, 3 n + 1];
a[n_] := With[{ff = NestWhileList[f, n, {#1, #2, #3} != {4, 2, 1}&, 3]}, ff[[Switch[Mod[Length[ff], 3], 0, -3, 1, -1, 2, -2]]]];
|
|
PROG
|
(Haskell)
a006460 = f 0 where
f k x | mod k 3 == 0 && x `elem` [1, 2, 4] = x
| otherwise = f (k+1) (a006370 x)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,nice
|
|
AUTHOR
|
|
|
EXTENSIONS
|
More terms from Larry Reeves (larryr(AT)acm.org), Apr 27 2001
|
|
STATUS
|
approved
|
|
|
|