OFFSET
1,2
COMMENTS
This permutation of the natural numbers is the multiply-and-divide (MD) sequence for (M,D)=(3,2). The "MD question" is this: for relatively prime M and D, does the MD sequence contain every positive integer exactly once? An affirmative proof for the more general condition that log base D of M is irrational is given by Mateusz Kwaśnicki in Crux Mathematicorum 30 (2004) 235-239. - Clark Kimberling, Jun 30 2004
LINKS
T. D. Noe, Table of n, a(n) for n = 1..10000
Clark Kimberling, Unsolved Problems and Rewards.
Mateusz Kwaśnicki, The solution of M-D problem (2008).
MATHEMATICA
a[0] = 0; a[1] = 1; a[n_] := a[n] = (b = Floor[a[n-1]/2]; If[FreeQ[Table[ a[k], {k, 0, n-2}], b], b, 3*a[n-1]]);
Array[a, 60] (* Jean-François Alcover, Jul 13 2016 *)
PROG
(Haskell)
a050000 n = a050000_list !! (n-1)
a050000_list = 1 : f [1, 0] where
f xs'@(x:xs) | x `div` 2 `elem` xs = 3 * x : f (3 * x : xs')
| otherwise = x `div` 2 : f (x `div` 2 : xs')
-- Reinhard Zumkeller, Nov 13 2011
CROSSREFS
KEYWORD
nonn,nice,easy
AUTHOR
STATUS
approved