login
A050020
a(n) = floor(a(n-1)/2) if this is positive and not yet in the sequence, otherwise a(n) = 10*a(n-1).
5
1, 10, 5, 2, 20, 200, 100, 50, 25, 12, 6, 3, 30, 15, 7, 70, 35, 17, 8, 4, 40, 400, 4000, 2000, 1000, 500, 250, 125, 62, 31, 310, 155, 77, 38, 19, 9, 90, 45, 22, 11, 110, 55, 27, 13, 130, 65, 32, 16, 160, 80, 800, 8000, 80000, 40000, 20000
OFFSET
1,2
LINKS
MATHEMATICA
Rest@Nest[Append[#, If[MemberQ[#, c = Quotient[#[[-1]], 2]], 10*#[[-1]], c]] &, {0, 1}, 54] (* Ivan Neretin, Sep 06 2015 *)
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]=10*v[i-1]; next); for(j=1, i-1, if(v[j]==t, v[i]=10*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: A320938 A117256 A332837 * A050136 A053050 A033330
KEYWORD
nonn,easy
STATUS
approved