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-6 of 6 results.

A187180 Parse the infinite string 0101010101... into distinct phrases 0, 1, 01, 010, 10, ...; a(n) = length of n-th phrase.

Original entry on oeis.org

1, 1, 2, 3, 2, 3, 4, 5, 4, 5, 6, 7, 6, 7, 8, 9, 8, 9, 10, 11, 10, 11, 12, 13, 12, 13, 14, 15, 14, 15, 16, 17, 16, 17, 18, 19, 18, 19, 20, 21, 20, 21, 22, 23, 22, 23, 24, 25, 24, 25, 26, 27, 26, 27, 28, 29, 28, 29, 30, 31, 30, 31, 32, 33, 32, 33, 34, 35, 34, 35, 36, 37, 36, 37, 38, 39, 38, 39, 40, 41, 40, 41, 42, 43, 42, 43, 44, 45, 44, 45, 46, 47, 46, 47, 48, 49, 48, 49, 50, 51, 50, 51, 52, 53, 52, 53, 54, 55, 54, 55, 56, 57, 56, 57, 58, 59, 58, 59, 60, 61
Offset: 1

Views

Author

N. J. A. Sloane, Mar 06 2011

Keywords

Examples

			The sequence begins
   1   1
   2   3   2   3
   4   5   4   5
   6   7   6   7
   8   9   8   9
  10  11  10  11 ...
		

Crossrefs

See A187180-A187188 for alphabets of size 2 through 10.

Programs

  • Maple
    1,1,seq(op(2*i*[1,1,1,1]+[0,1,0,1]), i=1..100); # Robert Israel, Oct 15 2015
  • Mathematica
    Join[{1},LinearRecurrence[{1, 0, 0, 1, -1},{1, 2, 3, 2, 3},119]] (* Ray Chandler, Aug 26 2015 *)
    CoefficientList[Series[(x^5 - 2 x^4 + x^3 + x^2 + 1)/((x - 1)^2 (x + 1) (x^2 + 1)), {x, 0, 150}], x] (* Vincenzo Librandi, Oct 16 2015 *)
  • PARI
    a(n) = if(n==1, 1, (1 + (-1)^n + (1-I)*(-I)^n + (1+I)*I^n + 2*n) / 4); \\ Colin Barker, Oct 15 2015
    
  • PARI
    Vec(x*(x^5-2*x^4+x^3+x^2+1) / ((x-1)^2*(x+1)*(x^2+1)) + O(x^100)) \\ Colin Barker, Oct 15 2015

Formula

Consider more generally the string 012...k012...k012...k012...k01... with an alphabet of size B, where k = B-1. The sequence begins with B 1's, and thereafter is quasi-periodic with period B^2, and increases by B in each period.
For the present example, where B=2, the sequence begins with two 1's and thereafter increases by 2 in each block of 4: (1,1) (2,3,2,3), (4,5,4,5), (6,7,6,7), ...
From Colin Barker, Oct 15 2015: (Start)
a(n) = (1+(-1)^n+(1-i)*(-i)^n+(1+i)*i^n+2*n)/4 for n>1, where i = sqrt(-1).
G.f.: x*(x^5-2*x^4+x^3+x^2+1) / ((x-1)^2*(x+1)*(x^2+1)). (End)
From Wesley Ivan Hurt, May 03 2021: (Start)
a(n) = a(n-1)+a(n-4)-a(n-5).
a(n) = floor((n+1+(-1)^floor((n+1)/2))/2) for n > 1. (End)

A212831 a(4*n) = 2*n, a(2*n+1) = 2*n+1, a(4*n+2) = 2*n+2.

Original entry on oeis.org

0, 1, 2, 3, 2, 5, 4, 7, 4, 9, 6, 11, 6, 13, 8, 15, 8, 17, 10, 19, 10, 21, 12, 23, 12, 25, 14, 27, 14, 29, 16, 31, 16, 33, 18, 35, 18, 37, 20, 39, 20, 41, 22, 43, 22, 45, 24, 47, 24, 49, 26, 51, 26, 53, 28, 55, 28, 57, 30, 59, 30, 61, 32, 63, 32, 65, 34, 67, 34, 69, 36, 71, 36, 73, 38, 75
Offset: 0

Views

Author

Paul Curtz, Aug 14 2012

Keywords

Comments

First differences: (1, 1, 1, -1, 3, -1, 3, -3, 5,...) = (1, A186422).
Second differences: (0, 0, -2, 4, -4, 4, -6, 8, ...) = (-1)^(n+1) * A201629(n).
Interleave the terms with even indices of the companion A215495 and this one to get (A215495(0), A212831(0), A215495(2), A212831(2),...) = (1, 0, 1, 2, 3, 2, 3, 4, 5, 4,...) = A106249, up to the initial term = A083219 = A083220/2.

Crossrefs

Programs

  • Magma
    [(1/4)*((1 +(-1)^n)*(1 - (-1)^Floor(n/2)) + (3 -(-1)^n)*n): n in [0..50]]; // G. C. Greubel, Apr 25 2018
  • Mathematica
    a[n_] := (1/4)*((-(1 + (-1)^n))*(-1 + (-1)^Floor[n/2]) - (-3 + (-1)^n)*n ); Table[a[n], {n, 0, 84}] (* Jean-François Alcover, Sep 18 2012 *)
    LinearRecurrence[{0,1,0,1,0,-1},{0,1,2,3,2,5},80] (* Harvey P. Dale, May 29 2016 *)
  • PARI
    A212831(n)=if(bittest(n,0), n, n\2+bittest(n,1)) \\ M. F. Hasler, Oct 21 2012
    
  • PARI
    for(n=0,50, print1((1/4)*((1 +(-1)^n)*(1 - (-1)^floor(n/2)) + (3 -(-1)^n)*n), ", ")) \\ G. C. Greubel, Apr 25 2018
    

Formula

a(n) + A215495(n) = A043547(n).
a(n) = -A214283(n)/A000108([n/2]).
a(n+1) = (A186421(n)=0,1,2,1,4,...) + 1.
a(2*n) = A052928(n+1).
a(n+2) - a(n) = 2, 2, 0, 2. (period 4).
a(n) = a(n-2) +a(n-4) -a(n-6); also holds for A215495(n).
G.f.: x*(1+2*x+2*x^2+x^4) / ( (x^2+1)*(x-1)^2*(1+x)^2 ). - R. J. Mathar, Aug 21 2012
a(n) = (1/4)*((1 +(-1)^n)*(1 - (-1)^floor(n/2)) + (3 -(-1)^n)*n). - G. C. Greubel, Apr 25 2018

Extensions

Corrected and edited by M. F. Hasler, Oct 21 2012

A110514 Expansion of (1 - x + x^2 + x^3)/(1 - x^2 - x^4 + x^6).

Original entry on oeis.org

1, -1, 2, 0, 3, -1, 4, 0, 5, -1, 6, 0, 7, -1, 8, 0, 9, -1, 10, 0, 11, -1, 12, 0, 13, -1, 14, 0, 15, -1, 16, 0, 17, -1, 18, 0, 19, -1, 20, 0, 21, -1, 22, 0, 23, -1, 24, 0, 25, -1, 26, 0, 27, -1, 28, 0, 29, -1, 30, 0, 31, -1, 32, 0, 33, -1, 34, 0, 35, -1, 36, 0, 37, -1, 38, 0, 39, -1, 40, 0, 41, -1, 42, 0, 43, -1, 44, 0, 45, -1, 46, 0, 47, -1, 48, 0
Offset: 0

Views

Author

Paul Barry, Jul 24 2005

Keywords

Comments

Diagonal sums of A110515. Partial sums of A110516.

Crossrefs

Cf. A106249.

Programs

  • Mathematica
    Riffle[Range[50],{-1,0}] (* Harvey P. Dale, Dec 08 2011 *)
  • PARI
    x='x+O('x^50); Vec((1-x+x^2+x^3)/((1-x^2)^2(1+x^2))) \\ G. C. Greubel, Aug 29 2017

Formula

G.f.: (1 - x + x^2 + x^3)/((1 - x^2)^2(1 + x^2)).
a(n) = a(n-2) + a(n-4) - a(n-6).
a(n) = (n/2 + 1)*(1 + (-1)^n)/2 - (1 - (-1)^n)*(1 + (-1)^((n-1)/2))/4.
a(n) = (sin(Pi*n/2)*((-1)^n - 1) + (n+3)*(-1)^n + (n+1))/4.
a(n) = Sum_{k=0..floor(n/2)} Jacobi(2^(n-2k), 2(n-2k)+1) [conjecture].

A110515 Sequence array for (1 - x + x^2 + x^3)/(1 - x^4).

Original entry on oeis.org

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

Views

Author

Paul Barry, Jul 24 2005

Keywords

Comments

Row sums are A106249. Diagonal sums are A110514.

Examples

			Rows begin
   1;
  -1,  1;
   1, -1,  1;
   1,  1, -1,  1;
   1,  1,  1, -1,  1;
  -1,  1,  1,  1, -1,  1;
   1, -1,  1,  1,  1,- 1,  1;
		

Programs

  • Mathematica
    Table[If[k <= n, -Sin[Pi*(n - k)/2] + Cos[Pi*(n - k)]/2 + 1/2, 0], {n,0, 10}, {k, 0, n}]//Flatten (* G. C. Greubel, Aug 29 2017 *)
  • PARI
    for(n=0,20, for(k=0,n, print1(round(if(k<=n, -sin(Pi*(n-k)/2) + cos(Pi*(n-k))/2 + 1/2, 0)), ", "))) \\ G. C. Greubel, Aug 29 2017

Formula

Riordan array ((1 - x + x^2 + x^3)/(1 - x^4), 1).
Column k has g.f. x^k*(1 - x + x^2 + x^3)/(1 - x^4).
T(n, k) = if(k <= n, -sin(Pi*(n-k)/2) + cos(Pi*(n-k))/2 + 1/2, 0).
T(n, k) = if(k <= n, Jacobi(2^(n-k), 2(n-k)+1), 0) [conjecture].

A234013 Number of maximally biased free polyominoes with n squares.

Original entry on oeis.org

1, 1, 2, 1, 1, 11, 8, 3, 1, 79, 36, 8, 2, 540, 164, 31, 4, 3174, 749, 106, 11, 17443, 3312, 397, 27
Offset: 1

Views

Author

John Mason, Dec 27 2013

Keywords

Comments

Define the bias of a polyomino to be the difference between the number of black squares and the number of white squares when chessboard coloring is applied to the polyomino. Maximally biased polyominoes of size n are those sharing the maximum value of bias among all polyominoes of n squares. For n = 4m + 1, for integer m, all maximally biased polyominoes may be built starting with a monomino and then successively adding "airplane" tetrominoes.

Crossrefs

Extensions

More terms from John Mason, Jan 03 2015

A106251 Expansion of (1-x+x^2+x^3+x^5)/(1-x-x^6+x^7).

Original entry on oeis.org

1, 0, 1, 2, 2, 3, 4, 3, 4, 5, 5, 6, 7, 6, 7, 8, 8, 9, 10, 9, 10, 11, 11, 12, 13, 12, 13, 14, 14, 15, 16, 15, 16, 17, 17, 18, 19, 18, 19, 20, 20, 21, 22, 21, 22, 23, 23, 24, 25, 24, 25, 26, 26, 27, 28, 27, 28, 29, 29, 30, 31, 30, 31, 32, 32, 33, 34, 33, 34, 35, 35, 36, 37, 36, 37, 38
Offset: 0

Views

Author

Paul Barry, Apr 27 2005

Keywords

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{1,0,0,0,0,1,-1},{1,0,1,2,2,3,4},80] (* Harvey P. Dale, Oct 04 2021 *)

Formula

G.f.: (1+x^2+2x^3+2x^4+3x^5+2x^6+3x^7+2x^8+x^9+x^10)/(1-x^6)^2; a(n)=sum{k=0..n, -mu(k mod 6)}.
Showing 1-6 of 6 results.