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
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, 16, 16, 15, 17, 18, 18, 17, 19, 20, 20, 19, 21, 22, 22, 21, 23, 24, 24, 23, 25, 26, 26, 25, 27, 28, 28, 27, 29, 30, 30, 29, 31, 32, 32, 31, 33, 34, 34, 33, 35, 36, 36, 35, 37, 38, 38 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
A000027 and A103889 are bisections.
LINKS
FORMULA
a(2*k-1) = k, a(4*k) = 2*k-1, a(4*k-2) = 2*k, for k >= 1.
From Colin Barker, Apr 08 2016: (Start)
a(n) = a(n-1) + a(n-4) - a(n-5) for n > 5.
G.f.: x*(1+x-x^3+x^4) / ((1-x)^2*(1+x)*(1+x^2)). (End)
a(n) = (2*n+1-4*cos(n*Pi/2)-cos(n*Pi))/4. - Wesley Ivan Hurt, Oct 02 2017
EXAMPLE
The fifth run of successive numbers in A068225 is 8, 9, 10 with run length three so a(5) = 3.
MATHEMATICA
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 *)
PROG
(PARI) a(n) = if(n%2==1, (n+1)/2, if(n%4==0, (n/2)-1, (n/2)+1))
for(n=1, 80, print1(a(n), ", "))
(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
CROSSREFS
Sequence in context: A246425 A286468 A102563 * A276325 A286548 A256134
KEYWORD
nonn,easy
AUTHOR
Rick L. Shepherd, Aug 03 2006
STATUS
approved

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 05:28 EDT 2024. Contains 375985 sequences. (Running on oeis4.)