login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A050008
a(n) = floor(a(n-1)/2) if this is positive and not yet in the sequence, otherwise a(n) = 6*a(n-1).
5
1, 6, 3, 18, 9, 4, 2, 12, 72, 36, 216, 108, 54, 27, 13, 78, 39, 19, 114, 57, 28, 14, 7, 42, 21, 10, 5, 30, 15, 90, 45, 22, 11, 66, 33, 16, 8, 48, 24, 144, 864, 432, 2592, 1296, 648, 324, 162, 81, 40, 20, 120, 60, 360, 180, 1080, 540, 270, 135
OFFSET
1,2
LINKS
MATHEMATICA
Rest@Nest[Append[#, If[FreeQ[#, r = Quotient[#[[-1]], 2]], r, 6 #[[-1]]]] &, {0, 1}, 57] (* Ivan Neretin, Jul 31 2016 *)
PROG
(PARI) first(n)=my(v=vector(n), t); v[1]=1; for(i=2, n, t=v[i-1]\2; if(t<2, v[i]=6*v[i-1]; next); for(j=1, i-1, if(v[j]==t, v[i]=6*v[i-1]; next(2))); v[i]=t); v \\ Charles R Greathouse IV, Jul 31 2016
CROSSREFS
Cf. A050000 and references therein.
Sequence in context: A229005 A067990 A174012 * A166450 A019069 A213752
KEYWORD
nonn,easy
STATUS
approved