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-10 of 36 results. Next

A287804 Number of quinary sequences of length n such that no two consecutive terms have distance 1.

Original entry on oeis.org

1, 5, 17, 59, 205, 713, 2481, 8635, 30057, 104629, 364225, 1267923, 4413861, 15365465, 53490097, 186209299, 648230545, 2256616133, 7855718641, 27347281995, 95201200637, 331413874569, 1153716087665, 4016309864843, 13981555011321, 48672509644725
Offset: 0

Views

Author

David Nacin, Jun 01 2017

Keywords

Examples

			For n=2 the a(2)=17=25-8 sequences contain every combination except these eight: 01,10,12,21,23,32,34,43.
		

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{5, -5, -1}, {1, 5, 17}, 50]
  • Python
    def a(n):
        if n in [0,1,2]:
            return [1,5,17][n]
        return 5*a(n-1)-5*a(n-2)-a(n-3)

Formula

a(n) = 5*a(n-1) - 5a(n-2) - a(n-3), a(0)=1, a(1)=5, a(2)=17.
G.f.: (1 - 3*x^2)/(1 - 5*x + 5*x^2 + x^3).

A287819 Number of nonary sequences of length n such that no two consecutive terms have distance 4.

Original entry on oeis.org

1, 9, 71, 561, 4433, 35031, 276827, 2187585, 17287073, 136608591, 1079529611, 8530826457, 67413620993, 532726379847, 4209793089371, 33267280400913, 262889866978817, 2077449112980255, 16416740845208075, 129730917736941417, 1025179795159015841
Offset: 0

Views

Author

David Nacin, Jun 02 2017

Keywords

Examples

			For n=2 the a(2) = 81 - 10 = 71 sequences contain every combination except these ten: 04,40,15,51,26,62,37,73,48,84.
		

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{8, 1, -14}, {1, 9, 71, 561}, 40]
  • Python
    def a(n):
        if n in [0, 1, 2, 3]:
            return [1, 9, 71, 561][n]
        return 8*a(n-1)+a(n-2)-14*a(n-3)

Formula

For n>2, a(n) = 8*a(n-1) + a(n-2) - 14*a(n-3), a(0)=1, a(1)=9, a(2)=71, a(3)=561.
G.f.: (1 + x - 2 x^2 - 2 x^3)/(1 - 8 x - x^2 + 14 x^3).

A059929 a(n) = Fibonacci(n)*Fibonacci(n+2).

Original entry on oeis.org

0, 2, 3, 10, 24, 65, 168, 442, 1155, 3026, 7920, 20737, 54288, 142130, 372099, 974170, 2550408, 6677057, 17480760, 45765226, 119814915, 313679522, 821223648, 2149991425, 5628750624, 14736260450, 38580030723, 101003831722, 264431464440, 692290561601, 1812440220360
Offset: 0

Views

Author

Henry Bottomley, Feb 09 2001

Keywords

Comments

Expansion of golden ratio (1+sqrt(5))/2 as an infinite product: phi = Product_{i>=0} (1+1/(Fibonacci(2*i+1) * Fibonacci(2*i+3)-1)) * (1-1/(Fibonacci(2*i+2) * Fibonacci(2i+4)+1)). - Thomas Baruchel, Nov 11 2003
Each of these is one short of or one over the square of a Fibonacci number (A007598). This means that a rectangle sized F(n) by F(n + 2) units can't be converted into a square with sides of length F(n + 1) units unless one square unit of material is added or removed. - Alonso del Arte, May 03 2011
These are the integer parts of the numerators of the numbers with continued fraction representations [1, 2, 2, 2, ...], [1, 1, 2, 2, 2, ...], [1, 1, 1, 2, 2, 2, ...], etc., that is, sqrt(2), (2+sqrt(2))/2, 3-sqrt(2), (10+sqrt(2))/7, (24-sqrt(2))/14, etc. - Geoffrey Caveney, May 03 2014
a(n) appears also as the third component of the square of [F(n), F(n+1), F(n+2), F(n+3)], for n >= 0, where F(n) = A000045(n), in the Clifford algebra Cl_2 over Euclidean 2-space. The whole quartet of sequences for this square is [-A248161(n), A079472(n+1), a(n), A121801(n+1)]. See the Oct 15 2014 comment in A147973 where also a reference is given. - Wolfdieter Lang, Nov 01 2014
Numbers with a continued fraction expansion with the repeating sequence of length n [1, 1, ..., 1, 2], n-1 ones followed by a single two, for n > = 1, appear to be equal to (F(n) + sqrt(a(n)))/F(n+1), where F(n) = A000045(n). - R. James Evans, Nov 21 2018
The preceding conjecture is true. Proof: For n >= 1 let c(n) := confrac(repeat(1^{n-1}, 2)) where 1^{k} denotes 1 taken k times. This can be computed, e.g. from [Perron, third and fourth eq. on p. 62], as c(n) = (F(n) + sqrt(F(n+1)^2 - (-1)^n)) / F(n+1), which is the conjectured formula because F(n+1)^2 - (-1)^n = a(n). - Wolfdieter Lang, Jan 05 2019

Examples

			G.f. = 2*x + 3*x^2 + 10*x^3 + 24*x^4 + 65*x^5 + 168*x^6 + ... - _Michael Somos_, Mar 18 2022
		

References

  • Oskar Perron, Die Lehre von den Kettenbrüchen, Band I, 3. Auflage, B. G. Teubner, Stuttgart, 1954, pp. 61-61.

Crossrefs

Bisection of A070550.
First differences of A059840.

Programs

  • GAP
    a:=List([0..30],n->Fibonacci(n)*Fibonacci(n+2));; Print(a); # Muniru A Asiru, Jan 05 2019
    
  • Magma
    [Fibonacci(n)*Fibonacci(n+2): n in [0..30]]; // Vincenzo Librandi, Jul 02 2014
    
  • Maple
    with(combinat): a:=n->fibonacci(n)*fibonacci(n+2): seq(a(n), n=0..26); # Zerinvary Lajos, Oct 07 2007
  • Mathematica
    Table[Fibonacci[n]*Fibonacci[n+2],{n,0,60}] (* Vladimir Joseph Stephan Orlovsky, Nov 17 2009 *)
  • PARI
    a(n) = fibonacci(n)*fibonacci(n + 2) \\ Harry J. Smith, Jun 30 2009
    
  • Python
    from sympy import fibonacci
    [fibonacci(n)*fibonacci(n+2) for n in range(30)] # Stefano Spezia, Jan 05 2019
  • Sage
    [fibonacci(n)*fibonacci(n+2) for n in range(30)] # G. C. Greubel, Nov 21 2018
    

Formula

a(n) = Fibonacci(n+1)^2 - (-1)^n = A007598(n+1) + A033999(n+1) = A000045(n+1)^2 - A033999(n).
G.f.: (2*x-x^2) / ((1+x)*(1-3*x+x^2)).
Sum_{n>=1} 1/a(n) = 1.
Sum_{n>=1} (-1)^n/a(n) = 2 - sqrt(5).
Sum_{n>=1} 1/a(2n-1) = 1/phi = (sqrt(5) - 1)/2. - Franz Vrabec, Sep 15 2005
Sum_{n>=1} 1/a(2n) = (3 - sqrt(5))/2. - Franz Vrabec, Nov 30 2009
a(n) = ((7+3*sqrt(5))/10)*((3+sqrt(5))/2)^(n-1) + ((7-3*sqrt(5))/10)*((3-sqrt(5))/2)^(n-1) + (3/5)*(-1)^(n-1). - Tim Monahan, Aug 09 2011
a(n) = (Lucas(n+1)^2 - Fibonacci(n+1)^2)/4. - Vincenzo Librandi, Aug 02 2014
a(n) = F(n-2)*F(n) + F(n-1)*F(n) + F(n-2)*F(n+1) + F(n-1)*F(n+1), where F=A000045, F(-2)=-1, F(-1)=1. - Bruno Berselli, Nov 03 2015
a(n) = A035513(1,n-1)*A035513(3,n-1)/2 = A035513(1,n-1)*A035513(4,n-1)/3. - R. J. Mathar, Sep 04 2016
a(n)+a(n+1) = A001519(n+2). - R. J. Mathar, Oct 19 2021
a(n) = 2*A001654(n) - A001654(n-1). - R. J. Mathar, Oct 19 2021
a(n)+a(n+3) = 2*F(2n+5) = A126358(n+2). - Andrés Ventas, Oct 25 2021
Sum_{n>=1} Fibonacci(n+1)/a(n) = 2. - Amiram Eldar, Jan 11 2022
a(n) = a(-2-n) and a(n) + a(n+3) = 2*(a(n+1) + a(n+2)) for all n in Z. - Michael Somos, Mar 18 2022

A287825 Number of sequences over the alphabet {0,1,...,9} such that no two consecutive terms have distance 1.

Original entry on oeis.org

1, 10, 82, 674, 5540, 45538, 374316, 3076828, 25291120, 207889674, 1708825732, 14046322404, 115458919774, 949057110644, 7801124426174, 64124215108032, 527092600834054, 4332631742719370, 35613662169258228, 292739611493034596, 2406281042646218328
Offset: 0

Views

Author

David Nacin, Jun 02 2017

Keywords

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{9, -4, -21, 9, 5}, {1, 10, 82, 674, 5540, 45538}, 40]
  • Python
    def a(n):
        if n in [0, 1, 2, 3, 4, 5]:
            return [1, 10, 82, 674, 5540, 45538][n]
        return 9*a(n-1) - 4*a(n-2) - 21*a(n-3) + 9*a(n-4) + 5*a(n-5)

Formula

For n>5, a(n) = 9*a(n-1) - 4*a(n-2) - 21*a(n-3) + 9*a(n-4) + 5*a(n-5), a(0)=1, a(1)=10, a(2)=82, a(3)=674, a(4)=5540, a(5)=45538.
G.f.: (-1 - x + 4*x^2 + 3*x^3 - 3*x^4 - x^5)/(-1 + 9*x - 4*x^2 - 21*x^3 + 9*x^4 + 5*x^5).

A188866 T(n,k) is the number of n X k binary arrays without the pattern 0 1 diagonally, vertically or antidiagonally.

Original entry on oeis.org

2, 4, 3, 8, 7, 4, 16, 17, 10, 5, 32, 41, 26, 13, 6, 64, 99, 68, 35, 16, 7, 128, 239, 178, 95, 44, 19, 8, 256, 577, 466, 259, 122, 53, 22, 9, 512, 1393, 1220, 707, 340, 149, 62, 25, 10, 1024, 3363, 3194, 1931, 950, 421, 176, 71, 28, 11, 2048, 8119, 8362, 5275, 2658, 1193, 502, 203, 80, 31, 12
Offset: 1

Views

Author

R. H. Hardin, Apr 12 2011

Keywords

Comments

Number of 0..n strings of length k and adjacent elements differing by one or less. (See link for bijection.) Equivalently, number of base (n+1) k digit numbers with adjacent digits differing by one or less. - Andrew Howroyd, Mar 30 2017
All rows are linear recurrences with constant coefficients. See PARI script to obtain generating functions. - Andrew Howroyd, Apr 15 2017
Equivalently, the number of walks of length k-1 on the path graph P_{n+1} with a loop added at each vertex. - Pontus von Brömssen, Sep 08 2021

Examples

			Table starts:
   2  4  8  16  32   64  128   256   512   1024   2048    4096    8192    16384
   3  7 17  41  99  239  577  1393  3363   8119  19601   47321  114243   275807
   4 10 26  68 178  466 1220  3194  8362  21892  57314  150050  392836  1028458
   5 13 35  95 259  707 1931  5275 14411  39371 107563  293867  802859  2193451
   6 16 44 122 340  950 2658  7442 20844  58392 163594  458356 1284250  3598338
   7 19 53 149 421 1193 3387  9627 27383  77923 221805  631469 1797957  5119593
   8 22 62 176 502 1436 4116 11814 33942  97582 280676  807574 2324116  6689624
   9 25 71 203 583 1679 4845 14001 40503 117263 339699  984515 2854281  8277153
  10 28 80 230 664 1922 5574 16188 47064 136946 398746 1161634 3385486  9869934
  11 31 89 257 745 2165 6303 18375 53625 156629 457795 1338779 3916897 11463989
Some solutions for 5 X 3:
  1 1 1   1 1 1   1 1 1   1 1 1   0 0 0   1 1 1   1 1 1
  1 1 1   0 0 1   0 1 1   1 1 1   0 0 0   1 0 0   1 0 1
  0 0 0   0 0 0   0 0 1   1 1 1   0 0 0   0 0 0   0 0 0
  0 0 0   0 0 0   0 0 0   1 1 0   0 0 0   0 0 0   0 0 0
  0 0 0   0 0 0   0 0 0   0 0 0   0 0 0   0 0 0   0 0 0
		

Crossrefs

Columns 2..8 are A016777, A017257(n-1), A188861-A188865.
Rows 2..31 are A001333(n+1), A126358, A057960(n+1), A126360, A002714, A126362-A126386.
Main diagonal is A188860.

Programs

  • Mathematica
    rows = 11; rowGf[n_, x_] = 1 + (x*(n - (3*n + 2)*x) + (2*x^2)*(1 + ChebyshevU[n-1, (1-x)/(2*x)])/ChebyshevU[n, (1-x)/(2*x)])/(1-3*x)^2;
    row[n_] := rowGf[n+1, x] + O[x]^(rows+1) // CoefficientList[#, x]& // Rest; T = Array[row, rows]; Table[T[[n-k+1, k]], {n, 1, rows}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Oct 07 2017, after Andrew Howroyd *)
  • PARI
    \\ from Knopfmacher et al.
    RowGf(k, x='x) = my(z=(1-x)/(2*x)); 1 + (x*(k-(3*k+2)*x) + (2*x^2)*(1+polchebyshev(k-1, 2, z))/polchebyshev(k, 2, z))/(1-3*x)^2;
    T(n,k) = {polcoef(RowGf(n+1) + O(x*x^k),k)}
    for(n=1, 10, print(Vec(RowGf(n+1) + O(x^11)))) \\ Andrew Howroyd, Apr 15 2017 [updated Mar 13 2021]

Formula

Empirical: T(n,1) = n + 1.
Empirical: T(n,2) = 3*n + 1.
Empirical: T(n,3) = 9*n - 1.
Empirical: T(n,4) = 27*n - 13 for n > 1.
Empirical: T(n,5) = 81*n - 65 for n > 2.
Empirical: T(n,6) = 243*n - 265 for n > 3.
Empirical: T(n,7) = 729*n - 987 for n > 4.
Empirical: T(n,8) = 2187*n - 3495 for n > 5.
Empirical: T(1,k) = 2*T(1,k-1).
Empirical: T(2,k) = 2*T(2,k-1) + T(2,k-2).
Empirical: T(3,k) = 3*T(3,k-1) - T(3,k-2).
Empirical: T(4,k) = 3*T(4,k-1) - 2*T(4,k-3).
Empirical: T(5,k) = 4*T(5,k-1) - 3*T(5,k-2) - T(5,k-3).
Empirical: T(6,k) = 4*T(6,k-1) - 2*T(6,k-2) - 4*T(6,k-3) + T(6,k-4).
Empirical: T(7,k) = 5*T(7,k-1) - 6*T(7,k-2) - T(7,k-3) + 2*T(7,k-4).
Empirical: T(8,k) = 5*T(8,k-1) - 5*T(8,k-2) - 5*T(8,k-3) + 5*T(8,k-4) + T(8,k-5).

A287839 Number of words of length n over the alphabet {0,1,...,10} such that no two consecutive terms have distance 9.

Original entry on oeis.org

1, 11, 117, 1247, 13289, 141619, 1509213, 16083463, 171399121, 1826575451, 19465548357, 207441511727, 2210673955769, 23558830139779, 251063019088173, 2675542001860183, 28512861152219041, 303857405535211691, 3238164083417650197, 34508642672922983807
Offset: 0

Views

Author

David Nacin, Jun 07 2017

Keywords

Comments

In general, the number of sequences on {0,1,...,10} such that no two consecutive terms have distance 6+k for k in {0,1,2,3,4} has generating function (-1 - x)/(-1 + 10*x + (2*k+1)*x^2).

Crossrefs

Programs

  • Maple
    a:=proc(n) option remember; if n=0 then 1 elif n=1 then 11 elif n=2 then 117 else 10*a(n-1)+7*a(n-2); fi; end: seq(a(n), n=0..30); # Wesley Ivan Hurt, Nov 25 2017
  • Mathematica
    LinearRecurrence[{10, 7}, {1, 11, 117}, 20]
  • PARI
    Vec((1 + x) / (1 - 10*x - 7*x^2) + O(x^30)) \\ Colin Barker, Nov 25 2017
  • Python
    def a(n):
     if n in [0,1,2]:
      return [1, 11, 117][n]
     return 10*a(n-1) + 7*a(n-2)
    

Formula

For n>2, a(n) = 10*a(n-1) + 7*a(n-2), a(0)=1, a(1)=11, a(2)=117.
G.f.: (-1 - x)/(-1 + 10 x + 7 x^2).
a(n) = (((5-4*sqrt(2))^n*(-3+2*sqrt(2)) + (3+2*sqrt(2))*(5+4*sqrt(2))^n)) / (4*sqrt(2)). - Colin Barker, Nov 25 2017

A287831 Number of sequences over the alphabet {0,1,...,9} such that no two consecutive terms have distance 8.

Original entry on oeis.org

1, 10, 96, 924, 8892, 85572, 823500, 7924932, 76265388, 733938084, 7063035084, 67970944260, 654116708844, 6294876045156, 60578584659468, 582976518206148, 5610260171812140, 53990200655546148, 519573366930788172, 5000101506310370436, 48118353758378062956
Offset: 0

Views

Author

David Nacin, Jun 02 2017

Keywords

Comments

In general, the number of sequences over the alphabet {0,1,...,9} such that no two consecutive terms have distance 5+k for k in {0,1,2,3,4} is given by a(n) = 9*a(n-1) + 2*k*a(n-2), a(0)=1, a(1)=10.

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{9, 6}, {1, 10}, 30]
  • Python
    def a(n):
     if n in [0, 1]:
      return [1, 10][n]
     return 9*a(n-1)+6*a(n-2)

Formula

a(n) = 9*a(n-1) + 6*a(n-2), a(0)=1, a(1)=10.
G.f.: (-1 - x)/(-1 + 9*x + 6*x^2).
a(n) = ((1 - 11/sqrt(105))/2)*((9 - sqrt(105))/2)^n + ((1 + 11/sqrt(105))/2)*((9 + sqrt(105))/2)^n.

A133585 Expansion of x - x^2*(2*x+1)*(x^2-2) / ( (x^2-x-1)*(x^2+x-1) ).

Original entry on oeis.org

1, 2, 4, 5, 10, 13, 26, 34, 68, 89, 178, 233, 466, 610, 1220, 1597, 3194, 4181, 8362, 10946, 21892, 28657, 57314, 75025, 150050, 196418, 392836, 514229, 1028458, 1346269, 2692538, 3524578, 7049156, 9227465, 18454930, 24157817
Offset: 1

Views

Author

Gary W. Adamson, Sep 18 2007

Keywords

Comments

A133585 is a companion to A133586.

Examples

			a(4) = F(5) = 5.
a(5) = 2*a(4) = 2*5 = 10.
		

Crossrefs

Programs

  • Maple
    A133585aux := proc(n,k)
        add(A133566(n,j)*A133080(j,k),j=k..n) ;
    end proc:
    A000045 := proc(n)
        combinat[fibonacci](n) ;
    end proc:
    A133585 := proc(n)
        add(A133585aux(n,j)*A000045(j),j=0..n) ;
    end proc: # R. J. Mathar, Jun 20 2015
  • Mathematica
    CoefficientList[Series[1 - x (2 x + 1) (x^2 - 2)/((x^2 - x - 1) (x^2 + x - 1)), {x, 0, 40}], x] (* Vincenzo Librandi, Jun 21 2015 *)
    LinearRecurrence[{0,3,0,-1},{1,2,4,5,10},40] (* Harvey P. Dale, Mar 04 2019 *)
  • PARI
    a(n)=if(n>1,([0,1,0,0;0,0,1,0;0,0,0,1;-1,0,3,0]^(n-2)*[2;4;5;10])[1,1],1) \\ Charles R Greathouse IV, Jun 20 2015

Formula

Equals the matrix-matrix-vector product A133566 * A133080 * A000045 (previous name).
For even-indexed terms, a(n) = F(n+1). For odd-indexed terms (n>1), a(n) = 2*a(n-1), A126358.

Extensions

Previous name corrected and new name from R. J. Mathar, Jun 20 2015

A208717 Number of n-bead necklaces labeled with numbers 1..4 allowing reversal, with no adjacent beads differing by more than 1.

Original entry on oeis.org

4, 7, 10, 18, 28, 56, 98, 208, 418, 933, 2044, 4777, 11072, 26548, 63672, 155248, 379348, 935278, 2311294, 5741228, 14292966, 35699049, 89339860, 224097602, 563074848, 1417313897, 3572747650, 9019154944, 22797181996, 57693378135, 146168107034, 370712004868
Offset: 1

Views

Author

R. H. Hardin, Mar 01 2012

Keywords

Examples

			All solutions for n=3:
..3....2....1....3....4....2....3....1....1....2
..3....2....1....3....4....3....4....1....2....2
..4....2....1....3....4....3....4....2....2....3
		

Crossrefs

Column 4 of A208721.

Formula

a(2n+1) = (1/2) * (A208773(2n+1) + A126358(n+1)). - Andrew Howroyd, Mar 03 2017
a(2n) = (1/2) * A208773(2n) + (1/4) * (A126358(n) + A126358(n+1)). - Andrew Howroyd, Mar 03 2017

Extensions

a(29)-a(32) from Andrew Howroyd, Mar 03 2017

A287811 Number of septenary sequences of length n such that no two consecutive terms have distance 5.

Original entry on oeis.org

1, 7, 45, 291, 1881, 12159, 78597, 508059, 3284145, 21229047, 137226717, 887047443, 5733964809, 37064931183, 239591481525, 1548743682699, 10011236540769, 64713650292711, 418315611378573, 2704034619149571, 17479154549033145, 112987031151647583
Offset: 0

Views

Author

David Nacin, Jun 01 2017

Keywords

Examples

			For n=2 the a(2) = 49-4 = 45 sequences contain every combination except these four: 05, 50, 16, 61.
		

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{6, 3}, {1,7}, 40]
  • Python
    def a(n):
     if n in [0, 1]:
      return [1, 7][n]
     return 6*a(n-1)-3*a(n-2)

Formula

a(n) = 6*a(n-1) + 3*a(n-2), a(0)=1, a(1)=7.
G.f.: (1 + x)/(1 - 6*x - 3*x^2).
a(n) = A090018(n-1)+A090018(n). - R. J. Mathar, Oct 20 2019
Showing 1-10 of 36 results. Next