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!)
A121496 Run lengths of successive numbers in A068225. 1

%I #13 Oct 03 2017 03:59:48

%S 1,2,2,1,3,4,4,3,5,6,6,5,7,8,8,7,9,10,10,9,11,12,12,11,13,14,14,13,15,

%T 16,16,15,17,18,18,17,19,20,20,19,21,22,22,21,23,24,24,23,25,26,26,25,

%U 27,28,28,27,29,30,30,29,31,32,32,31,33,34,34,33,35,36,36,35,37,38,38

%N Run lengths of successive numbers in A068225.

%C A000027 and A103889 are bisections.

%H Colin Barker, <a href="/A121496/b121496.txt">Table of n, a(n) for n = 1..1000</a>

%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,0,1,-1).

%F a(2*k-1) = k, a(4*k) = 2*k-1, a(4*k-2) = 2*k, for k >= 1.

%F From _Colin Barker_, Apr 08 2016: (Start)

%F a(n) = a(n-1) + a(n-4) - a(n-5) for n > 5.

%F G.f.: x*(1+x-x^3+x^4) / ((1-x)^2*(1+x)*(1+x^2)). (End)

%F a(n) = (2*n+1-4*cos(n*Pi/2)-cos(n*Pi))/4. - _Wesley Ivan Hurt_, Oct 02 2017

%e The fifth run of successive numbers in A068225 is 8, 9, 10 with run length three so a(5) = 3.

%t Rest@ CoefficientList[Series[x (1 + x - x^3 + x^4)/((1 - x)^2*(1 + x) (1 + x^2)), {x, 0, 75}], x] (* _Michael De Vlieger_, Oct 02 2017 *)

%o (PARI) a(n) = if(n%2==1,(n+1)/2,if(n%4==0,(n/2)-1,(n/2)+1))

%o for(n=1,80,print1(a(n),", "))

%o (PARI) Vec(x*(1+x-x^3+x^4)/((1-x)^2*(1+x)*(1+x^2)) + O(x^100)) \\ _Colin Barker_, Apr 08 2016

%Y Cf. A000027, A068225, A103889.

%K nonn,easy

%O 1,2

%A _Rick L. Shepherd_, Aug 03 2006

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 September 17 10:16 EDT 2024. Contains 375987 sequences. (Running on oeis4.)