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

A085350 Binomial transform of poly-Bernoulli numbers A027649.

Original entry on oeis.org

1, 5, 23, 101, 431, 1805, 7463, 30581, 124511, 504605, 2038103, 8211461, 33022991, 132623405, 532087943, 2133134741, 8546887871, 34230598205, 137051532983, 548593552421, 2195536471151, 8785632669005, 35152991029223
Offset: 0

Views

Author

Paul Barry, Jun 24 2003

Keywords

Comments

Binomial transform is A085351.
a(n) mod 10 = period 4:repeat 1,5,3,1 = A132400. - Paul Curtz, Nov 13 2009

Crossrefs

a(n-1) = A080643(n)/2 = A081674(n+1) - A081674(n).
Cf. A000244 (3^n).

Programs

  • Magma
    [2*4^n-3^n: n in [0..30]]; // Vincenzo Librandi, Aug 13 2011
  • Mathematica
    LinearRecurrence[{4,9,-36},{1,5,23},30] (* Harvey P. Dale, Nov 30 2011 *)
    LinearRecurrence[{7, -12},{1, 5},23] (* Ray Chandler, Aug 03 2015 *)

Formula

G.f.: (1-2x)/((1-3x)(1-4x)).
E.g.f.: 2exp(4x) - exp(3x).
a(n) = 2*4^n-3^n.
From Paul Curtz, Nov 13 2009: (Start)
a(n) = 4*a(n-1) + 9*a(n-2) - 36*a(n-3);
a(n) = 4*a(n-1) + 3^(n-1), both like A005061 (note for A005061 dual formula a(n) = 3*a(n-1) + 4^(n-1) = 3*a(n-1) + A000302(n-1)).
a(n) = 3*a(n-1) + 2^(2n+1) = 3*a(n-1) + A004171(n).
a(n) = A005061(n) + A000302(n).
b(n) = mix(A005061, A085350) = 0,1,1,5,7,23,... = differences of (A167762 = 0,0,1,2,7,14,37,...); b(n) differences = A167784. (End)

A053581 First differences of the Poly-Bernoulli numbers B_n^(k) with k=-2 (A027649).

Original entry on oeis.org

1, 3, 10, 32, 100, 308, 940, 2852, 8620, 25988, 78220, 235172, 706540, 2121668, 6369100, 19115492, 57362860, 172121348, 516429580, 1549419812, 4648521580, 13946089028, 41839315660, 125520044132
Offset: 0

Views

Author

Barry E. Williams, Jan 18 2000

Keywords

Comments

Also the second differences of A001047.
Equals sum of "terms added" to current row of the triangle version of A038573 to get the next row. a(3) = 32 sum of (3, 7, 7, 15) = terms appended to row 2 of the triangle in A038573. - Gary W. Adamson, Jun 04 2009

Crossrefs

Cf. A001045.
Cf. A038573. - Gary W. Adamson, Jun 04 2009

Programs

  • GAP
    List([0..30], n-> 4*3^(n-1) +(0^n -3*2^n)/6) # G. C. Greubel, May 16 2019
  • Magma
    [4*3^n/3+0^n/6-2^n/2: n in [0..30]]; // Vincenzo Librandi, Jul 17 2011
    
  • Mathematica
    CoefficientList[Series[(1-x)^2/((1-2x)(1-3x)),{x,0,30}],x]  (* Harvey P. Dale, Apr 22 2011 *)
  • PARI
    vector(30, n, n--; 4*3^(n-1) +(0^n -3*2^n)/6) \\ G. C. Greubel, May 16 2019
    
  • Sage
    [4*3^(n-1) +(0^n -3*2^n)/6 for n in (0..30)] # G. C. Greubel, May 16 2019
    

Formula

a(n) = 5*a(n-1) - 6*a(n-2) + C(2,2-n), n>1, with a(0)=1, a(1)=3, where C(2, 2-n)=1 for n=2 and =0 for n>2.
From Paul Barry, Jun 26 2003: (Start)
Binomial transform of A000975(n+1).
G.f.: (1-x)^2/((1-2*x)*(1-3*x)).
a(n) = 4*3^n/3 + 0^n/6 - 2^n/2. (End)
a(n) = Sum_{k=0..n+1} binomial(n+1, k) * Sum_{j=0..floor(k/2)} A001045(k-2*j). - Paul Barry, Apr 17 2005
E.g.f.: (1 - 3*exp(2*x) + 8*exp(3*x))/6. - G. C. Greubel, May 16 2019

A001047 a(n) = 3^n - 2^n.

Original entry on oeis.org

0, 1, 5, 19, 65, 211, 665, 2059, 6305, 19171, 58025, 175099, 527345, 1586131, 4766585, 14316139, 42981185, 129009091, 387158345, 1161737179, 3485735825, 10458256051, 31376865305, 94134790219, 282412759265, 847255055011, 2541798719465, 7625463267259, 22876524019505
Offset: 0

Views

Author

Keywords

Comments

a(n+1) is the sum of the elements in the n-th row of triangle pertaining to A036561. - Amarnath Murthy, Jan 02 2002
Number of 2 X n binary arrays with a path of adjacent 1's and no path of adjacent 0's from top row to bottom row. - R. H. Hardin, Mar 21 2002
With offset 1, partial sums of A027649. - Paul Barry, Jun 24 2003
Number of distinct lines through the origin in the n-dimensional lattice of side length 2. A049691 has the values for the 2-dimensional lattice of side length n. - Joshua Zucker, Nov 19 2003
a(n+1)/(n+1)=(3*3^n-2*2^n)/(n+1) is the second binomial transform of the harmonic sequence 1/(n+1). - Paul Barry, Apr 19 2005
a(n+1) is the sum of n-th row of A036561. - Reinhard Zumkeller, May 14 2006
The sequence gives the sum of the lengths of the segments in Cantor's dust generating sequence up to the i-th step. Measurement unit = length of the segment of i-th step. - Giorgio Balzarotti, Nov 18 2006
Let T be a binary relation on the power set P(A) of a set A having n = |A| elements such that for every element x, y of P(A), xTy if x is a proper subset of y. Then a(n) = |T|. - Ross La Haye, Dec 22 2006
From Alexander Adamchuk, Jan 04 2007: (Start)
a(n) is prime for n in A057468.
p divides a(p) - 1 for prime p.
Quotients (3^p - 2^p - 1)/p, where p = prime(n), are listed in A127071.
Numbers k such that k divides 3^k - 2^k - 1 are listed in A127072.
Pseudoprimes in A127072(n) include all powers of primes {2,3,7} and some composite numbers that are listed in A127073, which includes all Carmichael numbers A002997.
Numbers n such that n^2 divides 3^n - 2^n - 1 are listed in A127074.
5 divides a(2n).
5^2 divides a(2*5n).
5^3 divides a(2*5^2n).
5^4 divides a(2*5^3n).
7^2 divides a(6*7n).
13 divides a(4n).
13^2 divides a(4*13n).
19 divides a(3n).
19^2 divides a(3*19n).
23^2 divides a(11n).
23^3 divides a(11*23n).
23^4 divides a(11*23^2n).
29 divides a(7n).
p divides a((p-1)n) for prime p>3.
p divides a((p-1)/2) for prime p in A097934. Also primes p such that 6 is a square mod p, except {2,3}, A038876(n).
p^(k+1) divides a(p^k*(p-1)/2*n) for prime p in A097934.
p^(k+1) divides a(p^k*(p-1)*n) for prime p>3.
Note the exception that for p = 23, p^(k+2) divides a(p^k*(p-1)/2*n).
There are no more such exceptions for primes p up to 600000. (End)
a(n) divides a(q*(n+1)-1), for all q integer. Leonardo Sarasua, Apr 15 2024
Final digits of terms follow sequence 1,5,9,5. - Enoch Haga, Nov 26 2007
This is also the second column sequence of the Sheffer triangle A143494 (2-restricted Stirling2 numbers). See the e.g.f. given below. - Wolfdieter Lang, Oct 08 2011
Partial sums give A000392. - Jon Perry, Apr 05 2014
For n >= 1, this is also row 2 of A281890: when consecutive positive integers are written as a product of primes in nondecreasing order, "3" occurs in n-th position a(n) times out of every 6^n. - Peter Munn, May 17 2017
a(n) is the number of ternary sequences of length n which include the digit 2. For example, a(2)=5 since the sequences are 02,20,12,21,22. - Enrique Navarrete, Apr 05 2021
a(n-1) is the number of ways we can form disjoint unions of two nonempty subsets of [n] such that the union contains n. For example, for n = 3, a(2) = 5 since the disjoint unions are {1}U{3}, {1}U{2,3}, {2}U{3}, {2}U{1,3}, and {1,2}U{3}. Cf. A000392 if we drop the requirement that the union contains n. - Enrique Navarrete, Aug 24 2021
Configures as a composite Koch Snowflake Fractal (see illustration in links) based on the five-fold division of the Cantor Square/Cantor Dust Fractal of (9^n-4^n)/5 see my illustration in (A016153). - John Elias, Oct 13 2021
Number of pairs (A,B) where B is a subset of {1,2,...,n} and A is a proper subset of B. - Jianing Song, Jun 18 2022
From Manfred Boergens, Mar 29 2023: (Start)
With regard to the comments by Ross La Haye and Jianing Song: Omitting "proper" gives A000244.
Number of pairs (A,B) where B is a nonempty subset of {1,2,...,n} and A is a nonempty subset of B. For nonempty proper subsets see a(n+1) in A028243. (End)
a(n) is the number of n-digit numbers whose smallest decimal digit is 7. - Stefano Spezia, Nov 15 2023
a(n-1) is the number of all possible player-reduced binary games observed by each player in an nx2 game assuming the individual strategies of k < n - 1 players are fixed and the remaining n - k - 1 player will play as one, either maintaining their status quo strategies or jointly adopting an alternative strategy. - Ambrosio Valencia-Romero, Apr 11 2024

References

  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See pp. 86-87.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

a(n) = row sums of A091913, row 2 of A047969, column 1 of A090888 and column 1 of A038719.
Cf. partitions: A241766, A241759.
A diagonal of A262307.

Programs

  • Haskell
    a001047 n = a001047_list !! n
    a001047_list = map fst $ iterate (\(u, v) -> (3 * u + v, 2 * v)) (0, 1)
    -- Reinhard Zumkeller, Jun 09 2013
  • Magma
    [3^n - 2^n: n in [0..30]]; // Vincenzo Librandi, Jul 17 2011
    
  • Maple
    seq(3^n - 2^n, n=0..40); # Giorgio Balzarotti, Nov 18 2006
    A001047:=1/(3*z-1)/(2*z-1); # Simon Plouffe in his 1992 dissertation, dropping the initial zero
  • Mathematica
    Table[ 3^n - 2^n, {n, 0, 25} ]
    LinearRecurrence[{5, -6}, {0, 1}, 25] (* Harvey P. Dale, Aug 18 2011 *)
    Numerator@NestList[(3#+1)/2&,1/2,100] (* Zak Seidov, Oct 03 2011 *)
  • PARI
    {a(n) = 3^n - 2^n};
    
  • Python
    [3**n - 2**n for n in range(25)] # Ross La Haye, Aug 19 2005; corrected by David Radcliffe, Jun 26 2016
    
  • Sage
    [lucas_number1(n, 5, 6) for n in range(26)]  # Zerinvary Lajos, Apr 22 2009
    

Formula

G.f.: x/((1-2*x)*(1-3*x)).
a(n) = 5*a(n-1) - 6*a(n-2).
a(n) = 3*a(n-1) + 2^(n-1). - Jon Perry, Aug 23 2002
Starting 0, 0, 1, 5, 19, ... this is 3^n/3 - 2^n/2 + 0^n/6, the binomial transform of A086218. - Paul Barry, Aug 18 2003
a(n) = A083323(n)-1 = A056182(n)/2 = (A002783(n)-1)/2 = (A003063(n+2)-A003063(n+1))/2. - Ralf Stephan, Jan 12 2004
Binomial transform of A000225. - Ross La Haye, Feb 07 2005
a(n) = Sum_{k=0..n-1} binomial(n, k)*2^k. - Ross La Haye, Aug 20 2005
a(n) = 2^(2n) - A083324(n). - Ross La Haye, Sep 10 2005
a(n) = A112626(n, 1). - Ross La Haye, Jan 11 2006
E.g.f.: exp(3*x) - exp(2*x). - Mohammad K. Azarian, Jan 14 2009
a(n) = A217764(n,1). - Ross La Haye, Mar 27 2013
a(n) = 2*a(n-1) + 3^(n-1). - Toby Gottfried, Mar 28 2013
a(n) = A000244(n) - A000079(n). - Omar E. Pol, Mar 28 2013
a(n) = Sum_{k=0..2} Stirling1(2,k)*(k+1)^n = c_2^{(-n)}, poly-Cauchy numbers. - Takao Komatsu, Mar 28 2013
a(n) = A227048(n,A098294(n)). - Reinhard Zumkeller, Jun 30 2013
a(n+1) = Sum_{k=0..n} 2^k*3^(n-k). - J. M. Bergot, Mar 27 2018
Sum_{n>=1} 1/a(n) = A329064. - Amiram Eldar, Nov 20 2020
a(n) = (1/2)*Sum_{k=0..n} binomial(n, k)*(2^(n-k) + 2^k - 2).
a(n) = A001117(n) + 2*A000918(n) + 1. - Ambrosio Valencia-Romero, Mar 08 2022
a(n) = A000225(n) + A028243(n+1). - Ambrosio Valencia-Romero, Mar 09 2022
From Peter Bala, Jun 27 2025: (Start)
exp(Sum_{n >=1} a(2*n)/a(n)*x^n/n) = Sum_{n >= 0} a(n+1)*x^n.
exp(Sum_{n >=1} a(3*n)/a(n)*x^n/n) = 1 + 19*x + 247*x^2 + ... is the g.f. of A019443.
exp(Sum_{n >=1} a(4*n)/a(n)*x^n/n) = 1 + 65*x + 2743*x^2 + ... is the g.f. of A383754.
The following are all examples of telescoping series:
Sum_{n >= 1} 6^n/(a(n)*a(n+1)) = 2, since 6^n/(a(n)*a(n+1)) = b(n) - b(n+1), where b(n) = 2^n/a(n);
Sum_{n >= 1} 18^n/(a(n)*a(n+1)*a(n+2)) = 22/75, since 18^n/(a(n)*a(n+1)*a(n+2)) = c(n) - c(n+1), where c(n) = (5*6^n - 2*4^n)/(15*a(n)*a(n+1));
Sum_{n >= 1} 54^n/(a(n)*a(n+1)*a(n+2)*a(n+3)) = 634/48735 since 54^n/(a(n)*a(n+1)*a(n+2)*a(n+3)) = d(n) - d(n+1), where d(n) = (57*18^n - 38*12^n + 8*8^n)/(513*a(n)*a(n+1)*a(n+2)).
Sum_{n >= 1} 6^n/(a(n)*a(n+2)) = 14/25; Sum_{n >= 1} (-6)^n/(a(n)*a(n+2)) = -6/25.
Sum_{n >= 1} 6^n/(a(n)*a(n+3)) = 306/1805.
Sum_{n >= 1} 6^n/(a(n)*a(n+4)) = 4282/80275; Sum_{n >= 1} (-6)^n/(a(n)*a(n+4)) = -1698/80275. (End)

Extensions

Edited by Charles R Greathouse IV, Mar 24 2010

A318921 In binary expansion of n, delete one symbol from each run. Set a(n)=0 if the result is the empty string.

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 1, 3, 0, 0, 0, 1, 2, 1, 3, 7, 0, 0, 0, 1, 0, 0, 1, 3, 4, 2, 1, 3, 6, 3, 7, 15, 0, 0, 0, 1, 0, 0, 1, 3, 0, 0, 0, 1, 2, 1, 3, 7, 8, 4, 2, 5, 2, 1, 3, 7, 12, 6, 3, 7, 14, 7, 15, 31, 0, 0, 0, 1, 0, 0, 1, 3, 0, 0, 0, 1, 2, 1, 3, 7, 0, 0, 0, 1, 0, 0, 1, 3, 4, 2, 1, 3, 6, 3, 7, 15, 16
Offset: 0

Views

Author

N. J. A. Sloane, Sep 08 2018

Keywords

Comments

If the binary expansion of n is 1^b 0^c 1^d 0^e ..., then a(n) is the number whose binary expansion is 1^(b-1) 0^(c-1) 1^(d-1) 0^(e-1) .... Leading 0's are omitted, and if the result is the empty string, here we set a(n) = 0. See A319419 for a version which represents the empty string by -1.
Lenormand refers to this operation as planing ("raboter") the runs (or blocks) of the binary expansion.
A175046 expands the runs in a similar way, and a(A175046(n)) = A001477(n). - Andrew Weimholt, Sep 08 2018. In other words, this is a left inverse to A175046: A318921 o A175046 = A001477 = id on [0..oo). - M. F. Hasler, Sep 10 2018
Conjecture: For n in the range 2^k, ..., 2^(k+1)-1, the total value of a(n) appears to be 2*3^(k-1) - 2^(k-1) (see A027649), and so the average value of a(n) appears to be (3/2)^(k-1) - 1/2. - N. J. A. Sloane, Sep 25 2018
The above conjecture was proved by Doron Zeilberger on Nov 16 2018 (see link) and independently by Chai Wah Wu on Nov 18 2018 (see below). - N. J. A. Sloane, Nov 20 2018
From Chai Wah Wu, Nov 18 2018: (Start)
Conjecture is correct for k > 0. Proof: looking at the least significant 2 bits of n, it is easy to see that a(4n) = 2a(2n), a(4n+1) = a(2n), a(4n+2) = a(2n+1) and a(4n+3) = 2a(2n+1)+1. Define f(k) = Sum_{i=2^k..2^(k+1)-1} a(i), i.e. the sum ranges over all numbers with a (k+1)-bit binary expansion. Thus f(0) = a(1) = 0 and f(1) = a(2)+a(3) = 1. By summing over the recurrence relations for a(n), we get f(k+2) = Sum_{i=2^k..2^(k+1)-1} (f(4i) + f(4i+1) + f(4i+2) + f(4i+3)) = Sum_{i=2^k..2^(k+1)-1} (3a(2i) + 3a(2i+1) + 1) = 3*f(k+1) + 2^k. Solving this first order recurrence relation with the initial condition f(1) = 1 shows that f(k) = 2*3^(k-1)-2^(k-1) for k > 0.
(End)

Examples

			      n / "planed" string / a(n)
      0   e 0 (e = empty string)
      1   e 0
     10   e 0
     11   1 1
    100   0 0
    101   e 0
    110   1 1
    111  11 3
   1000  00 0
   1001   0 0
   1010   e 0
   1011   1 1
   1100  10 2
   1101   1 1
   1110  11 3
   1111 111 7
  10000 000 0
  ...
		

Crossrefs

Cf. A027649 (average value), A175046, A319419 (a version where a(n)=-1 if the result is the empty string).
See also A319416.

Programs

  • Maple
    r:=proc(n) local t1,t2,L1,len,i,j,k,b1;
    if n <= 2 then return(0); fi;
    b1:=[]; t1:=convert(n,base,2); L1:=nops(t1); p:=1; len:=1;
    for i from 2 to L1 do
    t2:=t1[L1+1-i];
    if (t2=p) and (i1 then for j from 1 to len-1 do b1:=[op(b1),p]; od: fi;
       p:=t2; len:=1;
    fi;               od;
    if nops(b1)=0 then return(0);
    else k:=b1[1];
    for i from 2 to nops(b1) do k:=2*k+b1[i]; od;
    return(k);
    fi;
    end;
    [seq(r(n),n=0..120)];
  • Mathematica
    a[n_] := FromDigits[Flatten[Rest /@ Split[IntegerDigits[n, 2]]], 2];
    Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Sep 10 2018 *)
  • PARI
    a(n) = if (n==0, 0, n%2==0, my (z=valuation(n,2)); a(n/2^z) * 2^(z-1), my (o=valuation(n+1,2)); (a(n\2^o)+1) * 2^(o-1)-1) \\ Rémy Sigrist, Sep 09 2018
    
  • PARI
    a(n)={forstep(i=#n=binary(n+!n),2,-1,n[i-1]!=n[i] && n=n[^i]); fromdigits(n[^1],2)} \\ For illustration purpose. - M. F. Hasler, Sep 10 2018
    
  • PARI
    A318921(n)=if(n<3, 0, bittest(n, 0), (A318921(n>>n=valuation(n+1, 2))+1)<<(n-1)-1, A318921(n>>n=valuation(n, 2))<<(n-1)) \\ M. F. Hasler, Sep 11 2018
    
  • Python
    from itertools import groupby
    def a(n):
        s = "".join(k*(len(list(g))-1) for k, g in groupby(bin(n)[2:]))
        return int(s, 2) if s != "" else 0
    print([a(n) for n in range(82)]) # Michael S. Branicky, Jun 01 2025

Formula

a(4n) = 2a(2n), a(4n+1) = a(2n), a(4n+2) = a(2n+1) and a(4n+3) = 2a(2n+1)+1. - Chai Wah Wu, Nov 18 2018

A038573 a(n) = 2^A000120(n) - 1.

Original entry on oeis.org

0, 1, 1, 3, 1, 3, 3, 7, 1, 3, 3, 7, 3, 7, 7, 15, 1, 3, 3, 7, 3, 7, 7, 15, 3, 7, 7, 15, 7, 15, 15, 31, 1, 3, 3, 7, 3, 7, 7, 15, 3, 7, 7, 15, 7, 15, 15, 31, 3, 7, 7, 15, 7, 15, 15, 31, 7, 15, 15, 31, 15, 31, 31, 63, 1, 3, 3, 7, 3, 7, 7, 15, 3, 7, 7, 15, 7, 15, 15, 31, 3, 7, 7, 15, 7, 15, 15, 31
Offset: 0

Views

Author

Keywords

Comments

Essentially the same sequence as A001316, which has much more information, and also A159913. - N. J. A. Sloane, Jun 05 2009
Smallest number with same number of 1's in its binary expansion as n.
Fixed point of the morphism 0 -> 01, 1 -> 13, 3 -> 37, ... = k -> k, 2k+1, ... starting from a(0) = 0; 1 -> 01 -> 0113 -> 01131337 -> 011313371337377(15) -> ..., . - Robert G. Wilson v, Jan 24 2006
From Gary W. Adamson, Jun 04 2009: (Start)
As an infinite string, 2^n terms per row starting with "1": (1; 1,3; 1,3,3,7; 1,3,3,7,3,7,7,15; 1,3,3,7,3,7,7,15,3,7,7,15,7,15,15,31;...)
Row sums of that triangle = A027649: (1, 4, 14, 46, 454, ...); where the next row sum = current term of A027649 + next term in finite difference row of A027649, i.e., (1, 3, 10, 32, 100, 308, ...) = A053581. (End)
From Omar E. Pol, Jan 24 2016: (Start)
Partial sums give A267700.
a(n) is also the number of cells turned ON at n-th generation of the cellular automaton of A267700 in a 90-degree sector on the square grid.
a(n) is also the number of Y-toothpicks added at n-th generation of the structure of A267700 in a 120-degree sector on the triangular grid. (End)
Row sums of A090971. - Nikolaos Pantelidis, Nov 23 2022

Examples

			9 = 1001 -> 0011 -> 3, so a(9)=3.
From _Gary W. Adamson_, Jun 04 2009: (Start)
Triangle read by rows:
  1;
  1, 3;
  1, 3, 3, 7;
  1, 3, 3, 7, 3, 7, 7, 15;
  1, 3, 3, 7, 3, 7, 7, 15, 3, 7, 7, 15, 7, 15, 15, 31;
  ...
Row sums: (1, 4, 14, 46, ...) = A027649 = last row terms + new set of terms such that row 3 = (1, 3, 3, 7,) + (3, 7, 7, 15) = 14 + 32 = A027649(2) + A053581(3). (End)
The rows of this triangle converge to A159913. - _N. J. A. Sloane_, Jun 05 2009
G.f. = x + x^2 + 3*x^3 + x^4 + 3*x^5 + 3*x^6 + 7*x^7 + x^8 + 3*x^9 + 3*x^10 + 7*x^11 + ... - _Michael Somos_, Jul 24 2023
		

Crossrefs

This is Guy Steele's sequence GS(3, 6) (see A135416).
Write n in b-ary, sort digits into increasing order: this sequence (b=2), A038574 (b=3), A319652 (b=4), A319653 (b=5), A319654 (b=6), A319655 (b=7), A319656 (b=8), A319657 (b=9), A004185 (b=10).
Column k=0 of A340666.

Programs

  • Haskell
    a038573 0 = 0
    a038573 n = (m + 1) * (a038573 n') + m where (n', m) = divMod n 2
    -- Reinhard Zumkeller, Oct 10 2012, Feb 07 2011
    (Python 3.10+)
    def A038573(n): return (1<Chai Wah Wu, Nov 15 2022
  • Maple
    seq(2^convert(convert(n,base,2),`+`)-1, n=0..100); # Robert Israel, Jan 24 2016
  • Mathematica
    Array[ 2^Count[ IntegerDigits[ #, 2 ], 1 ]-1&, 100 ]
    Nest[ Flatten[ # /. a_Integer -> {a, 2a + 1}] &, {0}, 7] (* Robert G. Wilson v, Jan 24 2006 *)
  • PARI
    {a(n) = 2^subst(Pol(binary(n)), x, 1) - 1};
    
  • PARI
    a(n) = 2^hammingweight(n)-1; \\ Michel Marcus, Jan 24 2016
    

Formula

a(2n) = a(n), a(2n+1) = 2*a(n)+1, a(0) = 0. a(n) = A001316(n)-1 = 2^A000120(n) - 1. - Daniele Parisse
a(n) = number of positive integers k < n such that n XOR k = n-k (cf. A115378). - Paul D. Hanna, Jan 21 2006
a(n) = f(n, 1) with f(x, y) = if x = 0 then y - 1 else f(floor(x/2), y*(1 + x mod 2)). - Reinhard Zumkeller, Nov 21 2009
a(n) = (n mod 2 + 1) * a(floor(n/2)) + n mod 2. - Reinhard Zumkeller, Oct 10 2012
a(n) = Sum_{i=1..n} C(n,i) mod 2. - Wesley Ivan Hurt, Nov 17 2017
G.f.: -1/(1 - x) + Product_{k>=0} (1 + 2*x^(2^k)). - Ilya Gutkovskiy, Aug 20 2019
G.f. A(x) = x + x^2*A(x) + (1 + 2*x)*(1 - x^2)*A(x^2). - Michael Somos, Jul 24 2023

Extensions

More terms from Erich Friedman
New definition from N. J. A. Sloane, Mar 01 2008

A099594 Array read by antidiagonals: poly-Bernoulli numbers B(-k,n).

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 4, 4, 1, 1, 8, 14, 8, 1, 1, 16, 46, 46, 16, 1, 1, 32, 146, 230, 146, 32, 1, 1, 64, 454, 1066, 1066, 454, 64, 1, 1, 128, 1394, 4718, 6902, 4718, 1394, 128, 1, 1, 256, 4246, 20266, 41506, 41506, 20266, 4246, 256, 1, 1, 512, 12866, 85310, 237686, 329462, 237686, 85310, 12866, 512, 1
Offset: 0

Views

Author

Ralf Stephan, Oct 27 2004

Keywords

Comments

B_n^{(-k)} is the number of distinct n by k "lonesum matrices" where a matrix of entries 0 or 1 is called lonesum when it is uniquely reconstructible from its row and column sums. [Brewbaker]
B_n^{(-k)} is the cardinality of the set { sigma in S_{n+k}: -k <= i-sigma(i) <= n for all i=1,2,...,n+k }. [Launois]
T(n,k) is also the number of permutations on [n+k] in which each substring whose support belongs to {1, 2, ..., n} or {n+1, n+2, ..., n+k} is increasing. For example, with n = 2 and k = 3, the permutation 41532 does not qualify because the substring 53 has support in {n+1, n+2, ..., n+k} = {3,4,5} but is not increasing. T(2,1) = 4 counts 123, 132, 231, 312 while the permutations satisfying Launois' condition above are 123, 132, 213, 231. A bijection between these sets of permutations would be interesting. - David Callan, Jul 22 2008. (Corrected by Norman Do, Sep 01 2008)
T(n,k) is also the number of acyclic orientations of the complete bipartite graph K_{n,k}. - Vincent Pilaud, Sep 15 2020
When indexed as a triangular array, T(n,k) is the number of permutations of [n] in which 1 is in position k and the excedance entries are precisely the entries to the left of 1. See link. - David Callan, Dec 12 2021
T(n,k) is also the number of max-closed relations between an ordered n-element set and an ordered k-element set (see the paper by Jeavons and Cooper 1995). - Don Knuth, Feb 12 2024

Examples

			Square array begins:
  1,  1,   1,    1,     1,      1, ...
  1,  2,   4,    8,    16,     32, ...
  1,  4,  14,   46,   146,    454, ...
  1,  8,  46,  230,  1066,   4718, ...
  1, 16, 146, 1066,  6902,  41506, ...
  1, 32, 454, 4718, 41506, 329462, ...
  ...
		

Crossrefs

Main diagonal is A048163. Another diagonal is A188634.
Antidiagonal sums are in A098830.

Programs

  • Maple
    A:= (n, k)-> add(Stirling2(n+1, i+1)*Stirling2(k+1, i+1)*
                 i!^2, i=0..min(n, k)):
    seq(seq(A(n, d-n), n=0..d), d=0..10);  # Alois P. Heinz, Jan 02 2016
  • Mathematica
    T[n_, k_] := Sum[(-1)^(j+n)*(1+j)^k*j!*StirlingS2[n, j], {j, 0, n}]; Table[ T[n-k, k], {n, 0, 10}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jan 30 2016 *)
  • PARI
    T(n,k)=sum(j=0,n,(j+1)^k*sum(i=0,j,(-1)^(n+j-i)*binomial(j,i)*(j-i)^n))
    
  • PARI
    T(n,k)=sum(j=0,min(n,k), j!^2*stirling(n+1, j+1, 2)*stirling(k+1, j+1, 2)); \\ Michel Marcus, Mar 05 2017

Formula

pB(k, n) = (-1)^n * Sum[i=0..n, (-1)^i * i! * Stirling2(n, i) / (i+1)^k ].
E.g.f.: e^(x+y) / [e^x + e^y - e^(x+y)].
T(n, k) = Sum_{j=0..n} (j+1)^k*Sum_{i=0..j} (-1)^(n+j-i)*C(j, i)*(j-i)^n. - Paul D. Hanna, Nov 04 2004
n-th row of the array = row sums of n-th power of triangle A210381. - Gary W. Adamson, Mar 21 2012

A130321 Triangle, (2^0, 2^1, 2^2, ...) in every column.

Original entry on oeis.org

1, 2, 1, 4, 2, 1, 8, 4, 2, 1, 16, 8, 4, 2, 1, 32, 16, 8, 4, 2, 1, 64, 32, 16, 8, 4, 2, 1, 128, 64, 32, 16, 8, 4, 2, 1, 256, 128, 64, 32, 16, 8, 4, 2, 1, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1
Offset: 0

Views

Author

Gary W. Adamson, May 24 2007

Keywords

Comments

A130321^2 = A130322. Binomial transform of A130321 = triangle A027649. A007318^2 = A038207 = A007318(n,k) * A130321(n,k); i.e., the square of Pascal's triangle = dot product of Pascal's triangle rows and A130321 rows: A007318^2 = (1; 2,1; 4,4,1; 8,12,6,1;...), where row 3, (8,12,6,1) = (1,3,3,1) dot (8,4,2,1).
Sequence B is called a reverse reluctant sequence of sequence A, if B is triangle array read by rows: row number k lists first k elements of the sequence A in reverse order. Sequence A130321 is the reverse reluctant sequence of sequence of power of 2 (A000079). - Boris Putievskiy, Dec 13 2012
From Wolfdieter Lang, Jan 10 2015: (Start)
This is the Riordan array (1/(1-2*x), x).
Row sums give A000225(n+1) = 2^(n+1) - 1.
Alternating row sums give A001045(n+1).
The inverse Riordan array is (1-2*x, x) = A251635. (End)

Examples

			The triangle T(n,m) begins:
  n\m     0   1   2   3  4  5  6  7  8  9 10 ...
  0:      1
  1:      2   1
  2:      4   2   1
  3:      8   4   2   1
  4:     16   8   4   2  1
  5:     32  16   8   4  2  1
  6:     64  32  16   8  4  2  1
  7:    128  64  32  16  8  4  2  1
  8:    256 128  64  32 16  8  4  2  1
  9:    512 256 128  64 32 16  8  4  2  1
 10:   1024 512 256 128 64 32 16  8  4  2  1
 ... Reformatted. - _Wolfdieter Lang_, Jan 10 2015
		

Crossrefs

Programs

  • Haskell
    a130321 n k = a130321_tabl !! n !! k
    a130321_row n = a130321_tabl !! n
    a130321_tabl = iterate (\row -> (2 * head row) : row) [1]
    -- Reinhard Zumkeller, Feb 27 2013
  • Mathematica
    T[n_, m_] := 2^(n-m);
    Table[T[n, m], {n, 0, 11}, {m, 0, n}] // Flatten (* Jean-François Alcover, Aug 07 2018 *)

Formula

Triangle, (1, 2, 4, 8, ...) in every column. Rows are reversals of A059268 terms.
a(n)=2^m, where m=(t*t + 3*t + 4)/2 - n, t=floor((-1+sqrt(8*n-7))/2). - Boris Putievskiy, Dec 13 2012
From Wolfdieter Lang, Jan 10 2015: (Start)
T(n, m) = 2^(n-m) if n >= m >= 0 and 0 otherwise.
G.f. of row polynomials R(n,x) = Sum_{m=0..n} 2^(n-m)*x^m is 1/((1-2*z)*(1-x*z)) (Riordan property).
G.f. column m (with leading zeros) x^m/(1-2*x), m >= 0.
The diagonal sequences are D(k) = repeat(2^k), k >= 0. (End)

Extensions

More terms from Philippe Deléham, Feb 08 2009

A056182 First differences of A003063.

Original entry on oeis.org

0, 2, 10, 38, 130, 422, 1330, 4118, 12610, 38342, 116050, 350198, 1054690, 3172262, 9533170, 28632278, 85962370, 258018182, 774316690, 2323474358, 6971471650, 20916512102, 62753730610, 188269580438, 564825518530, 1694510110022, 5083597438930, 15250926534518, 45753048039010
Offset: 0

Views

Author

N. J. A. Sloane, Aug 05 2000

Keywords

Comments

Let V be a binary relation on the power set P(A) of a set A having n = |A| elements such that for every element x, y of P(A), xVy if x is a proper subset of y or y is a proper subset of x. Then a(n) = |V|. - Ross La Haye, Dec 22 2006
With regard to the comment by Ross La Haye: For nonempty subsets see a(n+1) in A260217. - If "proper" is omitted see A027649. - For nonempty subsets with "proper" omitted see A091344. - Manfred Boergens, Sep 04 2023
It appears that a(n) is the number of permutations p of 1,..,(n+2) such that max[p(i+1)-p(i)] is 2. For example, for n=1, the permutations (1,3,2) and (2,1,3) and no others have the desired property, so a(1)=2. This approach gives values in agreement with all listed terms. [John W. Layman, Nov 09 2011]
In the terdragon curve, a(n-1) is the number of enclosed unit triangles in expansion level n. - Kevin Ryde, Oct 20 2020

Crossrefs

3rd column of A056151. Cf. A028243 (partial sums).
A002783(n) - 1.
a(n) = A293181(n+1,3).

Programs

  • Maple
    A056182:=n->2 * (3^n - 2^n); seq(A056182(n), n=0..30); # Wesley Ivan Hurt, Feb 10 2014
  • Mathematica
    Table[ -((-1 + k)^(1-k+n)*(-1+k)!)+k^(-k+n)*k! /. k -> 3, {n, 3, 36} ]
    Table[2 (3^n - 2^n), {n, 0, 30}] (* Wesley Ivan Hurt, Feb 10 2014 *)
    CoefficientList[Series[2 x/((2 x - 1) (3 x - 1)), {x, 0, 40}], x] (* Vincenzo Librandi, Feb 12 2014 *)
    LinearRecurrence[{5,-6},{0,2},30] (* Harvey P. Dale, Sep 22 2015 *)

Formula

a(n) = 2 * (3^n - 2^n).
a(n) = 5*a(n-1)-6*a(n-2). G.f.: 2*x/((2*x-1)*(3*x-1)). [Colin Barker, Dec 10 2012]
a(n) = A217764(n,3). - Ross La Haye, Mar 27 2013
a(n) = sum_{i=1..n} binomial(n, i) * 2^(n - i + 1). - Wesley Ivan Hurt, Feb 10 2014
a(n) = 2 * A001047(n). - Wesley Ivan Hurt, Feb 10 2014
E.g.f.: 2*exp(2*x)*(exp(x) - 1). - Stefano Spezia, May 18 2024

Extensions

More terms from Wouter Meeussen, Aug 05 2000

A090888 Matrix defined by a(n,k) = 3^n*Fibonacci(k) - 2^n*Fibonacci(k-2), read by antidiagonals.

Original entry on oeis.org

1, 2, 0, 4, 1, 1, 8, 5, 3, 1, 16, 19, 9, 4, 2, 32, 65, 27, 14, 7, 3, 64, 211, 81, 46, 23, 11, 5, 128, 665, 243, 146, 73, 37, 18, 8, 256, 2059, 729, 454, 227, 119, 60, 29, 13, 512, 6305, 2187, 1394, 697, 373, 192, 97, 47, 21, 1024, 19171, 6561, 4246, 2123, 1151, 600, 311
Offset: 0

Views

Author

Ross La Haye, Feb 12 2004; revised Sep 24 2004, Sep 10 2005

Keywords

Comments

a(0,k) = A000045(k-1); a(1,k) = A000032(k); a(2,k) = A000285(k+1).
a(n,1) = a(n-1,1) + a(n-1,3) for n > 0; a(n,1) = A001047(n) = 2^(2n) - A083324(n); a(n,2) = A000244(n) = 2^(2n) - A005061(n); a(n,3) = 2a(n-1,4) for n > 0; a(n,3) = A027649(n); a(n,4) = A083313(n+1); a(n,5) = A084171(n+1).
Sum[a(n-k,k), {k,0,n}] = A098703(n+1), antidiagonal sums.
Let R, S and T be binary relations on the power set P(A) of a set A having n = |A| elements such that for every element x, y of P(A), xRy if x is a subset of y or y is a subset of x, xSy if x is a subset of y and xTy if x is a proper subset of y. Then a(n,3) = |R|, a(n,2) = |S| and a(n,1) = |T|. Note that a binary relation W on P(A) can be defined also such that for every element x, y of P(A) xWy if x is a proper subset of y and there are no z in P(A) such that x is a proper subset of z and z is a proper subset of y. A090802(n,1) = |W|. Also, a(n,0) = |P(A)|.

Examples

			   1    0    1    1    2    3    5    8    13    21    34
   2    1    3    4    7   11   18   29    47    76   123
   4    5    9   14   23   37   60   97   157   254   411
   8   19   27   46   73  119  192  311   503   814  1317
  16   65   81  146  227  373  600  973  1573  2546  4119
  32  211  243  454  697 1151 1848 2999  4847  7846 12693
  64  665  729 1394 2123 3517 5640 9157 14797 23954 38751
a(5,3) = 454 because Fibonacci(3) = 2, Fibonacci(1) = 1 and (2 * 3^5) - (1 * 2^5) = 454.
		

Programs

  • Mathematica
    Table[3^(n - k) Fibonacci@ k - 2^(n - k) Fibonacci[k - 2], {n, 0, 10}, {k, 0, n}] // Flatten (* Michael De Vlieger, Nov 28 2015 *)

Formula

a(n, k) = 3^n*Fibonacci(k) - 2^n*Fibonacci(k-2).
a(n, 0) = 2^n, a(n, 1) = 3^n - 2^n, a(n, k) = a(n, k-1) + a(n, k-2) for k > 1.
a(0, k) = Fibonacci(k-1), a(1, k) = Lucas(k), a(n, k) = 5a(n-1, k) - 6a(n-2, k) for n > 1.
O.g.f. (by rows) = (-2^n + (2^(n+1) - 3^n)x)/(-1+x+x^2). - Ross La Haye, Mar 30 2006
a(n,1) - a(n,0) = A003063(n+1). - Ross La Haye, Jun 22 2007
Binomial transform (by columns) of A118654. - Ross La Haye, Jun 22 2007

Extensions

More terms from Ray Chandler, Oct 27 2004

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

Original entry on oeis.org

0, 1, 7, 31, 115, 391, 1267, 3991, 12355, 37831, 115027, 348151, 1050595, 3164071, 9516787, 28599511, 85896835, 257887111, 774054547, 2322950071, 6970423075, 20914414951, 62749536307, 188261191831, 564808741315, 1694476555591
Offset: 0

Views

Author

Mario Catalani (mario.catalani(AT)unito.it), Jan 01 2004

Keywords

Comments

Starting with offset 1 = binomial transform of A068293: (1, 6, 18, 42, 90, ...) and double binomial transform of (1, 5, 7, 5, 7, 5, ...). - Gary W. Adamson, Jan 13 2009
Number of pairs (A,B) where A and B are nonempty subsets of {1,2,...,n} and one of these subsets is a subset of the other. - For the case that one of these subsets is a proper subset of the other see a(n+1) in A260217. - If empty subsets are included, see A027649 (all subsets) and A056182 (proper subsets). - Manfred Boergens, Aug 02 2023

Crossrefs

Programs

  • Maple
    a:=n->sum((3^(n-j-1)-2^(n-2-j))*12, j=0..n): seq(a(n), n=-1..24); # Zerinvary Lajos, Feb 11 2007
    with (combinat):a:=n->stirling2(n,3)+stirling2(n+1,3): seq(a(n), n=1..26); # Zerinvary Lajos, Oct 07 2007
  • Mathematica
    Table[Sum[i!i^2 StirlingS2[n, i](-1)^(n - i), {i, 1, n}], {n, 0, 30}]
    Table[2*3^n-3*2^n+1,{n,0,30}] (* or *) LinearRecurrence[{6,-11,6},{0,1,7},30] (* Harvey P. Dale, Dec 31 2013 *)

Formula

a(n) = Sum_{i=1..n} i!*i^2*Stirling2(n,i)*(-1)^(n-i).
From Christian Ballot via R. K. Guy, Jan 13 2009: (Start)
a(n) = 6*a(n-1) - 11*a(n-2) + 6*a(n-3);
G.f.: x*(1+x)/((1-x)*(2-x)*(3-x)). (End)
a(n) = 5*a(n-1) - 6*a(n-2) + 2, a(0)=0, a(1)=1. - Vincenzo Librandi, Nov 25 2010
E.g.f.: exp(x)*(1 - 3*exp(x) + 2*exp(2*x)). - Stefano Spezia, May 18 2024

Extensions

Edited by N. J. A. Sloane, Jan 13 2009 at the suggestion of R. K. Guy; the concise definition was provided by Vladeta Jovovic, Jan 01 2004
Showing 1-10 of 44 results. Next