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”).

A050092
a(n) = floor(a(n-1)/3) if this is positive and not yet in the sequence, otherwise a(n) = 7*a(n-1).
5
1, 7, 2, 14, 4, 28, 9, 3, 21, 147, 49, 16, 5, 35, 11, 77, 25, 8, 56, 18, 6, 42, 294, 98, 32, 10, 70, 23, 161, 53, 17, 119, 39, 13, 91, 30, 210, 1470, 490, 163, 54, 378, 126, 882, 6174, 2058, 686, 228, 76, 532, 177, 59, 19, 133, 44, 308
OFFSET
1,2
LINKS
MATHEMATICA
Rest@Nest[Append[#, If[FreeQ[#, r = Quotient[#[[-1]], 3]], r, 7 #[[-1]]]] &, {0, 1}, 55] (* 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]\3; if(t<2, v[i]=7*v[i-1]; next); for(j=1, i-1, if(v[j]==t, v[i]=7*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: A323995 A040048 A070429 * A293452 A030406 A336194
KEYWORD
nonn
STATUS
approved