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.

Previous Showing 21-30 of 72 results. Next

A347738 A variant of the inventory sequence: record the number of terms >= 0 thus far in the sequence, then the number of terms >= 1 thus far, then the number of terms >= 2 thus far, and so on, until a zero is recorded; the inventory then starts again, recording the number of terms >= 0, etc.

Original entry on oeis.org

0, 1, 1, 0, 4, 3, 2, 2, 1, 0, 10, 8, 6, 5, 5, 5, 3, 2, 2, 1, 1, 0, 22, 19, 15, 12, 11, 11, 9, 9, 10, 10, 9, 6, 4, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 0, 46, 42, 35, 28, 24, 23, 21, 20, 21, 21, 19, 17, 16, 16, 17, 18, 18, 17, 15, 13, 11, 10, 7, 6, 5, 4, 4, 4, 4, 3, 3
Offset: 0

Views

Author

David James Sycamore, Sep 12 2021

Keywords

Comments

Sequence starts off as A342585 but diverges after a(4). The effect is to introduce some numbers earlier in this sequence than in the original, and to stretch out the incidences of zero terms by the fact that the term immediately following a zero is now the total number of prior terms, rather than the total number of prior zero terms.
In A342585 zeros occur at positions 1,4,8,14,20,28,... (see A343880) whereas in this version they occur at positions 1,4,10,22,46,... (which is A033484, as is easily proved by induction).

Examples

			As an irregular triangle this begins:
   0;
   1,  1,  0;
   4,  3,  2,  2,  1,  0;
  10,  8,  6,  5,  5,  5, 3, 2,  2,  1, 1, 0;
  22, 19, 15, 12, 11, 11, 9, 9, 10, 10, 9, 6, 4, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 0;
  46, ...
(for row lengths see A003945)
		

Crossrefs

Cf: A342585, A033484, A003945, A343880, A003945 (row lengths), A347324 (row sums).
A347326 has a version of this in which the rows have been normalized.

Programs

  • Mathematica
    a[n_] := a[n] = Block[{t}, t = If[a[n - 1] == 0, 0, b[n - 1] + 1]; b[n] = t; Sum[If[a[j] >= t, 1, 0], {j, n - 1}]]; b[1] = a[1] = 0; Array[a, 77] (* Michael De Vlieger, Sep 12 2021, after Jean-François Alcover at A342585 *)
  • Python
    def aupton(nn):
        num, gte_inventory, alst, bigc = 0, [1], [0], 0
        while len(alst) < nn+1:
            c = gte_inventory[num] if num <= bigc else 0
            num = 0 if c == 0 else num + 1
            for i in range(min(c, bigc)+1):
                gte_inventory[i] += 1
            for i in range(bigc+1, c+1):
                gte_inventory.append(1)
            bigc = len(gte_inventory) - 1
            alst.append(c)
        return alst
    print(aupton(76)) # Michael S. Branicky, Sep 19 2021

Extensions

Offset changed to 0 by N. J. A. Sloane, Sep 12 2021

A169720 a(n) = (3*2^(n-1)-1)*(3*2^n-1).

Original entry on oeis.org

1, 10, 55, 253, 1081, 4465, 18145, 73153, 293761, 1177345, 4713985, 18865153, 75479041, 301953025, 1207885825, 4831690753, 19327057921, 77308821505, 309236465665, 1236948221953, 4947797606401, 19791199862785, 79164818325505, 316659311050753, 1266637319700481
Offset: 0

Views

Author

Alice V. Kleeva (alice27353(AT)gmail.com), Jan 19 2010

Keywords

Comments

A subsequence of the triangular numbers A000217.

Crossrefs

Programs

  • Magma
    I:=[1, 10, 55]; [n le 3 select I[n] else 7*Self(n-1)-14*Self(n-2)+8*Self(n-3): n in [1..30]]; // Vincenzo Librandi, Dec 03 2012
  • Mathematica
    CoefficientList[Series[(1 + 3*x - x^2)/((1-x)*(1-2*x)*(1-4*x)), {x, 0, 30}], x] (* or *) LinearRecurrence[{7, -14, 8}, {1, 10, 55}, 30] (* Vincenzo Librandi, Dec 03 2012 *)
  • PARI
    a(n)=polcoeff((1+3*x-x^2)/((1-x)*(1-2*x)*(1-4*x)+x*O(x^n)),n) \\ Paul D. Hanna, Apr 29 2010
    

Formula

G.f.: (1 + 3*x - x^2)/((1-x)*(1-2*x)*(1-4*x)). - Paul D. Hanna, Apr 29 2010
a(n) = A000217(A033484(n)). - Mitch Harris, Dec 02 2012
a(n) = 7*a(n-1) - 14*a(n-2) + 8*a(n-3). - Vincenzo Librandi, Dec 03 2012
a(n) = (3*A169726(n)-1)/2. - L. Edson Jeffery, Dec 03 2012
a(n) = A006095(n+2) +3*A006095(n+1) - A006905(n). - R. J. Mathar, Dec 04 2016

A083416 Add 1, double, add 1, double, etc.

Original entry on oeis.org

1, 2, 4, 5, 10, 11, 22, 23, 46, 47, 94, 95, 190, 191, 382, 383, 766, 767, 1534, 1535, 3070, 3071, 6142, 6143, 12286, 12287, 24574, 24575, 49150, 49151, 98302, 98303, 196606, 196607, 393214, 393215, 786430, 786431, 1572862, 1572863, 3145726, 3145727, 6291454
Offset: 1

Views

Author

N. J. A. Sloane, Jun 10 2003

Keywords

Crossrefs

Programs

  • Haskell
    a083416 n = a083416_list !! (n-1)
    a083416_list = 1 : f 2 1 where
       f x y = z : f (x+1) z where z = (1 + x `mod` 2) * y + 1 - x `mod` 2
    -- Reinhard Zumkeller, Feb 27 2012
  • Magma
    [Floor(3*2^((2*n-(-1)^n-3)/4)+((-1)^n-3)/2): n in [1..50]]; // Vincenzo Librandi, Aug 17 2011
    
  • Maple
    A083416 := proc(n) if type(n,'even') then 3*2^(n/2-1)-1 ; else 3*2^((n-1)/2)-2 ; end if; end proc: # R. J. Mathar, Feb 16 2011
  • Mathematica
    a=0; b=0; lst={a,b}; Do[z=a+b+1; AppendTo[lst,z]; a=b; b=z; z=b+1; AppendTo[lst,z]; a=b; b=z,{n,50}]; lst (* Vladimir Joseph Stephan Orlovsky, Feb 16 2010 *)
    LinearRecurrence[{0,3,0,-2},{1,2,4,5},40] (* Harvey P. Dale, Nov 18 2014 *)

Formula

G.f.: x*(1+2*x+x^2-x^3)/(1-x^2)/(1-2*x^2).
a(2*n) = 3*2^(n-1)-1, a(2*n+1) = 3*2^n-2.
a(n) = A081026(n+1)-1.
a(n) = 3*2^((2*n-(-1)^n-3)/4)+((-1)^n-3)/2. - Bruno Berselli, Feb 17 2011
For n > 1: a(n) = (1 + n mod 2) * a(n-1) + 1 - n mod 2. - Reinhard Zumkeller, Feb 27 2012
a(2n+1) = A033484(n), a(2n) = A153893(n). - Philippe Deléham, Apr 14 2013
E.g.f.: (3*cosh(sqrt(2)*x) - 4*sinh(x) + 3*sqrt(2)*sinh(sqrt(2)*x) - 2*cosh(x) - 1)/2. - Stefano Spezia, Jul 11 2023

Extensions

More terms from Donald Sampson (marsquo(AT)hotmail.com), Dec 04 2003
Corrected by T. D. Noe, Nov 02 2006

A089143 a(n) = 9*2^n - 6.

Original entry on oeis.org

3, 12, 30, 66, 138, 282, 570, 1146, 2298, 4602, 9210, 18426, 36858, 73722, 147450, 294906, 589818, 1179642, 2359290, 4718586, 9437178, 18874362, 37748730, 75497466, 150994938, 301989882, 603979770, 1207959546, 2415919098, 4831838202, 9663676410, 19327352826
Offset: 0

Views

Author

Parthasarathy Nambi, Sep 21 2004

Keywords

Crossrefs

Cf. A033484.

Programs

Formula

a(n) = 3*A033484(n).
From Elmo R. Oliveira, May 24 2025: (Start)
G.f.: 3*(x+1)/((x-1)*(2*x-1)).
E.g.f.: 3*exp(x)*(3*exp(x) - 2).
a(n) = 3*a(n-1) - 2*a(n-2). (End)

A131110 A000012 * A133084.

Original entry on oeis.org

1, 3, 1, 6, 3, 1, 10, 6, 5, 1, 15, 10, 15, 5, 1, 21, 15, 35, 15, 7, 1, 28, 21, 70, 35, 28, 7, 1, 36, 28, 126, 70, 84, 28, 9, 1, 45, 36, 210, 126, 210, 84, 45, 9, 1, 55, 45, 330, 210, 462, 210, 165, 45, 11, 1
Offset: 1

Views

Author

Gary W. Adamson, Sep 08 2007

Keywords

Comments

Row sums give A033484.
Duplicate of A133093. - Georg Fischer, Oct 10 2021

Examples

			First few rows of the triangle are:
1;
3, 1;
6, 3, 1;
10, 6, 5, 1;
15, 10, 15, 5, 1;
21, 15, 35, 15, 7, 1;
28, 21, 70, 35, 28, 7, 1;
...
		

Crossrefs

Programs

  • PARI
    T4(n, k) = if(k == n, 1, (1  - (1 + (-1)^k)/2 )*binomial(n, k) + ((1 + (-1)^k)/2)*binomial(n - 1, k - 1)); \\ A133084
    N=10; matrix(N, N, n, k, if(n>=k, 1))*matrix(N, N, n, k, T4(n,k)) \\ Michel Marcus, Oct 11 2021

Formula

A000012 * A133084 as infinite lower triangular matrices.

Extensions

a(46) corrected by Georg Fischer, Oct 10 2021

A204201 Triangle based on (0,1/3,1) averaging array.

Original entry on oeis.org

1, 1, 4, 1, 5, 10, 1, 6, 15, 22, 1, 7, 21, 37, 46, 1, 8, 28, 58, 83, 94, 1, 9, 36, 86, 141, 177, 190, 1, 10, 45, 122, 227, 318, 367, 382, 1, 11, 55, 167, 349, 545, 685, 749, 766, 1, 12, 66, 222, 516, 894, 1230, 1434, 1515, 1534, 1, 13, 78, 288, 738, 1410
Offset: 1

Views

Author

Clark Kimberling, Jan 12 2012

Keywords

Comments

For a1, let
t(n,1)=[a+t(n-1,1)]/2,
t(n,n)=[b+t(n-1,n-1)]/2,
t(n,k)=[t(n-1,k-1)+t(n-1,k)]/2 for 2<=k<=n-1.
We call (t(n,k)) the (a,r,b) averaging array. If a and b
are integers and r is a rational number, then multiplying
row n of (t(n,k)) by the LCM of its denominators yields a
triangle of integers; A204201 arises in this manner from
(a,r,b)=(0,1/3,1).
...
Guide to related arrays:
(a,r,b).........triangle
(0,1/2,1).......A054143
(0,1/3,1).......A204201
(0,2/3,1).......A204202
(0,1/4,1).......A204203
(0,3/4,1).......A204204
(0,1/5,1).......A204205
(1,3/2,2).......A204206
(1,2,3).........A204207

Examples

			The (0,1/3,1) averaging array has these first four rows:
1/3
1/6....2/3
1/12...5/12...5/6
1/24...1/4....5/8...11/12.
Multiplying those rows by 3,6,12,24, respectively:
1
1...4
1...5...10
1...6...15...22
The first nine rows:
1
1...4
1...5...10
1...6...15...22
1...7...21...37...46
1...8...28...58...83...94
1...9...36...86...141..177..190
1...10..45...122..227..318..367..382
1...11..55...167..349..545..685..749..766
		

Crossrefs

Cf. A204202.

Programs

  • Mathematica
    a = 0; r = 1/3; b = 1;
    t[1, 1] = r;
    t[n_, 1] := (a + t[n - 1, 1])/2;
    t[n_, n_] := (b + t[n - 1, n - 1])/2;
    t[n_, k_] := (t[n - 1, k - 1] + t[n - 1, k])/2;
    u[n_] := Table[t[n, k], {k, 1, n}]
    Table[u[n], {n, 1, 5}]   (* averaging array *)
    u = Table[(1/2) (1/r) 2^n*u[n], {n, 1, 12}];
    TableForm[u]             (* A204102 triangle *)
    Flatten[u]               (* A204201 sequence *)

Formula

From Philippe Deléham, Dec 24 2013: (Start)
T(n,n) = A033484(n-1).
Sum{k=1..n} T(n,k) = A053220(n).
T(n,k) = T(n-1,k)+3*T(n-1,k-1)-2*T(n-2,k-1)-2*T(n-2,k-2), T(1,1)=1, T(2,1)=1, T(2,2)=4, T(n,k)=0 if k<1 or if k>n. (End)

A362824 Array read by antidiagonals: T(n,k) is the number of k-tuples of involutions on [n] that pairwise commute.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 4, 4, 1, 1, 1, 8, 10, 10, 1, 1, 1, 16, 22, 52, 26, 1, 1, 1, 32, 46, 232, 196, 76, 1, 1, 1, 64, 94, 976, 1016, 1216, 232, 1, 1, 1, 128, 190, 4000, 4576, 12496, 5944, 764, 1, 1, 1, 256, 382, 16192, 19376, 111376, 73648, 42400, 2620, 1
Offset: 0

Views

Author

Andrew Howroyd, May 06 2023

Keywords

Comments

Two involutions x,y on [n] commute if x*y = y*x.

Examples

			Array begins:
===========================================================
n/k| 0   1    2     3      4       5        6         7 ...
---+-------------------------------------------------------
0  | 1   1    1     1      1       1        1         1 ...
1  | 1   1    1     1      1       1        1         1 ...
2  | 1   2    4     8     16      32       64       128 ...
3  | 1   4   10    22     46      94      190       382 ...
4  | 1  10   52   232    976    4000    16192     65152 ...
5  | 1  26  196  1016   4576   19376    79696    323216 ...
6  | 1  76 1216 12496 111376  936976  7680016  62177296 ...
7  | 1 232 5944 73648 716416 6289312 52647904 430723168 ...
  ...
		

Crossrefs

Columns k=0..3 are A000012, A000085, A362819, A362825.
Rows n=2..3 are A000079, A033484.
Main diagonal is A362823.

Programs

  • PARI
    \\ B(n,k) is A022166.
    B(n,k)={polcoef(x^k/prod(j=0, k, 1-2^j*x + O(x*x^n)), n)}
    T(n,k)={if(n==0, 1, n!*polcoef(exp(sum(j=0, min(k,logint(n,2)), B(k,j)*x^(2^j)/2^j, O(x*x^n))), n))}

Formula

T(0,k) = T(1,k) = 1.

A097813 a(n) = 3*2^n - 2*n - 2.

Original entry on oeis.org

1, 2, 6, 16, 38, 84, 178, 368, 750, 1516, 3050, 6120, 12262, 24548, 49122, 98272, 196574, 393180, 786394, 1572824, 3145686, 6291412, 12582866, 25165776, 50331598, 100663244, 201326538, 402653128, 805306310, 1610612676, 3221225410, 6442450880, 12884901822, 25769803708
Offset: 0

Views

Author

Paul Barry, Aug 25 2004

Keywords

Comments

An elephant sequence, see A175654. For the corner squares four A[5] vectors, with decimal values 58, 154, 178 and 184, lead to this sequence. For the central square these vectors lead to the companion sequence A033484. - Johannes W. Meijer, Aug 15 2010
a(n) is also the number of order-preserving partial isometries of an n-chain, i.e., the row sums of A183153 and A183154. - Abdullahi Umar, Dec 28 2010

Crossrefs

Programs

  • Magma
    [3*2^n -2*(n+1): n in [0..40]]; // G. C. Greubel, Dec 30 2021
    
  • Mathematica
    Table[3 2^n-2n-2,{n,0,40}] (* or *) LinearRecurrence[{4,-5,2},{1,2,6},40] (* Harvey P. Dale, Oct 25 2011 *)
  • PARI
    a(n)=3*2^n-2*n-2 \\ Charles R Greathouse IV, Oct 07 2015
    
  • Sage
    [3*2^n -2*(n+1) for n in (0..40)] # G. C. Greubel, Dec 30 2021

Formula

G.f.: (1 - 2*x + 3*x^2)/((1-x)^2*(1-2*x)).
a(n) = 2*a(n-1) + 2*n - 2, for n>0, with a(0)=1.
a(n) = 4*a(n-1) - 5*a(n-2) + 2*a(n-3).
From G. C. Greubel, Dec 30 2021: (Start)
a(n) = 2^n + 2*A000295(n).
E.g.f.: 3*exp(2*x) - 2*(1 + x)*exp(x). (End)

A101945 a(n) = 6*2^n - n - 5.

Original entry on oeis.org

1, 6, 17, 40, 87, 182, 373, 756, 1523, 3058, 6129, 12272, 24559, 49134, 98285, 196588, 393195, 786410, 1572841, 3145704, 6291431, 12582886, 25165797, 50331620, 100663267, 201326562, 402653153, 805306336, 1610612703, 3221225438
Offset: 0

Views

Author

Gary W. Adamson, Dec 22 2004

Keywords

Crossrefs

Programs

  • Magma
    [6*2^n -n-5: n in [0..40]]; // G. C. Greubel, Feb 06 2022
    
  • Mathematica
    a[0]=1; a[1]=6; a[2]=17; a[n_]:= a[n]= 4a[n-1] -5a[n-2] +2a[n-3];
    Table[a[n], {n, 0, 30}] (* Robert G. Wilson v, Jan 12 2005 *)
  • PARI
    a(n)=if(n==1,1,if(n==2,6,if(n==3,17,4*a(n-1)-5*a(n-2)+2*a(n-3)))) \\ (Klasen)
    
  • Sage
    [3*2^(n+1) -(n+5) for n in (0..40)] # G. C. Greubel, Feb 06 2022

Formula

a(n) = 4*a(n-1) - 5*a(n-2) + 2*a(n-3) for n >= 3.
Row sums of triangle A135855. - Gary W. Adamson, Dec 01 2007
From G. C. Greubel, Feb 06 2022: (Start)
G.f.: (1 + 2*x - 2*x^2)/((1-x)^2*(1-2*x)).
E.g.f.: 6*exp(2*x) - (5+x)*exp(x). (End)

Extensions

More terms from Lambert Klasen (Lambert.Klasen(AT)gmx.net), Jan 06 2005
New definition from Ralf Stephan, May 17 2007

A232642 Sequence (or tree) generated by these rules: 1 is in S, and if x is in S, then x + 1 and 2*x + 2 are in S, and duplicates are deleted as they occur.

Original entry on oeis.org

1, 2, 4, 3, 6, 5, 10, 8, 7, 14, 12, 11, 22, 9, 18, 16, 15, 30, 13, 26, 24, 23, 46, 20, 19, 38, 17, 34, 32, 31, 62, 28, 27, 54, 25, 50, 48, 47, 94, 21, 42, 40, 39, 78, 36, 35, 70, 33, 66, 64, 63, 126, 29, 58, 56, 55, 110, 52, 51, 102, 49, 98, 96, 95, 190, 44
Offset: 1

Views

Author

Clark Kimberling, Nov 28 2013

Keywords

Comments

Let S be the set of numbers defined by these rules: 1 is in S, and if x is in S, then x + 1 and 2*x + 2 are in S. Then S is the set of positive integers, which arise in generations. Deleting duplicates as they occur, the generations are given by g(1) = (1), g(2) = (2,4), g(3) = (3,6,5,10), etc. Concatenating these gives A232642, a permutation of the positive integers. For n > 1, the number of numbers in g(n) is 2*F(n+1), where F = A000045, the Fibonacci numbers. It is helpful to show the results as a tree with the terms of S as nodes, an edge from x to x + 1 if x + 1 has not already occurred, and an edge from x to 2*x + 2 if 2*x + 2 has not already occurred.
Seen as triangle read by rows: A082560 with duplicates removed. - Reinhard Zumkeller, May 14 2015

Examples

			Each x begets x + 1 and 2*x + 2, but if either has already occurred it is deleted. Thus, 1 begets 2 and 4; then 2 begets 3 and 6, and 4 begets 5 and 10, so that g(3) = (3,6,5,10).
First 5 generations, also showing the places where duplicates were removed:
.  1:                                1
.  2:                2                               4
.  3:        3              6               5                10
.  4:    _       8      7       14      _       12       11       22
.  5:  _  __   9  18  _  16  15   30  _  __  13   26  __   24  23   46
These are the corresponding complete rows of triangle A082560:
.  1:                                1
.  2:                2                               4
.  3:        3              6               5                10
.  4:    4       8      7       14      6       12       11       22
.  5:  5  10   9  18  8  16  15   30  7  14  13   26  12   24  23   46
		

Crossrefs

Cf. A128588 (row lengths), A033484 (right edges), A257956 (row sums), A082560.

Programs

  • Haskell
    import Data.List.Ordered (member); import Data.List (sort)
    a232642 n k = a232642_tabf !! (n-1) !! (k-1)
    a232642_row n = a232642_tabf !! (n-1)
    a232642_tabf = f a082560_tabf [] where
       f (xs:xss) zs = ys : f xss (sort (ys ++ zs)) where
         ys = [v | v <- xs, not $ member v zs]
    a232642_list = concat a232642_tabf
    -- Reinhard Zumkeller, May 14 2015
  • Mathematica
    z = 14; g[1] = {1}; g[2] = {2}; g[n_] := Riffle[g[n - 1] + 1, 2 g[n - 1] + 2]; j[2] = Join[g[1], g[2]]; j[n_] := Join[j[n - 1], g[n]]; g1[n_] := DeleteDuplicates[DeleteCases[g[n], Alternatives @@ j[n - 1]]]; g1[1] = g[1]; g1[2] = g[2]; t = Flatten[Table[g1[n], {n, 1, z}]]  (* A232642 *)
    Table[Length[g1[n]], {n, 1, z}]  (* A000045 *)
    Flatten[Table[Position[t, n], {n, 1, 200}]]  (* A232643 *)

Extensions

Keyword tabf added, to bring out function g, by Reinhard Zumkeller, May 14 2015
Previous Showing 21-30 of 72 results. Next