The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation. Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A104156 a(1)=a(2)=0, a(n) = abs(2*a(n-1) - a(n-2)) - 1. 5

%I

%S 0,0,-1,1,2,2,1,-1,2,4,5,5,4,2,-1,3,6,8,9,9,8,6,3,-1,4,8,11,13,14,14,

%T 13,11,8,4,-1,5,10,14,17,19,20,20,19,17,14,10,5,-1,6,12,17,21,24,26,

%U 27,27,26,24,21,17,12,6,-1,7,14,20,25,29,32,34,35,35,34,32,29,25,20,14,7,-1,8,16,23,29,34,38,41,43,44,44,43,41,38,34,29,23

%N a(1)=a(2)=0, a(n) = abs(2*a(n-1) - a(n-2)) - 1.

%C A jumping flea sequence. The n-th jump is starting at index n(n+2) and is ending at (n+1)(n+3). It reaches the altitude of n(n+3)/2 and can be given directly (omitting the -1's). For instance, for the 4th jump: start with 4, then add (4-0)=4 to 4 which gives 8, then add (4-1)=3 to 8 giving 8+3=11, then 11+(4-2)=13, then 13+(4-3)=14. By symmetry you get the complete 4th jump: {4,8,11,13,14,14,13,11,8,4}.

%F for any s>0 sum(k=s*(s+2), (s+1)*(s+3), a(k) )=1/3*(s+2)*(s+3)*(2*s-1)=2*A058373(s).

%F a(n) = (1/2)*(n-1-f(n+2)^2) where f(n)=floor(1/2+sqrt(n))-abs{n-1-floor(1/2+sqrt(n))^2}. - _Benoit Cloitre_, Mar 17 2005

%o (PARI) a(n)=if(n<3,0,abs(2*a(n-1)-a(n-2))-1)

%K sign

%O 1,5

%A _Benoit Cloitre_, Mar 09 2005

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

Last modified September 19 21:34 EDT 2020. Contains 337184 sequences. (Running on oeis4.)