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 16 results. Next

A136175 Tribonacci array, T(n,k).

Original entry on oeis.org

1, 2, 3, 4, 6, 5, 7, 11, 9, 8, 13, 20, 17, 15, 10, 24, 37, 31, 28, 19, 12, 44, 68, 57, 51, 35, 22, 14, 81, 125, 105, 94, 64, 41, 26, 16, 149, 230, 193, 173, 118, 75, 48, 30, 18, 274, 423, 355, 318, 217, 138, 88, 55, 33, 21, 504, 778, 653, 585, 399, 254, 162, 101, 61, 39, 23
Offset: 1

Views

Author

Clark Kimberling, Dec 18 2007

Keywords

Comments

As an interspersion (and dispersion), the array is, as a sequence, a permutation of the positive integers. Column k consists of the numbers m such that the least summand in the tribonacci representation of m is T(1,k). For example, column 1 consists of numbers with least summand 1. This array arises from tribonacci representations in much the same way that the Wythoff array, A035513, arises from Fibonacci (or Zeckendorf) representations.
From Abel Amene, Jul 29 2012: (Start)
(Row 1) = A000073 (offset=4) a(0)=0, a(1)=0, a(2)=1
(Row 2) = A001590 (offset=5) a(0)=0, a(1)=1, a(2)=0
(Row 3) = A000213 (offset=4) a(0)=1, a(1)=1, a(2)=1
(Row 4) = A214899 (offset=5) a(0)=2, a(1)=1, a(2)=2
(Row 5) = A020992 (offset=6) a(0)=0, a(1)=2, a(2)=1
(Row 6) = A100683 (offset=6) a(0)=-1,a(1)=2, a(2)=2
(Row 7) = A135491 (offset=4) a(0)=2, a(1)=4, a(2)=8
(Row 8) = A214727 (offset=6) a(0)=1, a(1)=1, a(2)=2
(Row 9) = A081172 (offset=8) a(0)=1, a(1)=1, a(2)=0
(column 1) = A003265
(column 2) = A353083
(End) [Corrected and extended by John Keith, May 09 2022]

Examples

			Northwest corner:
1  2   4   7   13  24   44   81  149 274 504
3  6   11  20  37  68   125  230 423 778
5  9   17  31  57  105  193  355 653
8  15  28  51  94  173  318  585
10 19  35  64  118 217  399
12 22  41  75  138 254
14 26  48  88  162
16 30  55 101
18 33  61
21 39
23
		

Crossrefs

Programs

  • Maple
    # maximum index in A73 such that A73 <= n.
    A73floorIdx := proc(n)
        local k ;
        for k from 3 do
            if A000073(k) = n then
                return k ;
            elif A000073(k) > n then
                return k -1 ;
            end if ;
        end do:
    end proc:
    # tribonacci expansion coeffs of n
    A278038 := proc(n)
        local k,L,nres ;
        k := A73floorIdx(n) ;
        L := [1] ;
        nres := n-A000073(k) ;
        while k >= 4 do
            k := k-1 ;
            if nres >= A000073(k) then
                L := [1,op(L)] ;
                nres := nres-A000073(k) ;
            else
                L := [0,op(L)] ;
            end if ;
        end do:
        return L ;
    end proc:
    A278038inv := proc(L)
        add( A000073(i+2)*op(i,L),i=1..nops(L)) ;
    end proc:
    A135175 := proc(n,k)
        option remember ;
        local a,known,prev,nprev,kprev,freb ;
        if n =1 then
            A000073(k+2) ;
        elif k>3 then
            procname(n,k-1)+procname(n,k-2)+procname(n,k-3) ;
        else
            if k = 1 then
                for a from 1 do
                    known := false ;
                    for nprev from 1 to n-1 do
                        for kprev from 1 do
                            if procname(nprev,kprev) > a then
                                break ;
                            elif procname(nprev,kprev) = a then
                                known := true ;
                            end if;
                        end do:
                    end do:
                    if not known then
                        return a ;
                    end if;
                end do:
            else
                prev := procname(n,k-1) ;
                freb := A278038(prev) ;
                return A278038inv([0,op(freb)]) ;
            end if;
        end if;
    end proc:
    seq(seq(A135175(n,d-n),n=1..d-1),d=2..12) ; # R. J. Mathar, Jun 07 2022

Formula

T(1,1)=1, T(1,2)=2, T(1,3)=4, T(1,k)=T(1,k-1)+T(1,k-2)+T(1,k-3) for k>3. Row 1 is the tribonacci basis; write B(k)=T(1,k). Each row satisfies the recurrence T(n,k)=T(n,k-1)+T(n,k-2)+T(n,k-3). T(n,1) is least number not in an earlier row. If T(n,1) has tribonacci representation B(k(1))+B(k(2))+...+B(k(m)), then T(n,2) = B(k(2))+B(k(3))+...+B(k(m+1)) and T(n,3) = B(k(3))+B(k(4))+...+B(k(m+2)). (Continued shifting of indices gives the other terms in row n, also.)

Extensions

T(3, 4) corrected and more terms by John Keith, May 09 2022

A232376 T(n,k)=Number of nXk 0..3 arrays with every 0 next to a 1, every 1 next to a 2 and every 2 next to a 3 horizontally, diagonally or antidiagonally, and no adjacent values equal.

Original entry on oeis.org

1, 2, 1, 4, 14, 1, 8, 74, 58, 1, 14, 296, 586, 230, 1, 26, 1130, 4404, 4550, 934, 1, 48, 4682, 32722, 63744, 36574, 3794, 1, 88, 19448, 259458, 927706, 957232, 292122, 15354, 1, 162, 79592, 2046700, 14326374, 27133338, 14297980, 2324142, 62266, 1, 298, 326810
Offset: 1

Views

Author

R. H. Hardin, Nov 23 2013

Keywords

Comments

Table starts
.1.......2..........4............8..............14.................26
.1......14.........74..........296............1130...............4682
.1......58........586.........4404...........32722.............259458
.1.....230.......4550........63744..........927706...........14326374
.1.....934......36574.......957232........27133338..........825606450
.1....3794.....292122.....14297980.......789866870........47301712998
.1...15354....2324142....213082596.....22946925502......2706080691402
.1...62266...18574882...3180405572....667514680522....154987416800398
.1..252346..148225606..47457708756..19413840326186...8875595994390694
.1.1022806.1182879814.708101568772.564595278464614.508249649361525870

Examples

			Some solutions for n=4 k=4
..0..1..2..1....2..1..2..1....2..3..2..3....2..1..0..3....3..2..0..2
..0..3..0..1....0..3..2..1....1..0..1..0....2..3..0..3....3..1..3..2
..2..1..0..3....2..3..2..1....1..2..3..0....2..3..0..3....2..1..0..1
..3..1..2..3....2..3..2..3....1..2..1..2....0..1..2..1....0..3..2..3
		

Crossrefs

Row 1 is A135491(n-1)

Formula

Empirical for column k:
k=1: a(n) = a(n-1)
k=2: a(n) = 2*a(n-1) +7*a(n-2) +6*a(n-3) -2*a(n-4) -3*a(n-5) +2*a(n-6) +a(n-7)
k=3: [order 15]
k=4: [order 22]
k=5: [order 64]
Empirical for row n:
n=1: a(n) = a(n-1) +a(n-2) +a(n-3) for n>4
n=2: [order 8] for n>9
n=3: [order 13] for n>14
n=4: [order 60] for n>61

A249290 T(n,k) = Number of length n+3 0..k arrays with no four consecutive terms having the sum of any three elements equal to three times the fourth.

Original entry on oeis.org

14, 66, 26, 204, 168, 48, 524, 660, 428, 88, 1098, 2228, 2144, 1094, 162, 2070, 5646, 9504, 6960, 2792, 298, 3584, 12600, 29100, 40588, 22572, 7132, 548, 5808, 25280, 76856, 150112, 173368, 73204, 18232, 1008, 8934, 46608, 178644, 469072, 774542
Offset: 1

Views

Author

R. H. Hardin, Oct 24 2014

Keywords

Comments

Table starts
...14.....66.....204.......524.......1098........2070.........3584.........5808
...26....168.....660......2228.......5646.......12600........25280........46608
...48....428....2144......9504......29100.......76856.......178644.......374540
...88...1094....6960.....40588.....150112......469072......1263044......3011088
..162...2792...22572....173368.....774542.....2863158......8930228.....24208540
..298...7132...73204....740616....3996816....17477172.....63142432....194636612
..548..18232..237480...3164312...20626236...106687006....446465388...1564897170
.1008..46616..770416..13520668..106449362...651265876...3156873140..12581992958
.1854.119176.2499164..57772560..549377682..3975630136..22321652802.101161030608
.3410.304696.8107012.246857788.2835311880.24269116850.157832259724.813349549954

Examples

			Some solutions for n=4, k=4
..3....4....1....4....3....0....4....2....3....1....1....3....0....0....3....1
..2....0....4....1....2....1....4....3....0....1....0....2....3....2....2....0
..0....3....0....1....4....4....2....3....4....0....4....0....0....0....4....4
..2....3....4....4....4....1....3....2....4....0....3....2....4....0....0....4
..1....1....3....0....1....4....0....1....2....4....3....2....0....2....4....3
..0....4....2....4....4....4....1....4....0....1....3....0....1....1....0....0
..3....0....2....0....2....4....4....4....0....4....4....2....0....2....0....0
		

Crossrefs

Column 1 is A135491(n+3).

Formula

Empirical for column k:
k=1: a(n) = a(n-1) +a(n-2) +a(n-3)
k=2: [order 12]
k=3: [order 8]
k=4: [order 40]
k=5: [order 87]
Empirical for row n:
n=1: a(n) = 3*a(n-1) -2*a(n-2) -a(n-3) +a(n-5) +2*a(n-6) -3*a(n-7) +a(n-8); also a polynomial of degree 4 plus a constant quasipolynomial with period 6
n=2: [order 32; also a polynomial of degree 5 plus a linear quasipolynomial with period 360]

A245950 T(n,k)=Number of length n+3 0..k arrays with some pair in every consecutive four terms totalling exactly k.

Original entry on oeis.org

14, 71, 26, 196, 197, 48, 453, 676, 545, 88, 834, 1889, 2304, 1501, 162, 1435, 3966, 7769, 7744, 4145, 298, 2216, 7669, 18384, 31465, 26244, 11441, 548, 3305, 13064, 39721, 82968, 128649, 88804, 31577, 1008, 4630, 21281, 73728, 199141, 381222
Offset: 1

Views

Author

R. H. Hardin, Aug 08 2014

Keywords

Comments

Table starts
...14.....71......196.......453.......834.......1435........2216........3305
...26....197......676......1889......3966.......7669.......13064.......21281
...48....545.....2304......7769.....18384......39721.......73728......130193
...88...1501.....7744.....31465.....82968.....199141......397504......754321
..162...4145....26244....128649....381222....1021225.....2217096.....4555697
..298..11441....88804....525041...1744494....5208673....12257032....27206945
..548..31577...300304...2141609...7972932...26526337....67596992...161991665
.1008..87161..1016064...8740385..36489120..135336793...373997376...968575361
.1854.240581..3437316..35666177.166920402..690045061..2066660136..5781493025
.3410.664051.11628100.145538749.763564758.3518298991.11420014856.34510470937

Examples

			Some solutions for n=4 k=4
..1....4....0....2....1....3....3....0....3....2....0....4....0....3....2....2
..3....2....1....1....4....2....1....4....0....4....1....0....4....4....0....2
..3....2....4....3....0....2....1....1....4....1....4....3....4....2....2....2
..2....1....2....0....0....0....4....0....3....3....3....1....3....1....2....0
..1....3....0....1....3....4....3....2....2....2....0....1....0....0....2....4
..3....4....3....0....1....2....1....3....0....1....1....4....2....3....1....1
..1....2....1....4....0....3....1....2....1....4....1....0....1....1....1....4
		

Crossrefs

Column 1 is A135491(n+3)
Column 3 is A203536(n+5)

Formula

Empirical for column k:
k=1: a(n) = a(n-1) +a(n-2) +a(n-3)
k=2: a(n) = 2*a(n-1) +2*a(n-2) +a(n-3) -a(n-4) -2*a(n-5) -2*a(n-6) -a(n-7) +a(n-8) +a(n-9)
k=3: a(n) = 2*a(n-1) +3*a(n-2) +6*a(n-3) -a(n-4) -a(n-6)
k=4: [order 15]
k=5: a(n) = 3*a(n-1) +5*a(n-2) +13*a(n-3) -13*a(n-4) -a(n-5) -3*a(n-6) +a(n-7)
k=6: [order 16]
k=7: a(n) = 3*a(n-1) +9*a(n-2) +31*a(n-3) -19*a(n-4) -3*a(n-5) -5*a(n-6) +a(n-7)
k=8: [order 16]
k=9: a(n) = 3*a(n-1) +13*a(n-2) +57*a(n-3) -25*a(n-4) -5*a(n-5) -7*a(n-6) +a(n-7)
Empirical for row n:
n=1: a(n) = 2*a(n-1) +a(n-2) -4*a(n-3) +a(n-4) +2*a(n-5) -a(n-6)
n=2: a(n) = 2*a(n-1) +2*a(n-2) -6*a(n-3) +6*a(n-5) -2*a(n-6) -2*a(n-7) +a(n-8)
n=3: a(n) = 3*a(n-1) -8*a(n-3) +6*a(n-4) +6*a(n-5) -8*a(n-6) +3*a(n-8) -a(n-9)
n=4: [order 10]
n=5: [order 12]
n=6: [order 13]
n=7: [order 14]

A135492 Number of ways to toss a coin n times and not get a run of five.

Original entry on oeis.org

1, 2, 4, 8, 16, 30, 58, 112, 216, 416, 802, 1546, 2980, 5744, 11072, 21342, 41138, 79296, 152848, 294624, 567906, 1094674, 2110052, 4067256, 7839888, 15111870, 29129066, 56148080, 108228904, 208617920, 402123970, 775118874, 1494089668, 2879950432
Offset: 0

Views

Author

James R FitzSimons (cherry(AT)getnet.net), Feb 07 2008

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := a[n] = a[n - 1] + a[n - 2] + a[n - 3] + a[n - 4]; a[1] = 2; a[2] = 4; a[3] = 8; a[4] = 16; Array[a, 33] (* Robert G. Wilson v, Feb 10 2008 *)
    LinearRecurrence[{1, 1, 1, 1}, {2, 4, 8, 16}, 25] (* G. C. Greubel, Oct 15 2016 *)
  • PARI
    a(n)=([0,1,0,0; 0,0,1,0; 0,0,0,1; 1,1,1,1]^(n-1)*[2;4;8;16])[1,1] \\ Charles R Greathouse IV, Oct 17 2016

Formula

a(n) = a(n-1) + a(n-2) + a(n-3) + a(n-4).
a(n) = 2*A000078(n+3) for n>=1.
G.f.: 1-2*x*(x+1)*(1+x^2)/(x^4+x^3+x^2+x-1). - Colin Barker, Jun 12 2012

Extensions

Corrected and extended by Robert G. Wilson v, Feb 10 2008
a(0)=1 prepended by Alois P. Heinz, May 22 2025

A232161 T(n,k)=Number of nXk 0..3 arrays with every 0 next to a 1, every 1 next to a 2 and every 2 next to a 3 horizontally, vertically or antidiagonally, and no adjacent values equal.

Original entry on oeis.org

1, 2, 2, 4, 18, 4, 8, 62, 62, 8, 14, 218, 290, 218, 14, 26, 746, 1284, 1284, 746, 26, 48, 2600, 5902, 7770, 5902, 2600, 48, 88, 9004, 27086, 46702, 46702, 27086, 9004, 88, 162, 31262, 124436, 286770, 382996, 286770, 124436, 31262, 162, 298, 108492, 572080
Offset: 1

Views

Author

R. H. Hardin, Nov 19 2013

Keywords

Comments

Table starts
...1......2........4.........8..........14...........26.............48
...2.....18.......62.......218.........746.........2600...........9004
...4.....62......290......1284........5902........27086.........124436
...8....218.....1284......7770.......46702.......286770........1767266
..14....746.....5902.....46702......382996......3183932.......26694774
..26...2600....27086....286770.....3183932.....36275078......415332300
..48...9004...124436...1767266....26694774....415332300.....6564512068
..88..31262...572080..10830650...223026806...4764939084...103384156384
.162.108492..2629946..66701686..1869037596..54785401618..1636124088162
.298.376566.12090710.410364610.15673051556.629979277720.25973583237174

Examples

			Some solutions for n=4 k=4
..3..0..2..3....1..3..2..0....2..3..1..2....3..1..2..3....1..0..3..0
..2..1..0..1....2..0..1..2....1..2..0..3....2..0..1..2....2..1..2..1
..0..2..3..2....3..2..0..3....0..3..1..2....1..3..0..1....3..0..3..2
..3..0..1..3....1..3..2..1....2..0..3..1....2..1..2..3....1..2..0..1
		

Crossrefs

Column 1 is A135491(n-1)

Formula

Empirical for column k:
k=1: a(n) = a(n-1) +a(n-2) +a(n-3) for n>4
k=2: [order 10] for n>11
k=3: [order 30] for n>33
k=4: [order 94] for n>97

A135493 Number of ways to toss a coin n times and not get a run of six.

Original entry on oeis.org

1, 2, 4, 8, 16, 32, 62, 122, 240, 472, 928, 1824, 3586, 7050, 13860, 27248, 53568, 105312, 207038, 407026, 800192, 1573136, 3092704, 6080096, 11953154, 23499282, 46198372, 90823608, 178554512, 351028928, 690104702, 1356710122, 2667221872
Offset: 0

Views

Author

James R FitzSimons (cherry(AT)getnet.net), Feb 07 2008

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := a[n] = a[n - 1] + a[n - 2] + a[n - 3] + a[n - 4] + a[n - 5]; a[1] = 2; a[2] = 4; a[3] = 8; a[4] = 16; a[5] = 32; Array[a, 33] (* Robert G. Wilson v, Feb 10 2008 *)
    LinearRecurrence[{1, 1, 1, 1, 1}, {2, 4, 8, 16, 32}, 25] (* G. C. Greubel, Oct 15 2016 *)

Formula

a(n) = a(n-1) + a(n-2) + a(n-3) + a(n-4) + a(n-5).
From R. J. Mathar, Feb 10 2008: (Start)
O.g.f.: -1 - 2/(-1+x+x^2+x^3+x^4+x^5).
a(n) = 2*A001591(n+4) for n>=1. (End)

Extensions

More terms from Robert G. Wilson v, Feb 10 2008
a(0)=1 prepended by Alois P. Heinz, May 22 2025

A265624 Array T(n,k): The number of words of length n in an alphabet of size k which do not contain 4 consecutive letters.

Original entry on oeis.org

1, 1, 2, 1, 4, 3, 0, 8, 9, 4, 0, 14, 27, 16, 5, 0, 26, 78, 64, 25, 6, 0, 48, 228, 252, 125, 36, 7, 0, 88, 666, 996, 620, 216, 49, 8, 0, 162, 1944, 3936, 3080, 1290, 343, 64, 9, 0, 298, 5676, 15552, 15300, 7710, 2394, 512, 81, 10, 0, 548, 16572, 61452
Offset: 1

Views

Author

R. J. Mathar, Dec 10 2015

Keywords

Examples

			  1    2      3      4      5       6       7        8
  1    4      9     16     25      36      49       64
  1    8     27     64    125     216     343      512
  0   14     78    252    620    1290    2394     4088
  0   26    228    996   3080    7710   16716    32648
  0   48    666   3936  15300   46080  116718   260736
  0   88   1944  15552  76000  275400  814968  2082304
  0  162   5676  61452 377520 1645950 5690412 16629816
		

Crossrefs

Cf. A135491 (column k=2), A181137 (k=3), A188714 (k=4), A265583 (not 2 consecutive letters), A265584 (not 3 consecutive letters).

Programs

  • Maple
    A265624 := proc(n,k)
            local x;
            k*x*(1+x+x^2)/(1+(1-k)*x*(x^2+x+1)) ;
            coeftayl(%,x=0,n) ;
    end proc;
    seq(seq(A265624(d-k,k),k=1..d-1),d=2..10) ;

Formula

T(2,k) = k^2.
T(3,k) = k^3.
T(4,k) = k*(k+1)*(k^2+3*k+3).
T(5,k) = k*(k+1)*(k^3+4*k^2+6*k+2).
T(6,k) = k*(k+1)^2*(k^3+4*k^2+6*k+1).
G.f. of row k: k*x*(1+x+x^2)/(1+(1-k)*x*(x^2+x+1)).

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

Original entry on oeis.org

1, -2, 4, -6, 8, -8, 4, 8, -32, 72, -128, 192, -240, 224, -64, -352, 1152, -2432, 4160, -6016, 7168, -6016, 0, 14336, -40704, 81408, -134144, 186880, -210944, 153600, 66560, -555008, 1417216, -2701312, 4292608, -5750784, 6098944, -3612672, -4276224, 20750336, -48726016, 88899584
Offset: 0

Views

Author

N. J. A. Sloane, Nov 17 2002

Keywords

Crossrefs

Programs

  • GAP
    a:=[1,-2,4];; for n in [4..50] do a[n]:=-2*a[n-1]+2*a[n-3]; od; a; # G. C. Greubel, Jun 25 2019
  • Magma
    R:=PowerSeriesRing(Integers(), 50); Coefficients(R!( 1/(1+2*x-2*x^3) )); // G. C. Greubel, Jun 25 2019
    
  • Mathematica
    LinearRecurrence[{-2, 0, 2}, {1, -2, 4}, 50] (* Vladimir Joseph Stephan Orlovsky, May 25 2011 *)
    CoefficientList[Series[1/(1+2x-2x^3),{x,0,50}],x] (* Harvey P. Dale, May 21 2024 *)
  • PARI
    my(x='x+O('x^50)); Vec(1/(1+2*x-2*x^3)) \\ G. C. Greubel, Jun 25 2019
    
  • Sage
    (1/(1+2*x-2*x^3)).series(x, 50).coefficients(x, sparse=False) # G. C. Greubel, Jun 25 2019
    

Formula

a(n) = (-1)^n * A077940(n). - G. C. Greubel, Jun 25 2019

A181137 The number of ways to color n balls in a row with 3 colors with no color runs having lengths greater than 3.

Original entry on oeis.org

1, 3, 9, 27, 78, 228, 666, 1944, 5676, 16572, 48384, 141264, 412440, 1204176, 3515760, 10264752, 29969376, 87499776, 255467808, 745873920, 2177683008, 6358049472, 18563212800, 54197890560, 158238305664, 461998818048, 1348870028544, 3938214304512
Offset: 0

Views

Author

William Sit (wyscc(AT)sci.ccny.cuny.edu), Oct 06 2010

Keywords

Comments

This sequence is a special case of the general problem for coloring n balls in a row with p colors where each color has a given maximum run-length. In this example, the bounds are uniformly 3. It can be phrased in terms of tossing a p-faced die n times, requiring each face to have no runs longer than b.
Generating function and recurrence for given p and uniform bound b are known. a(n+b) = (p-1)(a(n)+ ... + a(n+b-1)), using b initial values a(1)=p, a(2)=p^2, ..., a(b)=p^(b) The g.f. is p*G/(1-(p-1)*G) where G = t + t^2 + ... + t^b.

Examples

			For p=3 and b=3, a(4)=78. The colorings are: 1112, 1113, 1121, 1122, 1123, 1131, 1132, 1133, 1211, 1212, 1213, 1221, 1222, 1223, 1231, 1232, 1233, 1311, 1312, 1313, 1321, 1322, 1323, 1331, 1332, 1333, 2111, 2112, 2113, 2121, 2122, 2123, 2131, 2132, 2133, 2211, 2212, 2213, 2221, 2223, 2231, 2232, 2233, 2311, 2312, 2313, 2321, 2322, 2323, 2331, 2332, 2333, 3111, 3112, 3113, 3121, 3122, 3123, 3131, 3132, 3133, 3211, 3212, 3213, 3221, 3222, 3223, 3231, 3232, 3233, 3311, 3312, 3313, 3321, 3322, 3323, 3331, 3332.
		

Crossrefs

A135492 is sequence[2, {2, 4, 6, 8}, n-4], for colorings of n balls in a row with p=2 colors so no color has run length more than 4. A135491 coloring of 2 balls in a row with p=2 colors so no color has run length more than 3. In general 2 colorings are like coin tossing. The example here is 3 colorings (tossing 3-sided dice).
Column 3 in A265624.

Programs

  • Mathematica
    (* next[p,z] computes the next member in a sequence and
    next[p,z] = a(n+b)= (p-1)( c(b)+ ... + c(n+b-1)) where z is the preceding b items on the sequence starting with a(n) where b is the uniform bound on runs.
    The function sequence[p,z,n] computes the next n terms. *) next[p_,z_]:=(p-1) Apply[Plus,z] sequence[p_,z_,n_]:=Module[{y=z,seq=z, m=n, b=Length[z]}, While[m>0, seq = Join[seq,{next[p,y]}]; y = Take[seq, -b]; m-- ]; seq] (* sequence[3,{3,9,27},10] computes the next 10 terms after 3,9,27. *)
    LinearRecurrence[{2,2,2},{1,3,9,27},30] (* Harvey P. Dale, Dec 01 2017 *)
  • PARI
    Vec((1 + x)*(1 + x^2) / (1 - 2*x - 2*x^2 - 2*x^3) + O(x^30)) \\ Colin Barker, Jun 28 2019

Formula

G.f.: 1+3t(t^2+t+1)/(1 - 2t(t^2+t+1)).
a(n+3) = 2(a(n)+a(n+1)+a(n+2)), a(0)=1, a(1)=3, a(2)=9, a(3)=27.
a(n) = 3*A119826(n-1). - R. J. Mathar, Dec 10 2015
G.f.: (1 + x)*(1 + x^2) / (1 - 2*x - 2*x^2 - 2*x^3). - Colin Barker, Jun 28 2019

Extensions

a(0)=1 prepended by Alois P. Heinz, Dec 10 2015
Showing 1-10 of 16 results. Next