A056830 Alternate digits 1 and 0.
0, 1, 10, 101, 1010, 10101, 101010, 1010101, 10101010, 101010101, 1010101010, 10101010101, 101010101010, 1010101010101, 10101010101010, 101010101010101, 1010101010101010, 10101010101010101, 101010101010101010
Offset: 0
Examples
n a(n) A000975(n) (If a(n) is interpreted in base 2.) ------------------------------ 0 0 ....................... 0 1 1 ....................... 1 2 10 ...................... 2 = 2^1 3 101 ..................... 5 4 1010 ................... 10 = 2^1 + 2^3 5 10101 .................. 21 6 101010 ................. 42 = 2^1 + 2^3 + 2^5 7 1010101 ................ 85 8 10101010 .............. 170 = 2^1 + 2^3 + 2^5 + 2^7 9 101010101 ............. 341 10 1010101010 ............ 682 = 2^1 + 2^3 + 2^5 + 2^7 + 2^9 11 10101010101 .......... 1365 12 101010101010 ......... 2730 = 2^1 + 2^3 + 2^5 + 2^7 + 2^9 + 2^11, etc. - _Bruno Berselli_, Dec 02 2015
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..800
- Index entries for linear recurrences with constant coefficients, signature (10,1,-10).
- Index entries for 2-automatic sequences.
Crossrefs
Programs
-
GAP
List([0..30], n-> Int(10^(n+1)/99) ); # G. C. Greubel, Jul 14 2019
-
Magma
[Round((20*10^n-11)/198) : n in [0..30]]; // Vincenzo Librandi, Jun 25 2011
-
Maple
A056830 := proc(n) floor(10^(n+1)/99) ; end proc:
-
Mathematica
CoefficientList[Series[x/((1-x^2)*(1-10*x)), {x,0,30}], x] (* G. C. Greubel, Sep 26 2017 *)
-
PARI
Vec(x/((1-x)*(1+x)*(1-10*x))+O(x^30)) \\ Charles R Greathouse IV, Feb 13 2017
-
Sage
[floor(10^(n+1)/99) for n in (0..30)] # G. C. Greubel, Jul 14 2019
Formula
a(n) = +10*a(n-1) + a(n-2) - 10*a(n-3).
a(n) = floor(10^(n+1)/(10^2-1)) = a(n-2)+10^(n-1) = 10*a(n-1) + (1 - (-1)^n)/2.
From Paul Barry, Nov 12 2003: (Start)
a(n+1) = Sum_{k=0..floor(n/2)} 10^(n-2*k).
a(n+1) = Sum_{k=0..n} Sum_{j=0..k} (-1)^(j+k)*10^j.
G.f.: x/((1-x)*(1+x)*(1-10*x)).
a(n) = 9*a(n-1) + 10*a(n-2) + 1.
a(n) = 10^(n+1)/99 - (-1)^n/22 - 1/18. (End)
a(n) = round((20*10^n-11)/198) = floor((10*10^n-1)/99) = ceiling((10*10^n-10)/99) = round((10*10^n-10)/99). - Mircea Merca, Dec 27 2010
From Daniel Forgues, Sep 20 2018: (Start)
If a(n) is interpreted in base 2:
a(2n) = Sum_{k=1..n} 2^(2n-1), n >= 0; a(2n-1) = a(2n)/2, n >= 1.
a(2n) = A020988(n), n >= 0.
a(0) = 0; a(2n) = 4*a(2n-2) + 2, n >= 1. (End)
Extensions
More terms from Casey Mongoven, Mar 19 2006
Comments