A138120 Concatenation of n digits 1, 2n-1 digits 0 and n digits 1.
101, 1100011, 11100000111, 111100000001111, 1111100000000011111, 11111100000000000111111, 111111100000000000001111111, 1111111100000000000000011111111, 11111111100000000000000000111111111, 111111111100000000000000000001111111111
Offset: 1
Examples
n ........... a(n) 1 ........... 101 2 ......... 1100011 3 ....... 11100000111 4 ..... 111100000001111 5 ... 1111100000000011111
Links
- Index entries for linear recurrences with constant coefficients, signature (11011,-10121010,110110000,-100000000).
Crossrefs
Programs
-
Maple
a:= n-> parse(cat(1$n,0$(2*n-1),1$n)): seq(a(n), n=1..11); # Alois P. Heinz, Mar 03 2022
-
Mathematica
Table[FromDigits[Join[PadRight[{},n,1],PadRight[{},2n-1,0], PadRight[ {},n,1]]],{n,10}] (* or *) LinearRecurrence[{11011,-10121010,110110000,-100000000},{101,1100011,11100000111,111100000001111},10] (* Harvey P. Dale, Mar 19 2016 *)
-
PARI
Vec(x*(10001000*x^2-12100*x+101)/((x-1)*(10*x-1)*(1000*x-1)*(10000*x-1)) + O(x^100)) \\ Colin Barker, Sep 16 2013
-
Python
def a(n): return int("1"*n + "0"*(2*n-1) + "1"*n) print([a(n) for n in range(1, 11)]) # Michael S. Branicky, Mar 03 2022
Formula
G.f.: x*(10001000*x^2-12100*x+101) / ((x-1)*(10*x-1)*(1000*x-1)*(10000*x-1)). [Colin Barker, Sep 16 2013]
Comments