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 11-20 of 92 results. Next

A227349 Product of lengths of runs of 1-bits in binary representation of n.

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 2, 3, 1, 1, 1, 2, 2, 2, 3, 4, 1, 1, 1, 2, 1, 1, 2, 3, 2, 2, 2, 4, 3, 3, 4, 5, 1, 1, 1, 2, 1, 1, 2, 3, 1, 1, 1, 2, 2, 2, 3, 4, 2, 2, 2, 4, 2, 2, 4, 6, 3, 3, 3, 6, 4, 4, 5, 6, 1, 1, 1, 2, 1, 1, 2, 3, 1, 1, 1, 2, 2, 2, 3, 4, 1, 1, 1, 2, 1, 1, 2, 3, 2, 2, 2, 4, 3, 3, 4, 5, 2, 2, 2, 4, 2, 2, 4, 6, 2, 2, 2, 4, 4, 4, 6, 8, 3, 3, 3, 6, 3, 3, 6, 9, 4
Offset: 0

Views

Author

Antti Karttunen, Jul 08 2013

Keywords

Comments

This is the Run Length Transform of S(n) = {0, 1, 2, 3, 4, 5, 6, ...}. The Run Length Transform of a sequence {S(n), n >= 0} is defined to be the sequence {T(n), n >= 0} given by T(n) = Product_i S(i), where i runs through the lengths of runs of 1's in the binary expansion of n. E.g., 19 is 10011 in binary, which has two runs of 1's, of lengths 1 and 2. So T(19) = S(1)*S(2). T(0) = 1 (the empty product). - N. J. A. Sloane, Sep 05 2014
Like all run length transforms also this sequence satisfies for all i, j: A278222(i) = A278222(j) => a(i) = a(j). - Antti Karttunen, Apr 14 2017

Examples

			a(0) = 1, as zero has no runs of 1's, and an empty product is 1.
a(1) = 1, as 1 is "1" in binary, and the length of that only 1-run is 1.
a(2) = 1, as 2 is "10" in binary, and again there is only one run of 1-bits, of length 1.
a(3) = 2, as 3 is "11" in binary, and there is one run of two 1-bits.
a(55) = 6, as 55 is "110111" in binary, and 2 * 3 = 6.
a(119) = 9, as 119 is "1110111" in binary, and 3 * 3 = 9.
From _Omar E. Pol_, Feb 10 2015: (Start)
Written as an irregular triangle in which row lengths is A011782:
  1;
  1;
  1,2;
  1,1,2,3;
  1,1,1,2,2,2,3,4;
  1,1,1,2,1,1,2,3,2,2,2,4,3,3,4,5;
  1,1,1,2,1,1,2,3,1,1,1,2,2,2,3,4,2,2,2,4,2,2,4,6,3,3,3,6,4,4,5,6;
  ...
Right border gives A028310: 1 together with the positive integers. (End)
From _Omar E. Pol_, Mar 19 2015: (Start)
Also, the sequence can be written as an irregular tetrahedron T(s, r, k) as shown below:
  1;
  ..
  1;
  ..
  1;
  2;
  ....
  1,1;
  2;
  3;
  ........
  1,1,1,2;
  2,2;
  3;
  4;
  ................
  1,1,1,2,1,1,2,3;
  2,2,2,4;
  3,3;
  4;
  5;
  ................................
  1,1,1,2,1,1,2,3,1,1,1,2,2,2,3,4;
  2,2,2,4,2,2,4,6;
  3,3,3,6;
  4,4;
  5;
  6;
  ...
Apart from the initial 1, we have that T(s, r, k) = T(s+1, r, k). (End)
		

Crossrefs

Cf. A003714 (positions of ones), A005361, A005940.
Cf. A000120 (sum of lengths of runs of 1-bits), A167489, A227350, A227193, A278222, A245562, A284562, A284569, A283972, A284582, A284583.
Run Length Transforms of other sequences: A246588, A246595, A246596, A246660, A246661, A246674.
Differs from similar A284580 for the first time at n=119, where a(119) = 9, while A284580(119) = 5.

Programs

  • Maple
    a:= proc(n) local i, m, r; m, r:= n, 1;
          while m>0 do
            while irem(m, 2, 'h')=0 do m:=h od;
            for i from 0 while irem(m, 2, 'h')=1 do m:=h od;
            r:= r*i
          od; r
        end:
    seq(a(n), n=0..100);  # Alois P. Heinz, Jul 11 2013
    ans:=[];
    for n from 0 to 100 do lis:=[]; t1:=convert(n, base, 2); L1:=nops(t1); out1:=1; c:=0;
    for i from 1 to L1 do
       if out1 = 1 and t1[i] = 1 then out1:=0; c:=c+1;
       elif out1 = 0 and t1[i] = 1 then c:=c+1;
       elif out1 = 1 and t1[i] = 0 then c:=c;
       elif out1 = 0 and t1[i] = 0 then lis:=[c, op(lis)]; out1:=1; c:=0;
       fi;
       if i = L1 and c>0 then lis:=[c, op(lis)]; fi;
                       od:
    a:=mul(i, i in lis);
    ans:=[op(ans), a];
    od:
    ans;  # N. J. A. Sloane, Sep 05 2014
  • Mathematica
    onBitRunLenProd[n_] := Times @@ Length /@ Select[Split @ IntegerDigits[n, 2], #[[1]] == 1 & ]; Array[onBitRunLenProd, 100, 0] (* Jean-François Alcover, Mar 02 2016 *)
  • Python
    from operator import mul
    from functools import reduce
    from re import split
    def A227349(n):
        return reduce(mul, (len(d) for d in split('0+',bin(n)[2:]) if d)) if n > 0 else 1 # Chai Wah Wu, Sep 07 2014
    
  • Sage
    # uses[RLT from A246660]
    A227349_list = lambda len: RLT(lambda n: n, len)
    A227349_list(88) # Peter Luschny, Sep 07 2014
    
  • Scheme
    (define (A227349 n) (apply * (bisect (reverse (binexp->runcount1list n)) (- 1 (modulo n 2)))))
    (define (bisect lista parity) (let loop ((lista lista) (i 0) (z (list))) (cond ((null? lista) (reverse! z)) ((eq? i parity) (loop (cdr lista) (modulo (1+ i) 2) (cons (car lista) z))) (else (loop (cdr lista) (modulo (1+ i) 2) z)))))
    (define (binexp->runcount1list n) (if (zero? n) (list) (let loop ((n n) (rc (list)) (count 0) (prev-bit (modulo n 2))) (if (zero? n) (cons count rc) (if (eq? (modulo n 2) prev-bit) (loop (floor->exact (/ n 2)) rc (1+ count) (modulo n 2)) (loop (floor->exact (/ n 2)) (cons count rc) 1 (modulo n 2)))))))

Formula

A167489(n) = a(n) * A227350(n).
A227193(n) = a(n) - A227350(n).
a(n) = Product_{i in row n of table A245562} i. - N. J. A. Sloane, Aug 10 2014
From Antti Karttunen, Apr 14 2017: (Start)
a(n) = A005361(A005940(1+n)).
a(n) = A284562(n) * A284569(n).
A283972(n) = n - a(n).
(End)
a(4n+1) = a(2n) = a(n). If n is odd, then a(4n+3) = 2*a(2n+1)-a(n). If n is even, then a(4n+3) = 2*a(2n+1) = 2*a(n/2). - Chai Wah Wu, Jul 17 2025

Extensions

Data section extended up to term a(120) by Antti Karttunen, Apr 14 2017

A112934 a(0) = 1; a(n+1) = Sum_{k=0..n} a(k)*A001147(n-k), where A001147 = double factorial numbers.

Original entry on oeis.org

1, 1, 2, 6, 26, 158, 1282, 13158, 163354, 2374078, 39456386, 737125446, 15279024026, 347786765150, 8621313613954, 231139787526822, 6663177374810266, 205503866668090750, 6751565903597571842
Offset: 0

Views

Author

Philippe Deléham and Paul D. Hanna, Oct 09 2005

Keywords

Examples

			A(x) = 1 + x + 2*x^2 + 6*x^3 + 26*x^4 + 158*x^5 + 1282*x^6 + ...
1/A(x) = 1 - x - x^2 - 3*x^3 - 15*x^4 - 105*x^5 - ... - A001147(n)*x^(n+1) - ...
a(4) = a(3+1) = Sum_{k=0..3} a(k)*A001147(3-k) = a(0)*5!! + a(1)*3!! + a(2)*1 + a(3)*1 = 1*15 + 1*3 + 2*1 + 6*1 = 26. - _Michael B. Porter_, Jul 22 2016
		

Crossrefs

Programs

  • Maple
    a_list := proc(len) local A, n; A[0] := 1; A[1] := 1;
    for n from 2 to len-1 do A[n] := (2*n-1)*A[n-1] - add(A[j]*A[n-j], j=1..n-1) od;
    convert(A, list) end: a_list(19); # Peter Luschny, May 22 2017
    # Alternative:
    T := proc(n, k) option remember; if k = 0 then 1 else if k = n then T(n, k-1)
    else (n - k) * T(n, k - 1) + T(n - 1, k) fi fi end:
    a := n -> T(n, n): seq(a(n), n = 0..18);  # Peter Luschny, Oct 02 2023
  • Mathematica
    a[0] = 1; a[n_] := a[n] = Sum[a[k]*(2n - 2k - 3)!!, {k, 0, n - 1}]; Table[ a[n], {n, 0, 19}] (* Robert G. Wilson v, Oct 12 2005 *)
  • PARI
    {a(n)=local(F=1+x+x*O(x^n));for(i=1,n,F=1+x+2*x^2*deriv(F)/F); return(polcoeff(F,n,x))}
    
  • PARI
    {a(n) = local(A); if( n<1, n==0, A = vector(n); A[1] = 1; for( k=2, n, A[k] = (2*k - 1) * A[k-1] - sum( j=1, k-1, A[j] * A[k-j])); A[n])} /* Michael Somos, Jul 23 2011 */

Formula

INVERT transform of double factorials (A001147), shifted right one place, where g.f. A(x) satisfies: A(x) = 1 + x*[d/dx x*A(x)^2]/A(x)^2.
G.f. A(x) satisfies: A(x) = 1+x + 2*x^2*[d/dx A(x)]/A(x) (log derivative).
G.f.: A(x) = 1+x +2*x^2/(1-3*x -2*2*1*x^2/(1-7*x -2*3*3*x^2/(1-11*x -2*4*5*x^2/(1-15*x - ... -2*n*(2*n-3)*x^2/(1-(4*n-1)*x - ...)))) (continued fraction).
G.f.: A(x) = 1/(1-x/(1 -1*x/(1-2*x/(1 -3*x/(1-4*x(1 - ...))))))) (continued fraction).
From Paul Barry, Dec 04 2009: (Start)
The g.f. of a(n+1) is 1/(1-2x/(1-x/(1-4x/(1-3x/(1-6x/(1-5x/(1-.... (continued fraction).
The Hankel transform of a(n+1) is A137592. (End)
a(n) = Sum_{k=0..n} A111106(n,k). - Philippe Deléham, Jun 20 2006
From Gary W. Adamson, Jul 08 2011: (Start)
a(n) is the upper left term in M^n, M = the production matrix:
1, 1;
1, 1, 2;
1, 1, 2, 3;
1, 1, 2, 3, 4;
1, 1, 2, 3, 4, 5;
... (End)
From Gary W. Adamson, Jul 21 2016: (Start)
Another production matrix Q is:
1, 1, 0, 0, 0, ...
1, 0, 3, 0, 0, ...
1, 0, 0, 5, 0, ...
1, 0, 0, 0, 7, ...
...
The sequence is generated by extracting the upper left term of powers of Q. By extracting the top row of Q^n, we obtain a triangle with the sequence in the left column and row sums = (1, 2, 6, 26, 158, ...): (1), (1, 1), (2, 1, 3), (6, 2, 3, 15), (26, 6, 6, 15, 105), ... (End)
a(n) = (2*n - 1) * a(n-1) - Sum_{k=1..n-1} a(k) * a(n-k) if n>1. - Michael Somos, Jul 23 2011
G.f.: 1 / (1 - b(0)*x / (1 - b(1)*x / ...)) where b = A028310. - Michael Somos, Mar 31 2012
From Sergei N. Gladkovskii, Aug 11 2012, Aug 12 2012, Dec 26 2012, Mar 20 2013, Jun 02 2013, Aug 14 2013, Oct 22 2013: (Start) Continued fractions:
G.f. 1/(G(0)-x) where G(k) = 1 - x*(k+1)/G(k+1).
G.f. 1 + x/(G(0)-x) where G(k) = 1 - x*(k+1)/G(k+1).
G.f.: A(x) = 1 + x/(G(0) - x) where G(k) = 1 + (2*k+1)*x - x*(2*k+2)/G(k+1).
G.f.: Q(0) where Q(k) = 1 - x*(2*k-1)/(1 - x*(2*k+2)/Q(k+1)).
G.f.: 2/G(0) where G(k) = 1 + 1/(1 - x/(x + 1/(2*k-1)/G(k+1))).
G.f.: 3*x - G(0) where G(k) = 3*x - 2*x*k - 1 - x*(2*k-1)/G(k+1).
G.f.: 1 + x*Q(0) where Q(k) = 1 - x*(2*k+2)/(x*(2*k+2) - 1/(1 - x*(2*k+1)/(x*(2*k+1) - 1/Q(k+1)))). (End)
a(n) ~ n^(n-1) * 2^(n-1/2) / exp(n). - Vaclav Kotesovec, Feb 22 2014

A109081 Reversion of x*(1-x)*(1-x^2)*(1-x^3)/(1-x^6) = x*(1-x)^2/(1-x+x^2).

Original entry on oeis.org

1, 1, 3, 10, 37, 146, 602, 2563, 11181, 49720, 224540, 1027038, 4748042, 22150519, 104146733, 493012682, 2347796965, 11239697816, 54061835288, 261130778516, 1266125122956, 6160158505040, 30065608532008, 147161532388934
Offset: 1

Views

Author

Michael Somos, Jun 17 2005

Keywords

Comments

From David Callan, Mar 30 2007: (Start)
a(n) is the number of vertex-labeled ordered trees (A000108) on n vertices, in which each non-leaf vertex is labeled with a positive integer <= its outdegree. Example. a(3)=3 counts the trees on 3 vertices with labels as shown (the 2 edges in each tree are shown, you have to visualize the vertices).
.
1 2 1
/ \ / \ |1
|
.
Proof. Let F(x) = x + x^2 + 3x^3 + ... denote the g.f. for these trees, with x marking number of vertices. Counting these trees by degree of the root leads to F = x + Sum_{k>=1} k*x*F^k, or F = x + x*F/(1-F)^2. This is the same equation as that satisfied by the reversion of x*(1-x)*(1-x^2)*(1-x^3)/(1-x^6) = x*(1-x)^2/(1-x+x^2). (End)
(1 + 3x + 10x^2 + ...) = (1 + 2x + 6x^2 + ...)*(1 + x + 2x^2 + 6x^3 + ...), where A106228 = (1, 1, 2, 6, 21, ...). - Gary W. Adamson, Nov 15 2011
Reversion of x/(1 + sum(k>=1, k*x^k )) (cf. A028310). - Joerg Arndt, Aug 19 2012
a(n) is the number of Motzkin paths of length 2n-3 with no downsteps in even position (n>=2). Example: a(3)=3 counts FFF, FUD, UFD, where U denotes an upstep (1,1), F a flatstep (1,0), and D a downstep (1,-1). - David Callan, May 20 2015
a(n) is the number of peakless Motzkin paths of length 2n-2 where every pair of matching up and down edges occupies positions of the same parity. Equivalently, the number of RNA secondary structures on 2n-2 vertices where only vertices of the same parity can be matched. - Alexander Burstein, May 17 2021

Examples

			a(5) = 37 = the upper left term of M^4: (37, 26, 12, 4, 1); where (37 + 26 + 12 + 4 + 1) = 80 = A106228(5). - _Gary W. Adamson_, Nov 15 2011
G.f. = x + x^2 + 3*x^3 + 10*x^4 + 37*x^5 + 146*x^6 + 602*x^7 + 2563*x^8 + ...
		

Crossrefs

Programs

  • Magma
    [&+[Binomial(n, k)/(n-k+1)*Binomial(n+k-1, n-k): k in [0..n]]: n in [0..25]]; // Vincenzo Librandi, Sep 23 2015
  • Maple
    S:= series(RootOf(-x*z^2+z^3+x*z-2*z^2-x+z, z), x, 101):
    seq(coeff(S,x,j),j=1..100); # Robert Israel, Nov 19 2015
  • Mathematica
    a[ n_] := If[ n < 2, Boole[n == 1], (n - 1) HypergeometricPFQ[ {n, 1 - n, 2 - n}, {3/2, 2}, 1/4]]; (* Michael Somos, May 28 2014 *)
    Join[{1}, Table[Sum[ Binomial[n,k] / (n-k+1) Binomial[n+k-1, n-k], {k, n}], {n, 25}]] (* Vincenzo Librandi, Sep 23 2015 *)
  • PARI
    {a(n) = if( n<1, 0, polcoeff( serreverse( x * (1 - x) * (1 - x^2) * (1 - x^3) / (1 - x^6) + x * O(x^n)), n))};
    
  • PARI
    {a(n)=sum(k=0,n,binomial(n,k)/(n-k+1)*binomial(n+k-1,n-k))} \\ Paul D. Hanna, Jun 19 2009
    
  • Sage
    def A109081(n) :
        return (n-1)*hypergeometric([n,1-n,2-n],[3/2, 2],1/4) if n > 1 else 1
    [simplify(A109081(n)) for n in (1..24)] # Peter Luschny, Aug 02 2012, Nov 13 2014
    

Formula

G.f. A(x) satisfies 0 = f(x, A(x)) where f(x, y) = x*(1 - y + y^2) - y*(1 - y)^2.
G.f. A(x) satisfies 0 = f(x, A(x)) where f(x, y) = y*(1 - y)*((1 - y) / x + 1) - 1.
From Paul D. Hanna, Jun 19 2009: (Start)
G.f. satisfies: A(x) = x/(1 - x/(1 - A(x))^2).
a(n) = Sum_{k=0..n} C(n,k)/(n-k+1) * C(n+k-1,n-k). (End)
From Gary W. Adamson, Nov 15 2011: (Start)
a(n) is the upper left term in M^(n-1), M = an infinite square matrix as follows:
1, 1, 0, 0, 0, ...
2, 1, 1, 0, 0, ...
3, 2, 1, 1, 0, ...
4, 3, 2, 1, 1, ...
5, 4, 3, 2, 1, ...
... (End)
With different signs, g.f. = 2/(3-sqrt(1-4xC(x))) where C = g.f. for A000108 [He-Shapiro]. - N. J. A. Sloane, Apr 28 2017
From Vaclav Kotesovec, Aug 14 2018: (Start)
Recurrence: 2*n*(2*n - 1)*(19*n^2 - 85*n + 90)*a(n) = 2*(190*n^4 - 1230*n^3 + 2783*n^2 - 2595*n + 828)*a(n-1) + 2*(n-3)*(38*n^3 - 189*n^2 + 289*n - 132)*a(n-2) + 3*(n-4)*(n-3)*(19*n^2 - 47*n + 24)*a(n-3).
a(n) ~ (1 - (1-s)*s)^(n + 1/2) / (2*sqrt(Pi*(3 - 6*s + s^2)) * n^(3/2) * s^n * (1-s)^(2*n-2)), where s = 0.3611030805286473776346465621590281395264149... is the real root of the equation (s^2 - s + 3)*s = 1. (End)

A204502 Numbers such that floor[a(n)^2 / 9] is a square.

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45, 48, 51, 54, 57, 60, 63, 66, 69, 72, 75, 78, 81, 84, 87, 90, 93, 96, 99, 102, 105, 108, 111, 114, 117, 120, 123, 126, 129, 132, 135, 138, 141, 144, 147, 150, 153, 156, 159, 162, 165, 168, 171, 174, 177
Offset: 1

Views

Author

M. F. Hasler, Jan 15 2012

Keywords

Comments

Or, numbers n such that n^2, with its last base-9 digit dropped, is again a square. (Except maybe for the 3 initial terms whose square has only 1 digit in base 9.)

Crossrefs

The squares are in A204503, the squares with last base-9 digit dropped in A204504, and the square roots of the latter in A028310.
Cf. A031149=sqrt(A023110) (base 10), A204514=sqrt(A055872) (base 8), A204516=sqrt(A055859) (base 7), A204518=sqrt(A055851) (base 6), A204520=sqrt(A055812) (base 5), A004275=sqrt(A055808) (base 4), A001075=sqrt(A055793) (base 3), A001541=sqrt(A055792) (base 2).

Programs

  • Mathematica
    Select[Range[0,200],IntegerQ[Sqrt[Floor[#^2/9]]]&] (* Harvey P. Dale, May 05 2018 *)
  • PARI
    b=9;for(n=0,200,issquare(n^2\b) & print1(n","))

Formula

Conjecture: a(n) = 3*n-12 for n>5. G.f.: x^2*(x^2+x+1)*(x^3-x+1)/(x-1)^2. [Colin Barker, Nov 23 2012]

A062157 a(n) = 0^n - (-1)^n.

Original entry on oeis.org

0, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1
Offset: 0

Views

Author

Henry Bottomley, Jun 08 2001

Keywords

Comments

Also the numerators of the series expansion of log(1+x). Denominators are A028310. - Robert G. Wilson v, Aug 14 2015

Examples

			G.f. = x - x^2 + x^3 - x^4 + x^5 - x^6 + x^7 - x^8 + x^9 - x^10 + ... - _Michael Somos_, Feb 20 2024
		

Crossrefs

Convolution inverse of A019590.

Programs

  • Magma
    [0^n-(-1)^n: n in [0..100]]; // Vincenzo Librandi, Aug 15 2015
    
  • Magma
    [0] cat &cat[ [1, -1]: n in [1..80] ]; // Vincenzo Librandi, Aug 15 2015
  • Mathematica
    PadRight[{0},120,{-1,1}] (* Harvey P. Dale, Aug 20 2012 *)
    Join[{0},LinearRecurrence[{-1},{1},101]] (* Ray Chandler, Aug 12 2015 *)
    f[n_] := 0^n - (-1)^n; f[0] = 0; Array[f, 105, 0] (* or *)
    CoefficientList[ Series[ x/(1 + x), {x, 0, 80}], x] (* or *)
    Numerator@ CoefficientList[ Series[ Log[1 + x], {x, 0, 80}], x] (* Robert G. Wilson v, Aug 14 2015 *)
  • PARI
    {a(n) = if( n<1, 0, -(-1)^n )}; /* Michael Somos, Jul 05 2009 */
    

Formula

a(n) = A000007(n) - A033999(n) = A062160(0, n).
G.f.: x/(1+x).
Euler transform of length 2 sequence [-1, 1]. - Michael Somos, Jul 05 2009
Moebius transform is length 2 sequence [1, -2]. - Michael Somos, Jul 05 2009
a(n) is multiplicative with a(2^e) = -1 if e > 0, a(p^e) = 1 if p > 2. - Michael Somos, Jul 05 2009
Dirichlet g.f.: zeta(s) * (1 - 2^(1-s)). - Michael Somos, Jul 05 2009
Also, Dirichlet g.f.: eta(s). - Ralf Stephan, Mar 25 2015
E.g.f.: 1 - exp(-x). - Alejandro J. Becerra Jr., Feb 16 2021

A347461 Number of distinct possible alternating products of integer partitions of n.

Original entry on oeis.org

1, 1, 2, 3, 4, 6, 7, 10, 12, 16, 19, 23, 27, 34, 41, 49, 57, 67, 78, 91, 106, 125, 147, 166, 187, 215, 245, 277, 317, 357, 405, 460, 524, 592, 666, 740, 829, 928, 1032, 1147, 1273, 1399, 1555, 1713, 1892, 2087, 2298, 2523, 2783, 3070, 3383, 3724, 4104, 4504
Offset: 0

Views

Author

Gus Wiseman, Oct 06 2021

Keywords

Comments

We define the alternating product of a sequence (y_1,...,y_k) to be Product_i y_i^((-1)^(i-1)).

Examples

			Partitions representing each of the a(7) = 10 alternating products are:
     (7) -> 7
    (61) -> 6
    (52) -> 5/2
   (511) -> 5
    (43) -> 4/3
   (421) -> 2
  (4111) -> 4
   (331) -> 1
   (322) -> 3
  (3211) -> 3/2
		

Crossrefs

The version for alternating sum is A004526.
Counting only integers gives A028310, reverse A347707.
The version for factorizations is A347460, reverse A038548.
The reverse version is A347462.
A000041 counts partitions.
A027187 counts partitions of even length.
A027193 counts partitions of odd length.
A103919 counts partitions by sum and alternating sum (reverse: A344612).
A108917 counts knapsack partitions, ranked by A299702.
A122768 counts distinct submultisets of partitions.
A126796 counts complete partitions.
A293627 counts knapsack factorizations by sum.
A301957 counts distinct subset-products of prime indices.
A304792 counts subset-sums of partitions, positive A276024, strict A284640.
A304793 counts distinct positive subset-sums of prime indices.
A325534 counts separable partitions, ranked by A335433.
A325535 counts inseparable partitions, ranked by A335448.

Programs

  • Mathematica
    altprod[q_]:=Product[q[[i]]^(-1)^(i-1),{i,Length[q]}];
    Table[Length[Union[altprod/@IntegerPartitions[n]]],{n,0,30}]

A347462 Number of distinct possible reverse-alternating products of integer partitions of n.

Original entry on oeis.org

1, 1, 2, 3, 4, 6, 8, 11, 13, 17, 22, 28, 33, 42, 51, 59, 69, 84, 100, 117, 137, 163, 191, 222, 256, 290, 332, 378, 429, 489, 564, 643, 729, 819, 929, 1040, 1167, 1313, 1473, 1647, 1845, 2045, 2272, 2521, 2785, 3076, 3398, 3744, 4115, 4548, 5010, 5524, 6086
Offset: 0

Views

Author

Gus Wiseman, Oct 06 2021

Keywords

Comments

We define the alternating product of a sequence (y_1,...,y_k) to be Product_i y_i^((-1)^(i-1)). The reverse-alternating product is the alternating product of the reversed sequence.

Examples

			Partitions representing each of the a(7) = 11 reverse-alternating products:
     (7) -> 7
    (61) -> 1/6
    (52) -> 2/5
   (511) -> 5
    (43) -> 3/4
   (421) -> 2
  (4111) -> 1/4
   (331) -> 1
   (322) -> 3
  (3211) -> 2/3
  (2221) -> 1/2
		

Crossrefs

The version for non-reverse alternating sum instead of product is A004526.
Counting only integers gives A028310, non-reverse A347707.
The version for factorizations is A038548, non-reverse A347460.
The non-reverse version is A347461.
A000041 counts partitions.
A027187 counts partitions of even length.
A027193 counts partitions of odd length.
A103919 counts partitions by sum and alternating sum (reverse: A344612).
A108917 counts knapsack partitions, ranked by A299702.
A122768 counts distinct submultisets of partitions.
A126796 counts complete partitions.
A293627 counts knapsack factorizations by sum.
A301957 counts distinct subset-products of prime indices.
A304792 counts subset-sums of partitions, positive A276024, strict A284640.
A304793 counts distinct positive subset-sums of prime indices.
A325534 counts separable partitions, ranked by A335433.
A325535 counts inseparable partitions, ranked by A335448.

Programs

  • Mathematica
    revaltprod[q_]:=Product[Reverse[q][[i]]^(-1)^(i-1),{i,Length[q]}];
    Table[Length[Union[revaltprod/@IntegerPartitions[n]]],{n,0,30}]

A144328 A002260 preceded by a column of 1's: a (1, 1, 2, 3, 4, 5, ...) crescendo triangle by rows.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 1, 2, 3, 1, 1, 2, 3, 4, 1, 1, 2, 3, 4, 5, 1, 1, 2, 3, 4, 5, 6, 1, 1, 2, 3, 4, 5, 6, 7, 1, 1, 2, 3, 4, 5, 6, 7, 8, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
Offset: 1

Views

Author

Gary W. Adamson, Sep 18 2008

Keywords

Comments

Row sums = A000124.
Eigensequence of the triangle = A000142, the factorials.
The triangle as an infinite lower triangular matrix * [1,2,3,...] = A064999.
Generated from A128227 by rotating each row by one position to the right. - R. J. Mathar, Sep 25 2008
A sequence B is called a reluctant sequence of sequence A, if B is triangle array read by rows: row number k coincides with first k elements of the sequence A. Sequence A144328 is the reluctant sequence of A028310 (1 followed by the natural numbers). - Boris Putievskiy, Dec 12 2012
If offset were changed to 0, a(n) would equal the
Let S_n be the set of partitions of n into distinct parts where the number of parts is maximal for that n. For example, for n=6, the set S_6 consists of just one such partition: S_6={1,2,3}. Similarly, for n=7, S_7={1,2,4}, But for n=8, S_8 will contain two partitions S_8= { {1,2,5}, {1,3,4} }. Then |S(n)| = a(n+1). Cf. A178702. - David S. Newman and Benoit Jubin, Dec 13 2010

Examples

			First few rows of the triangle:
  1;
  1, 1;
  1, 1, 2;
  1, 1, 2, 3;
  1, 1, 2, 3, 4;
  1, 1, 2, 3, 4, 5;
  ...
		

Crossrefs

Programs

  • Haskell
    a144328 n k = a144328_tabl !! (n-1) !! (k-1)
    a144328_row n = a144328_tabl !! (n-1)
    a144328_tabl = [1] : map (\xs@(x:_) -> x : xs) a002260_tabl
    -- Reinhard Zumkeller, Apr 29 2015
    
  • Mathematica
    Flatten[Table[Join[{1},Range[n]],{n,0,11}]] (* Harvey P. Dale, Aug 10 2013 *)
  • Python
    from math import comb, isqrt
    def A144328(n): return n-comb((m:=isqrt(k:=n<<1))+(k>m*(m+1)),2)-(comb(isqrt(n-1<<1)+1,2)!=n-1) # Chai Wah Wu, Nov 08 2024

Formula

Triangle A002260 (natural numbers crescendo triangle) preceded by a column of 1's, = a (1, 1, 2, 3, 4, 5, ...) crescendo triangle by rows.
a(n) = A028310(m-1), where m = n-t*(t+1)/2, t = floor((-1+sqrt(8*n-7))/2). - Boris Putievskiy, Dec 13 2012
a(n) = A002260(n)+A010054(n-1)-1. - Chai Wah Wu, Nov 08 2024

A228617 T(n,k) is the number of s in {1,...,n}^n having shortest run with the same value of length k; triangle T(n,k), n>=0, 0<=k<=n, read by rows.

Original entry on oeis.org

1, 0, 1, 0, 2, 2, 0, 24, 0, 3, 0, 240, 12, 0, 4, 0, 3080, 40, 0, 0, 5, 0, 46410, 210, 30, 0, 0, 6, 0, 822612, 840, 84, 0, 0, 0, 7, 0, 16771832, 5208, 112, 56, 0, 0, 0, 8, 0, 387395856, 23760, 720, 144, 0, 0, 0, 0, 9, 0, 9999848700, 148410, 2610, 180, 90, 0, 0, 0, 0, 10
Offset: 0

Views

Author

Alois P. Heinz, Aug 27 2013

Keywords

Comments

Sum_{k=0..n} k*T(n,k) = A228618(n).
Sum_{k=0..n} T(n,k) = A000312(n).
T(2*n,n) = A002939(n) for n>0.
T(2*n+1,n) = A033586(n) for n>1.
T(2*n+2,n) = A085250(n+1) for n>2.
T(2*n+3,n) = A033586(n+1) for n>3.

Examples

			T(3,1) = 24: [1,1,2], [1,1,3], [1,2,1], [1,2,2], [1,2,3], [1,3,1], [1,3,2], [1,3,3], [2,1,1], [2,1,2], [2,1,3], [2,2,1], [2,2,3], [2,3,1], [2,3,2], [2,3,3], [3,1,1], [3,1,2], [3,1,3], [3,2,1], [3,2,2], [3,2,3], [3,3,1], [3,3,2].
T(3,3) =  3: [1,1,1], [2,2,2], [3,3,3].
Triangle T(n,k) begins:
  1;
  0,        1;
  0,        2,    2;
  0,       24,    0,   3;
  0,      240,   12,   0,  4;
  0,     3080,   40,   0,  0,  5;
  0,    46410,  210,  30,  0,  0,  6;
  0,   822612,  840,  84,  0,  0,  0,  7;
  0, 16771832, 5208, 112, 56,  0,  0,  0,  8;
		

Crossrefs

Row sums give: A000312.
Main diagonal gives: A028310.

A123110 Triangle T(n,k), 0 <= k <= n, read by rows given by [0,1,0,0,0,0,0,0,0,0,...] DELTA [1,0,-1,1,0,0,0,0,0,0,...] where DELTA is the operator defined in A084938.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 0

Views

Author

Philippe Deléham, Sep 28 2006

Keywords

Comments

Diagonal sums give A123108. - Philippe Deléham, Oct 08 2009

Examples

			Triangle begins:
  1;
  0, 1;
  0, 1, 1;
  0, 1, 1, 1;
  0, 1, 1, 1, 1;
  0, 1, 1, 1, 1, 1;
  0, 1, 1, 1, 1, 1, 1;
  0, 1, 1, 1, 1, 1, 1, 1;
  0, 1, 1, 1, 1, 1, 1, 1, 1;
  0, 1, 1, 1, 1, 1, 1, 1, 1, 1;
		

Crossrefs

Essentially the same sequence as A114607.
Also essentially the same as A023532. - R. J. Mathar, Jun 18 2008
After the initial a(0)=1, the characteristic function of A014132.
Cf. A010054.

Programs

Formula

Sum_{k=0..n} T(n,k)*x^k = A000007(n), A028310(n), A095121(n), A123109(n) for x=0,1,2,3 respectively.
G.f.: (1-x+y*x^2)/(1-(1+y)*x+y*x^2). - Philippe Deléham, Nov 01 2011
From Tom Copeland, Nov 10 2012: (Start)
O.g.f. for row polynomials: 1 + (t/(1-t))*(1/(1-x)-1/(1-x*t)) = 1 + t*x + (t+t^2)*x^2 + ....
E.g.f. for row polynomials: 1 + (t/(1-t))*(e^x-e^(t*x)) = 1 + t*x + (t+t^2)*x^2/2 + .... (End)
a(0) = 1; for n > 0, a(n) = 1 - A010054(n). [As a flat sequence] - Antti Karttunen, Jan 19 2025
Previous Showing 11-20 of 92 results. Next