login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A138120
Concatenation of n digits 1, 2n-1 digits 0 and n digits 1.
15
101, 1100011, 11100000111, 111100000001111, 1111100000000011111, 11111100000000000111111, 111111100000000000001111111, 1111111100000000000000011111111, 11111111100000000000000000111111111, 111111111100000000000000000001111111111
OFFSET
1,1
COMMENTS
a(n) has 4n-1 digits.
a(n) is also A147539(n) written in base 2. [Omar E. Pol, Nov 08 2008]
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]
EXAMPLE
n ........... a(n)
1 ........... 101
2 ......... 1100011
3 ....... 11100000111
4 ..... 111100000001111
5 ... 1111100000000011111
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 *)
PROG
(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
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Omar E. Pol, Apr 06 2008
STATUS
approved