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 10 results.

A164001 Spiral of triangles around a hexagon.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 9, 12, 16, 21, 28, 37, 49, 65, 86, 114, 151, 200, 265, 351, 465, 616, 816, 1081, 1432, 1897, 2513, 3329, 4410, 5842, 7739, 10252, 13581, 17991, 23833, 31572, 41824, 55405, 73396, 97229, 128801, 170625, 226030, 299426
Offset: 1

Views

Author

Omar E. Pol, Oct 27 2009

Keywords

Comments

a(n) is the side length of the n-th triangle in a spiral around a hexagon with side length = 1.
Sequence very similar to A134816, but without repeated terms. Records in A134816. Also records in A000931, the Padovan sequence.
Column k=2 of A242464 (with offset 0). - Alois P. Heinz, May 19 2014
a(n) is the number of bitstrings of length n-1 without two consecutive 0's or three consecutive 1's. - Zachary Stier, Mar 16 2021

Crossrefs

The following are basically all variants of the same sequence: A000931, A078027, A096231, A124745, A133034, A134816, A164001, A182097, A228361 and probably A020720. However, each one has its own special features and deserves its own entry.
Cf. A060006.

Programs

  • Mathematica
    LinearRecurrence[{0,1,1},{1,2,3,4},50] (* Harvey P. Dale, Jul 08 2017 *)

Formula

If n < 5 then a(n) = n, otherwise a(n) = a(n-2) + a(n-3).
G.f.: -x - 1 + (-x^2 - 2*x - 1)/(-1 + x^2 + x^3). a(n) = A000931(n+4) + A000931(n+5) = A000931(n+7), n > 1. - R. J. Mathar, Oct 29 2009
a(n) ~ 1.67873... * 1.32471...^(n-1) where 1.32471... is the real root of x^3 - x - 1 = 0 (see A060006), and 1.67873... is the real root of 23*x^3 - 46*x^2 + 13*x - 1 = 0. - Ricardo Bittencourt, May 14 2023

A242452 Number of length n words on {1,2,3} with no more than one consecutive 1 and no more than two consecutive 2's and no more than three consecutive 3's.

Original entry on oeis.org

1, 3, 8, 21, 54, 140, 362, 937, 2425, 6275, 16239, 42024, 108751, 281430, 728295, 1884709, 4877320, 12621710, 32662931, 84526348, 218740428, 566064618, 1464883079, 3790878933, 9810177543, 25387142435, 65697791726, 170015189725, 439971633412, 1138574962157
Offset: 0

Views

Author

Geoffrey Critzer and Alois P. Heinz, May 14 2014

Keywords

Examples

			a(3) = 21 because there are 27 length 3 words on {1,2,3} but we don't count: 111, 112, 113, 211, 222, 311.
		

Crossrefs

Cf. A000931 (binary words with at most one consecutive 1 and two consecutive 2's; offset=-8 for n>0).
Cf. A007283 (ternary words with no consecutive like letters).
Column k=3 of A242464.

Programs

  • Mathematica
    nn=20;CoefficientList[Series[1/(1-Sum[v[i]/(1+v[i])/.v[i]->(z-z^(i+1))/(1-z),{i,1,3}]),{z,0,nn}],z]
    (* replacing the 3 in this code with a positive integer k will return the number of words on {1,2,...,k} with no more than one consecutive 1 and no more than two consecutive 2's and ... no more than k consecutive k's *)

Formula

G.f.: (1 + x)*(1 + x^2)*(1 + x + x^2)/(1 - x - 2*x^2 - 4*x^3 - 3*x^4 - 2*x^5).

A242495 Number of length n words on {1,2,3,4} with at most one consecutive 1 and at most two consecutive 2's and at most three consecutive 3's and at most four consecutive 4's.

Original entry on oeis.org

1, 4, 15, 56, 208, 773, 2872, 10672, 39655, 147350, 547523, 2034486, 7559742, 28090486, 104378617, 387850022, 1441172953, 5355109869, 19898515060, 73938894118, 274742112508, 1020886629235, 3793410119173, 14095551768590
Offset: 0

Views

Author

Geoffrey Critzer, May 16 2014

Keywords

Comments

Column k=4 of A242464.

Examples

			a(3) = 56 because there are 64 length 3 words on {1,2,3,4} but we don't count 111, 112, 113, 114, 211, 222, 311, or 411.
		

Crossrefs

Cf. A242452.

Programs

  • Mathematica
    nn=23;CoefficientList[Series[1/(1-Sum[v[i]/(1+v[i])/.v[i]->(z-z^(i+1))/(1-z),{i,1,4}]),{z,0,nn}],z]

Formula

G.f.: (1 + x)*(1 + x^2)*(1 + x + x^2 )*(1 + x + x^2 + x^3 + x^4)/(1 - x - 5*x^2 - 12*x^3 - 18*x^4 - 22*x^5 - 20*x^6 - 15*x^7 - 8*x^8 - 3*x^9). (corrected by Fung Lam, May 18 2014)

A242509 Number of n-length words on {1,2,3,4,5} that contain at most one consecutive 1 and at most two consecutive 2's and at most three consecutive 3's and at most four consecutive 4's and at most five consecutive 5's.

Original entry on oeis.org

1, 5, 24, 115, 550, 2631, 12584, 60191, 287901, 1377066, 6586677, 31504891, 150691790, 720777469, 3447567781, 16490143094, 78874393932, 377265981421, 1804509849677, 8631193794141, 41284067429916, 197466800561799, 944508129929499, 4517699202928696
Offset: 0

Views

Author

Geoffrey Critzer and Alois P. Heinz, May 16 2014

Keywords

Comments

Column k=5 of A242464.

Crossrefs

Programs

  • Mathematica
    nn=23;CoefficientList[Series[1/(1-Sum[v[i]/(1+v[i])/.v[i]->(z-z^(i+1))/(1-z),{i,1,5}]),{z,0,nn}],z]
    LinearRecurrence[{3,5,12,17,24,24,25,19,14,7,4},{1,5,24,115,550,2631,12584,60191,287901,1377066,6586677,31504891},30] (* Harvey P. Dale, Apr 13 2019 *)

Formula

G.f.: (1 + x)*(1 +x^2)*(1 - x + x^2)*(1 + x + x^2)*(1 + x + x^2 + x^3 + x^4)/(1 - 3*x - 5*x^2 - 12*x^3 - 17*x^4 - 24*x^5 - 24*x^6 - 25*x^7 - 19*x^8 - 14*x^9 - 7*x^10 - 4*x^11).

A242629 Number of n-length words w over a 6-ary alphabet {a_1,...,a_6} such that w contains never more than j consecutive letters a_j (for 1<=j<=6).

Original entry on oeis.org

1, 6, 35, 204, 1188, 6919, 40295, 234672, 1366694, 7959418, 46354440, 269961210, 1572213035, 9156329637, 53325071447, 310557107219, 1808637367513, 10533228997581, 61343923944270, 357257684774972, 2080614429665859, 12117182049311250, 70568625653399251
Offset: 0

Views

Author

Geoffrey Critzer and Alois P. Heinz, May 19 2014

Keywords

Crossrefs

Column k=6 of A242464.

Programs

  • Maple
    b:= proc(n, k, c, t) option remember;
          `if`(n=0, 1, add(`if`(c=t and j=c, 0,
           b(n-1, k, j, 1+`if`(j=c, t, 0))), j=1..k))
        end:
    a:= n-> b(n, 6, 0$2):
    seq(a(n), n=0..30);

Formula

G.f.: -(x^6+x^5+x^4+x^3+x^2+x+1) *(x+1)*(x^2-x+1) *(x^2+x+1) *(x^4+x^3+x^2+x+1) *(x^2+1) / (5*x^17 +14*x^16 +32*x^15 +57*x^14 +90*x^13 +123*x^12 +155*x^11 +174*x^10 +181*x^9 +170*x^8 +148*x^7 +114*x^6 +81*x^5 +49*x^4 +26*x^3 +10*x^2 +3*x-1).

A242630 Number of n-length words w over a 7-ary alphabet {a_1,...,a_7} such that w contains never more than j consecutive letters a_j (for 1<=j<=7).

Original entry on oeis.org

1, 7, 48, 329, 2254, 15443, 105804, 724892, 4966431, 34026362, 233123809, 1597194268, 10942809918, 74972150416, 513654479985, 3519185768909, 24110893526041, 165190252745398, 1131763100053353, 7754015102916294, 53124854674462893, 363972747889200054
Offset: 0

Views

Author

Geoffrey Critzer and Alois P. Heinz, May 19 2014

Keywords

Crossrefs

Column k=7 of A242464.

Formula

G.f.: -(x+1) *(x^2+1) *(x^4+1) *(x^6+x^5+x^4+x^3+x^2+x+1) *(x^2+x+1) *(x^2-x+1) *(x^4+x^3+x^2+x+1) / (6*x^21 +17*x^20 +39*x^19 +70*x^18 +117*x^17 +170*x^16 +233*x^15 +289*x^14 +340*x^13 +369*x^12 +382*x^11 +364*x^10 +331*x^9 +277*x^8 +220*x^7 +157*x^6 +106*x^5 +61*x^4 +33*x^3 +13*x^2 +4*x-1).

A242631 Number of n-length words w over an 8-ary alphabet {a_1,...,a_8} such that w contains never more than j consecutive letters a_j (for 1<=j<=8).

Original entry on oeis.org

1, 8, 63, 496, 3904, 30729, 241871, 1903792, 14984945, 117948062, 928381475, 7307387240, 57517205708, 452723914009, 3563437058402, 28048184061555, 220770176730345, 1737705044525640, 13677657310833723, 107658264618591797, 847389408675004032, 6669890253930098674
Offset: 0

Views

Author

Geoffrey Critzer and Alois P. Heinz, May 19 2014

Keywords

Crossrefs

Column k=8 of A242464.

Programs

  • Maple
    b:= proc(n, k, c, t) option remember;
          `if`(n=0, 1, add(`if`(c=t and j=c, 0,
           b(n-1, k, j, 1+`if`(j=c, t, 0))), j=1..k))
        end:
    a:= n-> b(n, 8, 0$2):
    seq(a(n), n=0..30);

Formula

G.f.: -(x^2+x+1) *(x^6+x^3+1) *(x+1) *(x^2+1) *(x^4+1) *(x^6+x^5+x^4+x^3+x^2+x+1) *(x^2-x+1) *(x^4+x^3+x^2+x+1) / (7*x^27 +20*x^26 +46*x^25 +90*x^24 +159*x^23 +249*x^22 +369*x^21 +507*x^20 +659*x^19 +809*x^18 +950*x^17 +1056*x^16 +1128*x^15 +1148*x^14 +1119*x^13 +1039*x^12 +927*x^11 +782*x^10 +631*x^9 +480*x^8 +345*x^7 +229*x^6 +144*x^5 +79*x^4 +39*x^3 +16*x^2 +5*x-1).

A242632 Number of n-length words w over a 9-ary alphabet {a_1,...,a_9} such that w contains never more than j consecutive letters a_j (for 1<=j<=9).

Original entry on oeis.org

1, 9, 80, 711, 6318, 56143, 498896, 4433274, 39394819, 350068993, 3110771999, 27642843622, 245638961566, 2182789161071, 19396631915857, 172361736254288, 1531635402139359, 13610370004776711, 120944038906506659, 1074729088326395697, 9550223588843166996
Offset: 0

Views

Author

Geoffrey Critzer and Alois P. Heinz, May 19 2014

Keywords

Crossrefs

Column k=9 of A242464.

Programs

  • Maple
    b:= proc(n, k, c, t) option remember;
          `if`(n=0, 1, add(`if`(c=t and j=c, 0,
           b(n-1, k, j, 1+`if`(j=c, t, 0))), j=1..k))
        end:
    a:= n-> b(n, 9, 0$2):
    seq(a(n), n=0..30);

Formula

G.f.: -(x+1) *(x^4-x^3+x^2-x+1) *(x^4+x^3+x^2+x+1) *(x^2+x+1) *(x^6+x^3+1) *(x^2+1)*(x^4+1) *(x^6+x^5+x^4+x^3+x^2+x+1) *(x^2-x+1) / (8*x^31 +15*x^30 +38*x^29 +66*x^28 +118*x^27 +179*x^26 +273*x^25 +371*x^24 +503*x^23 +628*x^22 +775*x^21 +895*x^20 +1023*x^19 +1099*x^18 +1167*x^17 +1172*x^16 +1161*x^15 +1087*x^14 +1007*x^13 +875*x^12 +754*x^11 +606*x^10 +483*x^9 +352*x^8 +258*x^7 +166*x^6 +109*x^5 +59*x^4 +34*x^3 +12*x^2 +7*x-1).

A242633 Number of n-length words w over a 10-ary alphabet {a_1,...,a_10} such that w contains never more than j consecutive letters a_j (for 1<=j<=10).

Original entry on oeis.org

1, 10, 99, 980, 9700, 96011, 950319, 9406280, 93103581, 921541438, 9121438862, 90284216730, 893635304019, 8845223290551, 87550228496839, 866574224082841, 8577372083864876, 84899030943287514, 840332608243515705, 8317631952113371291, 82328117000511661919
Offset: 0

Views

Author

Alois P. Heinz, May 19 2014

Keywords

Crossrefs

Column k=10 of A242464.

Programs

  • Maple
    b:= proc(n, k, c, t) option remember;
          `if`(n=0, 1, add(`if`(c=t and j=c, 0,
           b(n-1, k, j, 1+`if`(j=c, t, 0))), j=1..k))
        end:
    a:= n-> b(n, 10, 0$2):
    seq(a(n), n=0..30);

Formula

G.f.: -(x^10+x^9+x^8+x^7+x^6+x^5+x^4+x^3+x^2+x+1) *(x+1)*(x^4-x^3+x^2-x+1)*(x^4+x^3+x^2+x+1) *(x^2+x+1) *(x^6+x^3+1) *(x^2+1) *(x^4+1) *(x^6+x^5+x^4+x^3+x^2+x+1) *(x^2-x+1) / (9*x^41 +26*x^40 +69*x^39 +144*x^38 +278*x^37 +482*x^36 +793*x^35 +1217*x^34 +1792*x^33 +2512*x^32 +3400*x^31 +4420*x^30 +5578*x^29 +6801*x^28 +8069*x^27 +9287*x^26 +10420*x^25 +11364*x^24 +12099*x^23 +12534*x^22 +12681*x^21 +12491*x^20 +12016*x^19 +11246*x^18 +10275*x^17 +9123*x^16 +7896*x^15 +6627*x^14 +5412*x^13 +4267*x^12 +3266*x^11 +2398*x^10 +1700*x^9 +1145*x^8 +740*x^7 +444*x^6 +253*x^5 +128*x^4 +60*x^3 +21*x^2 +7*x-1).

A242635 Number of n-length words w over an n-ary alphabet {a_1,...,a_n} such that w contains never more than j consecutive letters a_j for 1<=j<=n.

Original entry on oeis.org

1, 1, 3, 21, 208, 2631, 40295, 724892, 14984945, 350068993, 9121438862, 262285777567, 8250643190038, 281849526767134, 10390959086757005, 411219228179234026, 17387847546353549435, 782342249208357483984, 37321230268969840324231, 1881590248383756833279387
Offset: 0

Views

Author

Geoffrey Critzer and Alois P. Heinz, May 19 2014

Keywords

Crossrefs

Main diagonal of A242464.

Programs

  • Maple
    a:= proc(n) option remember; local v;
          v:= i-> (x-x^(i+1))/(1-x);
          coeff(series(1/(1-add(v(i)/(1+v(i)), i=1..n)), x, n+1), x, n)
        end:
    seq(a(n), n=0..25);
  • Mathematica
    b[n_, k_, c_, t_] := b[n, k, c, t] = If[n == 0, 1, Sum[If[c == t && j == c, 0, b[n - 1, k, j, 1 + If[j == c, t, 0]]], {j, 1, k}]];
    a[n_] := b[n, n, 0, 0];
    a /@ Range[0, 25] (* Jean-François Alcover, Dec 28 2020, from Maple code of A242464 *)

Formula

a(n) = [x^n] 1/(1-Sum_{i=1..n} v(i)/(1+v(i))) with v(i) = (x-x^(i+1))/(1-x).
a(n) ~ n^n. - Vaclav Kotesovec, Aug 27 2014
Showing 1-10 of 10 results.