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!)
A174314 Sequence given by a(0)=1, a(1)=2 and the recurrence relation: a(n)=a(abs(floor(0.5*n-a(n-2)))) for n>=2. 2

%I #3 Jun 16 2016 23:27:42

%S 1,2,1,2,2,1,2,1,1,2,2,2,2,2,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,1,1,

%T 1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,

%U 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2

%N Sequence given by a(0)=1, a(1)=2 and the recurrence relation: a(n)=a(abs(floor(0.5*n-a(n-2)))) for n>=2.

%C We observe that the numbers of 1 obtained (between the 2), that is 1, 1, 1, 2, 6, 10, 18, define a sequence v for which v(n)=2^(n-2)+2 for n>=5. In the same vein, the numbers of 2 define a sequence w: 1, 2, 1, 5, for which w(n)=7*2^(n-3)-2. This explain the explicit formulas.

%F For p>=1, if 9*2^p-4<=n<=11*2^p-3, then a(n)=1. For p>=0, if 11*2^p-2<=n<=9*2^(p+1)-5, then a(n)=2.

%e a(2)=a(abs(floor(1-1)))=a(0)=1. a(3)=a(abs(floor(1.5-2)))=a(abs(floor(-0.5)))=a(abs(-1))=a(1)=2. a(4)=a(2-a(2))=a(1)=2. If 9*2-4<=n<=11*2-3, that is 14<=n<=19 then a(n)=1. If 11*2-2<=n<=9*2^2-5 that is 20<=n<=31 then a(n)=2.

%p u(0):=1:u(1):=2: for n from 2 to 10000 do u(n):=u(abs(floor((1/2)*n-u(n-2)))):od:seq(u(n),n=0..10000);

%K easy,nonn

%O 0,2

%A _Richard Choulet_, Mar 15 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 25 01:35 EDT 2024. Contains 371964 sequences. (Running on oeis4.)