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 30 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).

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).

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.

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

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

Original entry on oeis.org

1, 11, 115, 1205, 12625, 132275, 1385875, 14520125, 152130625, 1593906875, 16699721875, 174966753125, 1833166140625, 19206495171875, 201230782421875, 2108340300078125, 22089556912890625, 231437270629296875, 2424820490857421875, 25405391261720703125
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

  • Mathematica
    LinearRecurrence[{10, 5}, {1, 11, 115}, 20]
  • PARI
    Vec((1 + x) / (1 - 10*x - 5*x^2) + O(x^40)) \\ Colin Barker, Nov 25 2017
  • Python
    def a(n):
     if n in [0,1,2]:
      return [1, 11, 115][n]
     return 10*a(n-1) + 5*a(n-2)
    

Formula

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

A287805 Number of quinary sequences of length n such that no two consecutive terms have distance 2.

Original entry on oeis.org

1, 5, 19, 73, 281, 1083, 4175, 16097, 62065, 239307, 922711, 3557761, 13717913, 52893147, 203943935, 786361409, 3032030689, 11690820555, 45077144455, 173807214241, 670161078089, 2583988659867, 9963272432111, 38416111919777, 148123788152017, 571131629935179
Offset: 0

Views

Author

David Nacin, Jun 01 2017

Keywords

Examples

			For n=2 the a(2)=19=25-6 sequences contain every combination except these six: 02,20,13,31,24,42.
		

Crossrefs

Programs

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

Formula

For n>0, a(n) = 4*a(n-1) + a(n-2) - 6*a(n-3), a(1)=5, a(2)=19, a(3)=73.
G.f.: (1 + x - 2*x^2 - 2*x^3)/(1 - 4*x - x^2 + 6*x^3).

A287806 Number of senary sequences of length n such that no two consecutive terms have distance 1.

Original entry on oeis.org

1, 6, 26, 114, 500, 2194, 9628, 42252, 185422, 813722, 3571010, 15671340, 68773514, 301811860, 1324498252, 5812546998, 25508302906, 111942925778, 491260382084, 2155891150146, 9461106209228, 41519967599596, 182209952129086, 799626506818554, 3509152727035810
Offset: 0

Views

Author

David Nacin, Jun 01 2017

Keywords

Examples

			For n=2 the a(2)=26=36-10 sequences contain every combination except these ten: 01,10,12,21,23,32,34,43,45,54.
		

Crossrefs

Programs

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

Formula

For n>3, a(n) = 5*a(n-1) - 2*a(n-2) - 3*a(n-3), a(1)=6, a(2)=26, a(3)=114.
G.f.: (1 + x - 2*x^2 - x^3)/(1 - 5*x + 2*x^2 + 3*x^3).

A287807 Number of senary sequences of length n such that no two consecutive terms have distance 2.

Original entry on oeis.org

1, 6, 28, 132, 624, 2952, 13968, 66096, 312768, 1480032, 7003584, 33141312, 156826368, 742110336, 3511703808, 16617560832, 78635142144, 372105487872, 1760822074368, 8332299518976, 39428864667648, 186579390892032, 882903157346304, 4177942598725632
Offset: 0

Views

Author

David Nacin, Jun 01 2017

Keywords

Examples

			For n=2 the a(2)=28=36-8 sequences contain every combination except these eight: 02,20,13,31,24,42,35,53.
		

Crossrefs

Programs

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

Formula

For n>2, a(n) = 6*a(n-1) - 6*a(n-2), a(1)=6, a(2)=28.
G.f.: (1 - 2*x^2)/(1 - 6*x + 6*x^2).

A287808 Number of septenary sequences of length n such that no two consecutive terms have distance 1.

Original entry on oeis.org

1, 7, 37, 197, 1049, 5587, 29757, 158491, 844153, 4496123, 23947233, 127547675, 679344041, 3618320227, 19271886609, 102645866251, 546712113769, 2911896468083, 15509334488577, 82605772190267, 439974623297369, 2343391557436483, 12481365289466289
Offset: 0

Views

Author

David Nacin, Jun 01 2017

Keywords

Examples

			For n=2 the a(2)=37=49-12 sequences contain every combination except these twelve: 01,10,12,21,23,32,34,43,45,54,56,65.
		

Crossrefs

Programs

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

Formula

For n>4, a(n) = 7*a(n-1) - 8*a(n-2) - 6*a(n-3) + 6*a(n-4), a(1)=7, a(2)=37, a(3)=197, a(4)=1049.
G.f.: (1-4*x^2+2*x^4)/(1-7*x+8*x^2+6*x^3-6*x^4).
Showing 1-10 of 30 results. Next