login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A187180 Parse the infinite string 0101010101... into distinct phrases 0, 1, 01, 010, 10, ...; a(n) = length of n-th phrase. 14
1, 1, 2, 3, 2, 3, 4, 5, 4, 5, 6, 7, 6, 7, 8, 9, 8, 9, 10, 11, 10, 11, 12, 13, 12, 13, 14, 15, 14, 15, 16, 17, 16, 17, 18, 19, 18, 19, 20, 21, 20, 21, 22, 23, 22, 23, 24, 25, 24, 25, 26, 27, 26, 27, 28, 29, 28, 29, 30, 31, 30, 31, 32, 33, 32, 33, 34, 35, 34, 35, 36, 37, 36, 37, 38, 39, 38, 39, 40, 41, 40, 41, 42, 43, 42, 43, 44, 45, 44, 45, 46, 47, 46, 47, 48, 49, 48, 49, 50, 51, 50, 51, 52, 53, 52, 53, 54, 55, 54, 55, 56, 57, 56, 57, 58, 59, 58, 59, 60, 61 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,3

LINKS

Ray Chandler, Table of n, a(n) for n = 1..1000

Index entries for linear recurrences with constant coefficients, signature (1,0,0,1,-1).

FORMULA

Consider more generally the string 012...k012...k012...k012...k01... with an alphabet of size B, where k = B-1. The sequence begins with B 1's, and thereafter is quasi-periodic with period B^2, and increases by B in each period.

For the present example, where B=2, the sequence begins with two 1's and thereafter increases by 2 in each block of 4: (1,1) (2,3,2,3), (4,5,4,5), (6,7,6,7), ...

From Colin Barker, Oct 15 2015: (Start)

a(n) = (1 + (-1)^n + (1-i)*(-i)^n + (1+i)*i^n + 2*n) / 4 for n>1, where i = sqrt(-1).

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

(End)

EXAMPLE

The sequence begins

   1   1

   2   3   2   3

   4   5   4   5

   6   7   6   7

   8   9   8   9

  10  11  10  11 ...

MAPLE

1, 1, seq(op(2*i*[1, 1, 1, 1]+[0, 1, 0, 1]), i=1..100); # Robert Israel, Oct 15 2015

MATHEMATICA

Join[{1}, LinearRecurrence[{1, 0, 0, 1, -1}, {1, 2, 3, 2, 3}, 119]] (* Ray Chandler, Aug 26 2015 *)

CoefficientList[Series[(x^5 - 2 x^4 + x^3 + x^2 + 1)/((x - 1)^2 (x + 1) (x^2 + 1)), {x, 0, 150}], x] (* Vincenzo Librandi, Oct 16 2015 *)

PROG

(PARI) a(n) = if(n==1, 1, (1 + (-1)^n + (1-I)*(-I)^n + (1+I)*I^n + 2*n) / 4); \\ Colin Barker, Oct 15 2015

(PARI) Vec(x*(x^5-2*x^4+x^3+x^2+1) / ((x-1)^2*(x+1)*(x^2+1)) + O(x^100)) \\ Colin Barker, Oct 15 2015

CROSSREFS

See A187180-A187188 for alphabets of size 2 through 10.

See also A109337, A187199, A187200, A106249, A083219, A018837.

Sequence in context: A083219 A106249 A110516 * A256992 A261323 A134986

Adjacent sequences:  A187177 A187178 A187179 * A187181 A187182 A187183

KEYWORD

nonn,easy

AUTHOR

N. J. A. Sloane, Mar 06 2011

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 22 18:55 EDT 2018. Contains 316500 sequences. (Running on oeis4.)