cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A138120 Concatenation of n digits 1, 2n-1 digits 0 and n digits 1.

This page as a plain text file.
%I A138120 #25 Feb 16 2024 10:06:21
%S A138120 101,1100011,11100000111,111100000001111,1111100000000011111,
%T A138120 11111100000000000111111,111111100000000000001111111,
%U A138120 1111111100000000000000011111111,11111111100000000000000000111111111,111111111100000000000000000001111111111
%N A138120 Concatenation of n digits 1, 2n-1 digits 0 and n digits 1.
%C A138120 a(n) has 4n-1 digits.
%C A138120 a(n) is also A147539(n) written in base 2. [_Omar E. Pol_, Nov 08 2008]
%H A138120 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (11011,-10121010,110110000,-100000000).
%F A138120 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]
%e A138120 n ........... a(n)
%e A138120 1 ........... 101
%e A138120 2 ......... 1100011
%e A138120 3 ....... 11100000111
%e A138120 4 ..... 111100000001111
%e A138120 5 ... 1111100000000011111
%p A138120 a:= n-> parse(cat(1$n,0$(2*n-1),1$n)):
%p A138120 seq(a(n), n=1..11);  # _Alois P. Heinz_, Mar 03 2022
%t A138120 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 *)
%o A138120 (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
%o A138120 (Python)
%o A138120 def a(n): return int("1"*n + "0"*(2*n-1) + "1"*n)
%o A138120 print([a(n) for n in range(1, 11)]) # _Michael S. Branicky_, Mar 03 2022
%Y A138120 Cf. A138144, A138145, A138146, A138148, A138720, A138721, A138722, A138826.
%Y A138120 Cf. A147539. [_Omar E. Pol_, Nov 08 2008]
%K A138120 base,easy,nonn
%O A138120 1,1
%A A138120 _Omar E. Pol_, Apr 06 2008