This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A050000 #32 Sep 17 2023 21:00:14 %S A050000 1,3,9,4,2,6,18,54,27,13,39,19,57,28,14,7,21,10,5,15,45,22,11,33,16,8, %T A050000 24,12,36,108,324,162,81,40,20,60,30,90,270,135,67,201,100,50,25,75, %U A050000 37,111,55,165,82,41,123,61,183,91,273,136,68 %N A050000 a(n) = floor(a(n-1)/2) if this is not among 0, a(1), ..., a(n-2); otherwise a(n) = 3*a(n-1). %C A050000 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 %H A050000 T. D. Noe, <a href="/A050000/b050000.txt">Table of n, a(n) for n = 1..10000</a> %H A050000 Clark Kimberling, <a href="http://faculty.evansville.edu/ck6/integer/unsolved.html">Unsolved Problems and Rewards</a>. %H A050000 Mateusz Kwaśnicki, <a href="http://www.im.pwr.wroc.pl/~kwasnicki/stuff/MDproblem.en.pdf">The solution of M-D problem</a> (2008). %H A050000 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %t A050000 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]]); %t A050000 Array[a, 60] (* _Jean-François Alcover_, Jul 13 2016 *) %o A050000 (Haskell) %o A050000 a050000 n = a050000_list !! (n-1) %o A050000 a050000_list = 1 : f [1,0] where %o A050000 f xs'@(x:xs) | x `div` 2 `elem` xs = 3 * x : f (3 * x : xs') %o A050000 | otherwise = x `div` 2 : f (x `div` 2 : xs') %o A050000 -- _Reinhard Zumkeller_, Nov 13 2011 %Y A050000 Cf. A050076, A050001 (inverse). %Y A050000 MD sequences: %Y A050000 A050076 (2,3), A050124 (2,5), %Y A050000 this sequence (3,2), A050104 (3,4), %Y A050000 A050080 (4,3), %Y A050000 A050004 (5,2), A050084 (5,3), A050108 (5,4), %Y A050000 A050008 (6,2), A050088 (6,3), A050112 (6,4), %Y A050000 A050012 (7,2), A050092 (7,3), %Y A050000 A050096 (8,3), %Y A050000 A050016 (9,2), %Y A050000 A050020 (10,2), A050100 (10,3). %K A050000 nonn,nice,easy %O A050000 1,2 %A A050000 _Clark Kimberling_