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.

Showing 1-7 of 7 results.

A128174 Transform, (1,0,1,...) in every column.

Original entry on oeis.org

1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1
Offset: 1

Views

Author

Gary W. Adamson, Feb 17 2007

Keywords

Comments

Inverse of the triangle = a tridiagonal matrix with (1,1,1,...) in the superdiagonal, (0,0,0,...) in the main diagonal and (-1,-1,-1,...) in the subdiagonal.
Riordan array (1/(1-x^2), x) with inverse (1-x^2,x). - Paul Barry, Sep 10 2008
The position of 1's in this sequence is equivalent to A246705, and the position of 0's is equivalent to A246706. - Bernard Schott, Jun 05 2019

Examples

			First few rows of the triangle are:
  1;
  0, 1;
  1, 0, 1;
  0, 1, 0, 1;
  1, 0, 1, 0, 1; ...
		

Crossrefs

Cf. A004526 (row sums).

Programs

  • Haskell
    a128174 n k = a128174_tabl !! (n-1) !! (k-1)
    a128174_row n = a128174_tabl !! (n-1)
    a128174_tabl = iterate (\xs@(x:_) -> (1 - x) : xs) [1]
    -- Reinhard Zumkeller, Aug 01 2014
    
  • Magma
    [[(1+(-1)^(n-k))/2: k in [1..n]]: n in [1..12]]; // G. C. Greubel, Jun 05 2019
    
  • Maple
    A128174 := proc(n,k)
        if k > n or k < 1 then
            0;
        else
            modp(k+n+1,2) ;
        end if;
    end proc: # R. J. Mathar, Aug 06 2016
  • Mathematica
    a128174[r_] := Table[If[EvenQ[n+k], 1, 0], {n, 1, r}, {k, 1, n}]
    TableForm[a128174[5]] (* triangle *)
    Flatten[a128174[10]] (* data *) (* Hartmut F. W. Hoft, Mar 15 2017 *)
    Table[(1+(-1)^(n-k))/2, {n,1,12}, {k,1,n}]//Flatten (* G. C. Greubel, Sep 26 2017 *)
  • PARI
    for(n=1,12, for(k=1,n, print1((1+(-1)^(n-k))/2, ", "))) \\ G. C. Greubel, Sep 26 2017
    
  • Sage
    [[(1+(-1)^(n-k))/2 for k in (1..n)] for n in (1..12)] # G. C. Greubel, Jun 05 2019

Formula

A lower triangular matrix transform, (1, 0, 1, ...) in every column; n terms of (1, 0, 1, ...) in odd rows; n terms of (0, 1, 0, ...) in even rows.
T(n,k) = [k<=n]*(1+(-1)^(n-k))/2. - Paul Barry, Sep 10 2008
With offset n=1, k=0: Sum_{k=0..n} {T(n,k)*x^k} = A000035(n), A004526(n+1), A000975(n), A033113(n), A033114(n), A033115(n), A033116(n), A033117(n), A033118(n), A033119(n), A056830(n+1) for x=0,1,2,3,4,5,6,7,8,9,10 respectively. - Philippe Deléham, Oct 17 2011
T(n+1,1) = 1 - T(n,1); T(n+1,k) = T(n,k-1), 1 < k <= n+1. - Reinhard Zumkeller, Aug 01 2014

A043291 Every run length in base 2 is 2.

Original entry on oeis.org

3, 12, 51, 204, 819, 3276, 13107, 52428, 209715, 838860, 3355443, 13421772, 53687091, 214748364, 858993459, 3435973836, 13743895347, 54975581388, 219902325555, 879609302220, 3518437208883, 14073748835532, 56294995342131, 225179981368524, 900719925474099
Offset: 1

Views

Author

Keywords

Comments

a(n) is the number whose binary representation is A153435(n). - Omar E. Pol, Jan 18 2009
See A033001 and following for the analog in other bases and the variant with runs of length >= 2. - M. F. Hasler, Feb 01 2014

Crossrefs

Cf. A153435 (binary).
Bisections: A108020, A182512. Bisection of A077854.

Programs

  • Magma
    [Floor(4^(n+1)/5): n in [1..30]]; // Vincenzo Librandi, Jun 26 2011
    
  • Maple
    seq(floor(4^(n+1)/5),n=1..25); # Mircea Merca, Dec 26 2010
  • Mathematica
    f[n_] := Floor[4^(n + 1)/5]; Array[f, 23] (* or *)
    a[1] = 3; a[2] = 12; a[3] = 51; a[n_] := a[n] = 4 a[n - 1] + a[n - 2] - 4 a[n - 3]; Array[a, 23] (* or *)
    3 LinearRecurrence[{4, 1, -4}, {1, 4, 17}, 23] (* Robert G. Wilson v, Jul 01 2014 *)
  • PARI
    A043291 = n->4^(n+1)\5 \\ M. F. Hasler, Feb 01 2014
    
  • Python
    def a(n): return int(''.join([['11', '00'][i%2] for i in range(n)]), 2)
    print([a(n) for n in range(1, 26)]) # Michael S. Branicky, Mar 12 2021

Formula

a(n) = 4*a(n-1)+a(n-2)-4*a(n-3), n>3. - John W. Layman, Feb 01 2000
a(n) = floor(4^(n+1)/5). - Mircea Merca, Dec 26 2010
G.f.: 3*x / ( (x-1)*(4*x-1)*(1+x) ). - Joerg Arndt, Jan 08 2011
a(n) = 3*A033114(n). - R. J. Mathar, Jan 08 2011

A056830 Alternate digits 1 and 0.

Original entry on oeis.org

0, 1, 10, 101, 1010, 10101, 101010, 1010101, 10101010, 101010101, 1010101010, 10101010101, 101010101010, 1010101010101, 10101010101010, 101010101010101, 1010101010101010, 10101010101010101, 101010101010101010
Offset: 0

Views

Author

Henry Bottomley, Aug 30 2000

Keywords

Comments

Fibonacci bit-representations of numbers for which there is only one possible representation and for which the maximal and minimal bit-representations (A104326 and A014417) are equal. The numbers represented are equal to the numbers in A000071 (subtract the first term of that sequence). For example, 10101 = 12 because 8+5+1. - Casey Mongoven, Mar 19 2006
Sequence A000975 written in base 2. - Jaroslav Krizek, Aug 05 2009
The absolute value of alternating sum of the first n repunits: a(n) = abs(Sum_{k=0..n} (-1)^k*A002275(n)). - Ilya Gutkovskiy, Dec 02 2015
Binary representation of the x-axis, from the origin to the right edge, of the n-th stage of growth of the two-dimensional cellular automaton defined by "Rule 131", based on the 5-celled von Neumann neighborhood. See A279053 for references and links. - Robert Price, Dec 05 2016

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
		

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) = A007088(A107909(A104161(n))) = A007088(A000975(n)). - Reinhard Zumkeller, May 28 2005
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

A115255 "Correlation triangle" of central binomial coefficients A000984.

Original entry on oeis.org

1, 2, 2, 6, 5, 6, 20, 14, 14, 20, 70, 46, 41, 46, 70, 252, 160, 134, 134, 160, 252, 924, 574, 466, 441, 466, 574, 924, 3432, 2100, 1672, 1534, 1534, 1672, 2100, 3432, 12870, 7788, 6118, 5506, 5341, 5506, 6118, 7788, 12870, 48620, 29172, 22692, 20152, 19174
Offset: 0

Views

Author

Paul Barry, Jan 18 2006

Keywords

Comments

Row sums are A033114. Diagonal sums are A115256. T(2n,n) is A115257. Corresponds to the triangle of antidiagonals of the correlation matrix of the sequence array for C(2n,n).
Let s=(1,2,6,20,...), (central binomial coefficients), and let T be the infinite square matrix whose n-th row is formed by putting n-1 zeros before the terms of s. Let T' be the transpose of T. Then A115255 represents the matrix product M=T'*T. M is the self-fusion matrix of s, as defined at A193722. See A203005 for characteristic polynomials of principal submatrices of M, with interlacing zeros. - Clark Kimberling, Dec 27 2011

Examples

			Triangle begins:
  1;
  2, 2;
  6, 5, 6;
  20, 14, 14, 20;
  70, 46, 41, 46, 70;
  252, 160, 134, 134, 160, 252;
Northwest corner (square format):
  1    2    6    20    70
  2    5    14   46    160
  6    14   41   134   466
  20   46   134  441   1534
		

Crossrefs

Programs

  • Mathematica
    s[k_] := Binomial[2 k - 2, k - 1];
    U = NestList[Most[Prepend[#, 0]] &, #, Length[#] - 1] &[Table[s[k], {k, 1, 15}]];
    L = Transpose[U]; M = L.U; TableForm[M]
    m[i_, j_] := M[[i]][[j]]; (* A115255 in square format *)
    Flatten[Table[m[i, n + 1 - i], {n, 1, 12}, {i, 1, n}]]
    f[n_] := Sum[m[i, n], {i, 1, n}] + Sum[m[n, j], {j, 1, n - 1}]; Table[f[n], {n, 1, 12}]
    Table[Sqrt[f[n]], {n, 1, 12}]  (* A006134 *)
    Table[m[1, j], {j, 1, 12}]     (* A000984 *)
    Table[m[j, j], {j, 1, 12}]     (* A115257 *)
    Table[m[j, j + 1], {j, 1, 12}] (* 2*A082578 *)
    (* Clark Kimberling, Dec 27 2011 *)

Formula

G.f.: 1/(sqrt(1-4*x)*sqrt(1-4*x*y)*(1-x^2*y)) (format due to Christian G. Bower).
T(n, k) = Sum_{j=0..n} [j<=k]*C(2*k-2*j, k-j)*[j<=n-k]*C(2*n-2*k-2*j, n-k-j).

A059848 As a square table by antidiagonals, the n-digit number which in base k starts 1010101...

Original entry on oeis.org

0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 2, 2, 0, 0, 1, 3, 5, 2, 1, 0, 1, 4, 10, 10, 3, 0, 0, 1, 5, 17, 30, 21, 3, 1, 0, 1, 6, 26, 68, 91, 42, 4, 0, 0, 1, 7, 37, 130, 273, 273, 85, 4, 1, 0, 1, 8, 50, 222, 651, 1092, 820, 170, 5, 0, 0, 1, 9, 65, 350, 1333, 3255, 4369, 2460, 341, 5, 1, 0, 1, 10
Offset: 0

Views

Author

Henry Bottomley, Feb 26 2001

Keywords

Examples

			T(5,3)=10101 base 3=81+9+1=91; T(4,6)=1010 base 6=216+6=222. Table starts {0,0,0,0,...}, {1,1,1,1,...}, {0,1,2,3,...}, {1,2,5,10,...}, ...
		

Crossrefs

Formula

T(n, k)=floor[k^(n+1)/(k^2-1)] =T(n-2, k)+k^(n-1) =k*T(n-1, k)-((-1)^n-1)/2

A097138 Convolution of 4^n and floor(n/2).

Original entry on oeis.org

0, 0, 1, 5, 22, 90, 363, 1455, 5824, 23300, 93205, 372825, 1491306, 5965230, 23860927, 95443715, 381774868, 1527099480, 6108397929, 24433591725, 97734366910, 390937467650, 1563749870611, 6254999482455, 25019997929832
Offset: 0

Views

Author

Paul Barry, Jul 29 2004

Keywords

Comments

a(n+1) gives partial sums of A033114 and second partial sums of A015521.
Partial sums of 1/3*floor(4^n/5). - Mircea Merca, Dec 26 2010

Examples

			a(3) = 1/3*floor(4^0/5)+1/3*floor(4^1/5)+1/3*floor(4^2/5) +1/3*floor(4^3/5) = 0 + 0 + 1 + 4 = 5.
		

Crossrefs

Column k=4 of A368296.

Programs

  • Magma
    [(4^(n+2)-30*n+9*(-1)^n-25)/180: n in [0..30]]; // Vincenzo Librandi, May 31 2011
  • Maple
    A097138 := proc(n) (4^(n+2)-30*n+9*(-1)^n-25)/180 ; end proc: # R. J. Mathar, Jan 08 2011
  • Mathematica
    LinearRecurrence[{5,-3,-5,4},{0,0,1,5},30] (* Harvey P. Dale, Sep 17 2017 *)

Formula

G.f.: x^2/((1-x)*(1-4*x)*(1-x^2)).
a(n) = Sum_{k=0..n} floor((n-k)/2)4^k = Sum_{k=0..n} floor(k/2)*4^(n-k).
a(n) = 5*a(n-1) - 3*a(n-2) - 5*a(n-3) + 4*a(n-4).
From Mircea Merca, Dec 26 2010: (Start)
3*a(n) = round((16*4^n-30*n-25)/60) = floor((8*4^n-15*n-8)/30) = ceiling((8*4^n-15*n-17)/30) = round((8*4^n-15*n-8)/30).
a(n) = a(n-2)+(4^(n-1)-1)/3, n>1. (End)
a(n) = (4^(n+2)-30*n+9*(-1)^n-25)/180. - Bruno Berselli, Dec 27 2010
a(n) = (floor(4^(n+1)/15) - floor((n+1)/2))/3. - Seiichi Manyama, Dec 22 2023

A117616 a(0)=0, a(n)=4a(n-1)+2 for n odd, a(n)=4a(n-1) for n even.

Original entry on oeis.org

0, 2, 8, 34, 136, 546, 2184, 8738, 34952, 139810, 559240, 2236962, 8947848, 35791394, 143165576, 572662306, 2290649224, 9162596898, 36650387592, 146601550370, 586406201480, 2345624805922, 9382499223688, 37529996894754
Offset: 0

Views

Author

Roger L. Bagula, Apr 07 2006

Keywords

References

  • L. Rosenfeld, Nuclear Forces, section II, Interscience, New York, 1948, p 202

Programs

  • Maple
    a:=proc(n) if n=0 then 0 elif n mod 2 = 1 then 4*a(n-1)+2 else 4*a(n-1) fi end: seq(a(n),n=0..23);
  • Mathematica
    b[0] := 0 b[1] := 2 b[n_?EvenQ] := b[n] = 4*b[n - 1] b[n_?OddQ] := b[n] = 4*b[n - 1] + 2 a = Table[b[n], {n, 0, 25}]
    nxt[{n_,a_}]:={n+1,If[EvenQ[n],4a+2,4a]}; NestList[nxt,{0,0},30][[;;,2]] (* or *) LinearRecurrence[{4,1,-4},{0,2,8},30] (* Harvey P. Dale, Mar 10 2023 *)

Formula

a(n) = (-5-3*(-1)^n+2^(3+2*n))/15. a(n) = 4*a(n-1)+a(n-2)-4*a(n-3). G.f.: 2*x / ((x-1)*(x+1)*(4*x-1)). [Colin Barker, Feb 17 2013]
a(n) = 2*A033114(n). - R. J. Mathar, Feb 27 2019

Extensions

Edited by N. J. A. Sloane, Apr 16 2006
Showing 1-7 of 7 results.