login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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

%I #12 Oct 05 2019 11:33:16

%S 1,6,3,18,9,4,2,12,72,36,216,108,54,27,13,78,39,19,114,57,28,14,7,42,

%T 21,10,5,30,15,90,45,22,11,66,33,16,8,48,24,144,864,432,2592,1296,648,

%U 324,162,81,40,20,120,60,360,180,1080,540,270,135

%N a(n) = floor(a(n-1)/2) if this is positive and not yet in the sequence, otherwise a(n) = 6*a(n-1).

%H Ivan Neretin, <a href="/A050008/b050008.txt">Table of n, a(n) for n = 1..10000</a>

%t Rest@Nest[Append[#, If[FreeQ[#, r = Quotient[#[[-1]], 2]], r, 6 #[[-1]]]] &, {0, 1}, 57] (* _Ivan Neretin_, Jul 31 2016 *)

%o (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

%Y Cf. A050000 and references therein.

%K nonn,easy

%O 1,2

%A _Clark Kimberling_

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 13:11 EDT 2024. Contains 371913 sequences. (Running on oeis4.)