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!)
A174354 a(0)=1, a(1)=a(2)=2, a(3)=8 and for n >= 4: if n == 0 (mod 4), a(n)=2, if n == 1 (mod 4), a(n)=8, if n == 2 (mod 4), a(n)=2, if n == 3 (mod 8), a(n)=32, if n = 16k + 15, a(n) = 128*4^k, and if n = 16k+7, a(n) = 128*4^(k-1). 2

%I #14 Nov 06 2018 21:17:28

%S 1,2,2,8,2,8,2,32,2,8,2,32,2,8,2,128,2,8,2,32,2,8,2,128,2,8,2,32,2,8,

%T 2,512,2,8,2,32,2,8,2,512,2,8,2,32,2,8,2,2048,2,8,2,32,2,8,2,2048,2,8,

%U 2,32,2,8,2,8192,2,8,2,32,2,8,2,8192,2,8,2,32,2,8,2,32768,2,8,2,32,2,8,2

%N a(0)=1, a(1)=a(2)=2, a(3)=8 and for n >= 4: if n == 0 (mod 4), a(n)=2, if n == 1 (mod 4), a(n)=8, if n == 2 (mod 4), a(n)=2, if n == 3 (mod 8), a(n)=32, if n = 16k + 15, a(n) = 128*4^k, and if n = 16k+7, a(n) = 128*4^(k-1).

%C It seems that this sequence gives the numbers of "2" in the successive sets of 2, which appear in A174353.

%H Antti Karttunen, <a href="/A174354/b174354.txt">Table of n, a(n) for n = 0..16384</a>

%e a(7) = 32 because 7 = 16*(0) + 7 and a(7) = 128*4^(-1).

%e a(8) = 2 because 8 == 0 (mod 4).

%p A174354 := proc(n)

%p if n <= 3 then

%p return op(n+1,[1,2,2,8]) ;

%p end if;

%p if n mod 4 =0 then

%p 2 ;

%p elif n mod 4 =1 then

%p 8 ;

%p elif n mod 4 = 2 then

%p 2

%p elif n mod 8 = 3 then

%p 32

%p elif n mod 16 = 15 then

%p 128*4^((n-15)/16)

%p elif n mod 16 =7 then

%p 128*4^((n-7)/16-1)

%p end if;

%p end proc:

%p seq(A174354(n),n=0..240) ; # _R. J. Mathar_, Feb 29 2016

%t Nest[Append[#1, Which[Mod[#2, 4] == 0, 2, Mod[#2, 4] == 1, 8, Mod[#2, 4] == 2, 2, Mod[#2, 8] == 3, 32, Mod[#2, 16] == 15, 128*4^Quotient[#2, 16], True, 128*4^(Quotient[#2, 16] - 1)]] & @@ {#, Length@ #} &, {1, 2, 2, 8}, 91] (* _Michael De Vlieger_, Nov 06 2018 *)

%o (PARI) A174354(n) = if(n<=1,1+n,if(3==n,8,if(0==((n%4)%2),2,if(1==(n%4),8,if(3==(n%8),32,if(15==(n%16),128*4^((n-15)/16),128*4^((n-7)/16-1))))))); \\ (Adapted from Maple-program) - _Antti Karttunen_, Nov 06 2018

%Y Cf. A174353.

%K easy,nonn

%O 0,2

%A _Richard Choulet_, Mar 17 2010

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 20 00:58 EDT 2024. Contains 371798 sequences. (Running on oeis4.)