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

A045618 Partial sums of A000337(n+4), n >= 0.

Original entry on oeis.org

1, 6, 23, 72, 201, 522, 1291, 3084, 7181, 16398, 36879, 81936, 180241, 393234, 851987, 1835028, 3932181, 8388630, 17825815, 37748760, 79691801, 167772186, 352321563, 738197532, 1543503901, 3221225502, 6710886431, 13958643744
Offset: 0

Views

Author

Keywords

Comments

Convolution of A000225(n+1), n >= 0, (partial sums of powers of 2).
Sum of diameters of all nonempty subsets of {1, 2, ..., n+2}. - Charles R Greathouse IV, Nov 21 2011
a(n) is the sum of all the ways of adding the k-tuples of the terms found in A000079(0) to A000079(n). For a(2) the result is (1)+(2)+(4)=7; (1+2)+(2+4)=9; (1+2+4)=7 with 7+9+7=23. - J. M. Bergot, Jun 19 2017

Crossrefs

Cf. A000337.

Programs

  • Mathematica
    Table[Sum[(-1)^(n - k) k (-1)^(n - k) Binomial[n + 2, k + 2], {k, 0, n}], {n, 1, 28}] (* Zerinvary Lajos, Jul 08 2009 *)
    Rest[Accumulate[LinearRecurrence[{5,-8,4},{0,1,5},40]]] (* Harvey P. Dale, Dec 19 2011 *)
    CoefficientList[Series[1/((1 - x)^2 (1 - 2 x)^2), {x, 0, 30}], x] (* Vincenzo Librandi, Jul 22 2014 *)
    LinearRecurrence[{6, -13, 12, -4},{1, 6, 23, 72},28] (* Ray Chandler, Aug 03 2015 *)
  • PARI
    a(n)=(n-1)<<(n+2)+n+5 \\ Charles R Greathouse IV, Nov 21 2011

Formula

a(n) = n + 5 + (n-1)*2^(n+2).
G.f.: 1/((1-2*x)*(1-x))^2.
a(n) = Sum_{i=0...n+1} (2^(n+2-i) - 1)*(2^i - 1). - J. M. Bergot, Sep 16 2017
a(n) = Sum_{k=0..n+2} Sum_{i=0..n+2} (i-k) * C(n-k+2,i). - Wesley Ivan Hurt, Sep 19 2017
a(n) = 4*a(n-1) - 4*a(n-2) + n + 1, with a(-1) = a(-2) = 0. - Jesse Fiedler, Aug 20 2019
E.g.f.: exp(x)*(5 + x + exp(x)*(- 4 + 8*x)). - Stefano Spezia, Aug 20 2019
a(n) = Sum_{k=0..n} Stirling2(k+2,2) * Stirling2(n-k+2,2). - Seiichi Manyama, May 12 2025

A104746 Array T(n,k) read by antidiagonals: T(1,k) = 2^k-1 and recursively T(n,k) = T(n-1,k) + A000337(k-1), n,k >= 1.

Original entry on oeis.org

1, 1, 3, 1, 4, 7, 1, 5, 12, 15, 1, 6, 17, 32, 31, 1, 7, 22, 49, 80, 63, 1, 8, 27, 66, 129, 192, 127, 1, 9, 32, 83, 178, 321, 448, 255, 1, 10, 37, 100, 227, 450, 769, 1024, 511, 1, 11, 42, 117, 276, 579, 1090, 1793, 2304, 1023, 1, 12, 47, 134, 325, 708, 1411, 2562, 4097, 5120, 2047, 1, 13, 52, 151, 374, 837, 1732, 3331, 5890, 9217, 11264, 4095
Offset: 1

Views

Author

Gary W. Adamson, Mar 23 2005

Keywords

Comments

Generally, row n of the array is the binomial transform for 0, 1, n, 2n-1, 3n-2, 4n-3, ...

Examples

			To the first row, add the terms 0, 1, 5, 17, 49, 129, ... as indicated:
  1, 3,  7, 15, 31,  63, ...
  0, 1,  5, 17, 49, 129, ... (getting row 2 of the array:
  1, 4, 12, 32, 80, 192, ... (= A001787, binomial transform for 1,2,3, ...)
Repeat the operation, getting the following array T(n,k):
  1, 3,  7, 15,  31,  63, ...
  1, 4, 12, 32,  80, 192, ...
  1, 5, 17, 49, 129, 321, ...
  1, 6, 22, 66, 178, 450, ...
		

Crossrefs

Cf. A104747 (antidiagonal sums), A001787, A000337, A027992, A059823.

Programs

  • Maple
    A000337 := proc(n)
            1+(n-1)*2^n ;
    end proc:
    A104746 := proc(n,k)
            option remember;
            if n=  1 then
                    2^k-1 ;
            else
                    procname(n-1,k)+A000337(k-1) ;
            end if;
    end proc:
    for d from 1 to 12 do
            for k from 1 to d do
                    n := d-k+1 ;
                    printf("%d,",A104746(n,k)) ;
            end do:
    end do; # R. J. Mathar, Oct 30 2011
  • Mathematica
    A000337[n_] := (n - 1)*2^n + 1;
    T[1, k_] := 2^k - 1;
    T[n_, k_] := T[n, k] = T[n - 1, k] + A000337[k - 1];
    Table[T[n - k + 1, k], {n, 1, 12}, {k, 1, n}] // Flatten (* Jean-François Alcover, Mar 30 2024 *)

Formula

T(2,k) = A001787(k), binomial transform of 0, 1, 2, 3, 4, 5, 6, ...
T(3,k) = A000337(k), binomial transform of 0, 1, 3, 5, 7, 9, 11, ...
T(4,k) = A027992(k-1), binomial transform of 0, 1, 4, 7, 10, 13, 16, 19, 22, 25, ...
T(5,k) = binomial transform of 0, 1, 5, 9, 13, 17, 21, 25, 29, ...

Extensions

Terms corrected by R. J. Mathar, Oct 30 2011

A082753 Duplicate of A000337.

Original entry on oeis.org

0, 1, 5, 17, 49, 129, 321, 769, 1793, 4097, 9217, 20481, 45057, 98305, 212993
Offset: 1

Views

Author

Keywords

A119531 Primes in A000337.

Original entry on oeis.org

5, 17, 769, 3489660929, 112589990684262401, 1945555039024054273, 193428131138340667952988161
Offset: 1

Views

Author

Jorge Coveiro, Jul 27 2006

Keywords

Comments

Next two terms are too big to include, see A128001.

Formula

a(n) = A000337(A128001(n)). - R. J. Mathar, Oct 10 2011

Extensions

Clearer (but incorrect) definition from R. J. Mathar, Jan 27 2008, corrected Oct 10 2011

A001787 a(n) = n*2^(n-1).

Original entry on oeis.org

0, 1, 4, 12, 32, 80, 192, 448, 1024, 2304, 5120, 11264, 24576, 53248, 114688, 245760, 524288, 1114112, 2359296, 4980736, 10485760, 22020096, 46137344, 96468992, 201326592, 419430400, 872415232, 1811939328, 3758096384, 7784628224, 16106127360, 33285996544
Offset: 0

Views

Author

Keywords

Comments

Number of edges in an n-dimensional hypercube.
Number of 132-avoiding permutations of [n+2] containing exactly one 123 pattern. - Emeric Deutsch, Jul 13 2001
Number of ways to place n-1 nonattacking kings on a 2 X 2(n-1) chessboard for n >= 2. - Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), May 22 2001
Arithmetic derivative of 2^n: a(n) = A003415(A000079(n)). - Reinhard Zumkeller, Feb 26 2002
(-1) times the determinant of matrix A_{i,j} = -|i-j|, 0 <= i,j <= n.
a(n) is the number of ones in binary numbers 1 to 111...1 (n bits). a(n) = A000337(n) - A000337(n-1) for n = 2,3,... . - Emeric Deutsch, May 24 2003
The number of 2 X n 0-1 matrices containing n+1 1's and having no zero row or column. The number of spanning trees of the complete bipartite graph K(2,n). This is the case m = 2 of K(m,n). See A072590. - W. Edwin Clark, May 27 2003
Binomial transform of 0,1,2,3,4,5,... (A001477). Without the initial 0, binomial transform of odd numbers.
With an additional leading zero, [0,0,1,4,...] this is the binomial transform of the integers repeated A004526. Its formula is then (2^n*(n-1) + 0^n)/4. - Paul Barry, May 20 2003
Number of zeros in all different (n+1)-bit integers. - Ralf Stephan, Aug 02 2003
From Lekraj Beedassy, Jun 03 2004: (Start)
Final element of a summation table (as opposed to a difference table) whose first row consists of integers 0 through n (or first n+1 nonnegative integers A001477); illustrating the case n=5:
0 1 2 3 4 5
1 3 5 7 9
4 8 12 16
12 20 28
32 48
80
and the final element is a(5)=80. (End)
This sequence and A001871 arise in counting ordered trees of height at most k where only the rightmost branch at the root actually achieves this height and the count is by the number of edges, with k = 3 for this sequence and k = 4 for A001871.
Let R be a binary relation on the power set P(A) of a set A having n = |A| elements such that for all elements x,y of P(A), xRy 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. Then a(n) = |R|. - Ross La Haye, Sep 21 2004
Number of 2 X n binary matrices avoiding simultaneously the right-angled numbered polyomino patterns (ranpp) (00;1) and (10;1). An occurrence of a ranpp (xy;z) in a matrix A=(a(i,j)) is a triple (a(i1,j1), a(i1,j2), a(i2,j1)) where i1 < i2, j1 < j2 and these elements are in same relative order as those in the triple (x,y,z). - Sergey Kitaev, Nov 11 2004
Number of subsequences 00 in all binary words of length n+1. Example: a(2)=4 because in 000,001,010,011,100,101,110,111 the sequence 00 occurs 4 times. - Emeric Deutsch, Apr 04 2005
If you expand the n-factor expression (a+1)*(b+1)*(c+1)*...*(z+1), there are a(n) variables in the result. For example, the 3-factor expression (a+1)*(b+1)*(c+1) expands to abc+ab+ac+bc+a+b+c+1 with a(3) = 12 variables. - David W. Wilson, May 08 2005
An inverse Chebyshev transform of n^2, where g(x)->(1/sqrt(1-4*x^2))*g(x*c(x^2)), c(x) the g.f. of A000108. - Paul Barry, May 13 2005
Sequences A018215 and A058962 interleaved. - Graeme McRae, Jul 12 2006
The number of never-decreasing positive integer sequences of length n with a maximum value of 2*n. - Ben Paul Thurston, Nov 13 2006
Total size of all the subsets of an n-element set. For example, a 2-element set has 1 subset of size 0, 2 subsets of size 1 and 1 of size 2. - Ross La Haye, Dec 30 2006
Convolution of the natural numbers [A000027] and A045623 beginning [0,1,2,5,...]. - Ross La Haye, Feb 03 2007
If M is the matrix (given by rows) [2,1;0,2] then the sequence gives the (1,2) entry in M^n. - Antonio M. Oller-Marcén, May 21 2007
If X_1,X_2,...,X_n is a partition of a 2n-set X into 2-blocks then, for n > 0, a(n) is equal to the number of (n+1)-subsets of X intersecting each X_i (i=1,2,...,n). - Milan Janjic, Jul 21 2007
Number of n-permutations of 3 objects u,v,w, with repetition allowed, containing exactly one u. Example: a(2)=4 because we have uv, vu, uw and wu. - Zerinvary Lajos, Dec 27 2007
A member of the family of sequences defined by a(n) = n*[c(1)*...*c(r)]^(n-1); c(i) integer. This sequence has c(1)=2, A027471 has c(1)=3. - Ctibor O. Zizka, Feb 23 2008
a(n) is the number of ways to split {1,2,...,n-1} into two (possibly empty) complementary intervals {1,2,...,i} and {i+1,i+2,...,n-1} and then select a subset from each interval. - Geoffrey Critzer, Jan 31 2009
Equals the Jacobsthal sequence A001045 convolved with A003945: (1, 3, 6, 12, ...). - Gary W. Adamson, May 23 2009
Starting with offset 1 = A059570: (1, 2, 6, 14, 34, ...) convolved with (1, 2, 2, 2, ...). - Gary W. Adamson, May 23 2009
Equals the first left hand column of A167591. - Johannes W. Meijer, Nov 12 2009
The number of tatami tilings of an n X n square with n monomers is n*2^(n-1). - Frank Ruskey, Sep 25 2010
Under T. D. Noe's variant of the hypersigma function, this sequence gives hypersigma(2^n): a(n) = A191161(A000079(n)). - Alonso del Arte, Nov 04 2011
Number of Dyck (n+2)-paths with exactly one valley at height 1 and no higher valley. - David Scambler, Nov 07 2011
Equals triangle A059260 * A016777 as a vector, where A016777 = (3n + 1): [1, 4, 7, 10, 13, ...]. - Gary W. Adamson, Mar 06 2012
Main transitions in systems of n particles with spin 1/2 (see A212697 with b=2). - Stanislav Sykora, May 25 2012
Let T(n,k) be the triangle with (first column) T(n,1) = 2*n-1 for n >= 1, otherwise T(n,k) = T(n,k-1) + T(n-1,k-1), then a(n) = T(n,n). - J. M. Bergot, Jan 17 2013
Sum of all parts of all compositions (ordered partitions) of n. The equivalent sequence for partitions is A066186. - Omar E. Pol, Aug 28 2013
Starting with a(1)=1: powers of 2 (A000079) self-convolved. - Bob Selcoe, Aug 05 2015
Coefficients of the series expansion of the normalized Schwarzian derivative -S{p(x)}/6 of the polynomial p(x) = -(x-x1)*(x-x2) with x1 + x2 = 1 (cf. A263646). - Tom Copeland, Nov 02 2015
a(n) is the number of North-East lattice paths from (0,0) to (n+1,n+1) that have exactly one east step below y = x-1 and no east steps above y = x+1. Details can be found in Pan and Remmel's link. - Ran Pan, Feb 03 2016
Also the number of maximal and maximum cliques in the n-hypercube graph for n > 0. - Eric W. Weisstein, Dec 01 2017
Let [n]={1,2,...,n}; then a(n-1) is the total number of elements missing in proper subsets of [n] that contain n to form [n]. For example, for n = 3, a(2) = 4 since the proper subsets of [3] that contain 3 are {3}, {1,3}, {2,3} and the total number of elements missing in these subsets to form [3] is 4: 2 in the first subset, 1 in the second, and 1 in the third. - Enrique Navarrete, Aug 08 2020
Number of 3-permutations of n elements avoiding the patterns 132, 231. See Bonichon and Sun. - Michel Marcus, Aug 19 2022

Examples

			a(2)=4 since 2314, 2341,3124 and 4123 are the only 132-avoiding permutations of 1234 containing exactly one increasing subsequence of length 3.
x + 4*x^2 + 12*x^3 + 32*x^4 + 80*x^5 + 192*x^6 + 448*x^7 + ...
a(5) = 1*0 + 5*1 + 10*2 + 10*3 + 5*4 + 1*5 = 80, with 1,5,10,10,5,1 the 5th row of Pascal's triangle. - _J. M. Bergot_, Apr 29 2014
		

References

  • M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 796.
  • A. T. Benjamin and J. J. Quinn, Proofs that really count: the art of combinatorial proof, M.A.A. 2003, id. 131.
  • Clifford A. Pickover, The Math Book, From Pythagoras to the 57th Dimension, 250 Milestones in the History of Mathematics, Sterling Publ., NY, 2009, page 282.
  • 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

Three other versions, essentially identical, are A085750, A097067, A118442.
Partial sums of A001792.
A058922(n+1) = 4*A001787(n).
Equals A090802(n, 1).
Column k=1 of A038207.
Row sums of A003506, A322427, A322428.

Programs

  • Haskell
    a001787 n = n * 2 ^ (n - 1)
    a001787_list = zipWith (*) [0..] $ 0 : a000079_list
    -- Reinhard Zumkeller, Jul 11 2014
    
  • Magma
    [n*2^(n-1): n in [0..40]]; // Vincenzo Librandi, Feb 04 2016
    
  • Maple
    spec := [S, {B=Set(Z, 0 <= card), S=Prod(Z, B, B)}, labeled]: seq(combstruct[count](spec, size=n), n=0..29); # Zerinvary Lajos, Oct 09 2006
    A001787:=1/(2*z-1)^2; # Simon Plouffe in his 1992 dissertation, dropping the initial zero
  • Mathematica
    Table[Sum[Binomial[n, i] i, {i, 0, n}], {n, 0, 30}] (* Geoffrey Critzer, Mar 18 2009 *)
    f[n_] := n 2^(n - 1); f[Range[0, 40]] (* Vladimir Joseph Stephan Orlovsky, Feb 09 2011 *)
    Array[# 2^(# - 1) &, 40, 0] (* Harvey P. Dale, Jul 26 2011 *)
    Join[{0}, Table[n 2^(n - 1), {n, 20}]] (* Eric W. Weisstein, Dec 01 2017 *)
    Join[{0}, LinearRecurrence[{4, -4}, {1, 4}, 20]] (* Eric W. Weisstein, Dec 01 2017 *)
    CoefficientList[Series[x/(-1 + 2 x)^2, {x, 0, 20}], x] (* Eric W. Weisstein, Dec 01 2017 *)
  • PARI
    {a(n) = if( n<0, 0, n * 2^(n-1))}
    
  • PARI
    concat(0, Vec(x/(1-2*x)^2 + O(x^50))) \\ Altug Alkan, Nov 03 2015
    
  • Python
    def A001787(n): return n*(1<Chai Wah Wu, Nov 14 2022

Formula

a(n) = Sum_{k=1..n} k*binomial(n, k). - Benoit Cloitre, Dec 06 2002
E.g.f.: x*exp(2x). - Paul Barry, Apr 10 2003
G.f.: x/(1-2*x)^2.
G.f.: x / (1 - 4*x / (1 + x / (1 - x))). - Michael Somos, Apr 07 2012
A108666(n) = Sum_{k=0..n} binomial(n, k)^2 * a(n). - Michael Somos, Apr 07 2012
PSumSIGN transform of A053220. PSumSIGN transform is A045883. Binomial transform is A027471(n+1). - Michael Somos, Jul 10 2003
Starting at a(1)=1, INVERT transform is A002450, INVERT transform of A049072, MOBIUS transform of A083413, PSUM transform is A000337, BINOMIAL transform is A081038, BINOMIAL transform of A005408. - Michael Somos, Apr 07 2012
a(n) = 2*a(n-1)+2^(n-1).
a(2*n) = n*4^n, a(2*n+1) = (2*n+1)4^n.
G.f.: x/det(I-x*M) where M=[1,i;i,1], i=sqrt(-1). - Paul Barry, Apr 27 2005
Starting 1, 1, 4, 12, ... this is 0^n + n2^(n-1), the binomial transform of the 'pair-reversed' natural numbers A004442. - Paul Barry, Jul 24 2003
Convolution of [1, 2, 4, 8, ...] with itself. - Jon Perry, Aug 07 2003
The signed version of this sequence, n(-2)^(n-1), is the inverse binomial transform of n(-1)^(n-1) (alternating sign natural numbers). - Paul Barry, Aug 20 2003
a(n-1) = (Sum_{k=0..n} 2^(n-k-1)*C(n-k, k)*C(1,(k+1)/2)*(1-(-1)^k)/2) - 0^n/4. - Paul Barry, Oct 15 2004
a(n) = Sum_{k=0..floor(n/2)} binomial(n, k)(n-2k)^2. - Paul Barry, May 13 2005
a(n+2) = A049611(n+2) - A001788(n).
a(n) = n! * Sum_{k=0..n} 1/((k - 1)!(n - k)!). - Paul Barry, Mar 26 2003
a(n+1) = Sum_{k=0..n} 4^k * A109466(n,k). - Philippe Deléham, Nov 13 2006
Row sums of A130300 starting (1, 4, 12, 32, ...). - Gary W. Adamson, May 20 2007
Equals row sums of triangle A134083. Equals A002064(n) + (2^n - 1). - Gary W. Adamson, Oct 07 2007
a(n) = 4*a(n-1) - 4*a(n-2), a(0)=0, a(1)=1. - Philippe Deléham, Nov 16 2008
Sum_{n>0} 1/a(n) = 2*log(2). - Jaume Oliver Lafont, Feb 10 2009
a(n) = A000788(A000225(n)) = A173921(A000225(n)). - Reinhard Zumkeller, Mar 04 2010
a(n) = n * A011782(n). - Omar E. Pol, Aug 28 2013
a(n-1) = Sum_{t_1+2*t_2+...+n*t_n=n} (t_1+t_2+...+t_n-1)*multinomial(t_1+t_2 +...+t_n,t_1,t_2,...,t_n). - Mircea Merca, Dec 06 2013
a(n+1) = Sum_{r=0..n} (2*r+1)*C(n,r). - J. M. Bergot, Apr 07 2014
a(n) = A007283(n)*n/6. - Enxhell Luzhnica, Apr 16 2016
a(n) = (A000225(n) + A000337(n))/2. - Anton Zakharov, Sep 17 2016
Sum_{n>0} (-1)^(n+1)/a(n) = 2*log(3/2) = 2*A016578. - Ilya Gutkovskiy, Sep 17 2016
a(n) = Sum_{k=0..n-1} Sum_{i=0..n-1} (i+1) * C(k,i). - Wesley Ivan Hurt, Sep 21 2017
a(n) = Sum_{i=1..n} Sum_{j=1..n} phi(i)*binomial(n, i*j). - Ridouane Oudra, Feb 17 2024

A000295 Eulerian numbers (Euler's triangle: column k=2 of A008292, column k=1 of A173018).

Original entry on oeis.org

0, 0, 1, 4, 11, 26, 57, 120, 247, 502, 1013, 2036, 4083, 8178, 16369, 32752, 65519, 131054, 262125, 524268, 1048555, 2097130, 4194281, 8388584, 16777191, 33554406, 67108837, 134217700, 268435427, 536870882, 1073741793, 2147483616, 4294967263, 8589934558
Offset: 0

Views

Author

Keywords

Comments

There are 2 versions of Euler's triangle:
* A008292 Classic version of Euler's triangle used by Comtet (1974).
* A173018 Version of Euler's triangle used by Graham, Knuth and Patashnik in Concrete Math. (1990).
Euler's triangle rows and columns indexing conventions:
* A008292 The rows and columns of the Eulerian triangle are both indexed starting from 1. (Classic version: used in the classic books by Riordan and Comtet.)
* A173018 The rows and columns of the Eulerian triangle are both indexed starting from 0. (Graham et al.)
Number of Dyck paths of semilength n having exactly one long ascent (i.e., ascent of length at least two). Example: a(4)=11 because among the 14 Dyck paths of semilength 4, the paths that do not have exactly one long ascent are UDUDUDUD (no long ascent), UUDDUUDD and UUDUUDDD (two long ascents). Here U=(1,1) and D=(1,-1). Also number of ordered trees with n edges having exactly one branch node (i.e., vertex of outdegree at least two). - Emeric Deutsch, Feb 22 2004
Number of permutations of {1,2,...,n} with exactly one descent (i.e., permutations (p(1),p(2),...,p(n)) such that #{i: p(i)>p(i+1)}=1). E.g., a(3)=4 because the permutations of {1,2,3} with one descent are 132, 213, 231 and 312.
a(n+1) is the convolution of nonnegative integers (A001477) and powers of two (A000079). - Graeme McRae, Jun 07 2006
Partial sum of main diagonal of A125127. - Jonathan Vos Post, Nov 22 2006
Number of partitions of an n-set having exactly one block of size > 1. Example: a(4)=11 because, if the partitioned set is {1,2,3,4}, then we have 1234, 123|4, 124|3, 134|2, 1|234, 12|3|4, 13|2|4, 14|2|3, 1|23|4, 1|24|3 and 1|2|34. - Emeric Deutsch, Oct 28 2006
k divides a(k+1) for k in A014741. - Alexander Adamchuk, Nov 03 2006
(Number of permutations avoiding patterns 321, 2413, 3412, 21534) minus one. - Jean-Luc Baril, Nov 01 2007, Mar 21 2008
The chromatic invariant of the prism graph P_n for n >= 3. - Jonathan Vos Post, Aug 29 2008
Decimal integer corresponding to the result of XORing the binary representation of 2^n - 1 and the binary representation of n with leading zeros. This sequence and a few others are syntactically similar. For n > 0, let D(n) denote the decimal integer corresponding to the binary number having n consecutive 1's. Then D(n).OP.n represents the n-th term of a sequence when .OP. stands for a binary operator such as '+', '-', '*', 'quotentof', 'mod', 'choose'. We then get the various sequences A136556, A082495, A082482, A066524, A000295, A052944. Another syntactically similar sequence results when we take the n-th term as f(D(n)).OP.f(n). For example if f='factorial' and .OP.='/', we get (A136556)(A000295) ; if f='squaring' and .OP.='-', we get (A000295)(A052944). - K.V.Iyer, Mar 30 2009
Chromatic invariant of the prism graph Y_n.
Number of labelings of a full binary tree of height n-1, such that each path from root to any leaf contains each label from {1,2,...,n-1} exactly once. - Michael Vielhaber (vielhaber(AT)gmail.com), Nov 18 2009
Also number of nontrivial equivalence classes generated by the weak associative law X((YZ)T)=(X(YZ))T on words with n open and n closed parentheses. Also the number of join (resp. meet)-irreducible elements in the pruning-grafting lattice of binary trees with n leaves. - Jean Pallo, Jan 08 2010
Nonzero terms of this sequence can be found from the row sums of the third sub-triangle extracted from Pascal's triangle as indicated below by braces:
1;
1, 1;
{1}, 2, 1;
{1, 3}, 3, 1;
{1, 4, 6}, 4, 1;
{1, 5, 10, 10}, 5, 1;
{1, 6, 15, 20, 15}, 6, 1;
... - L. Edson Jeffery, Dec 28 2011
For integers a, b, denote by a<+>b the least c >= a, such that the Hamming distance D(a,c) = b (note that, generally speaking, a<+>b differs from b<+>a). Then for n >= 3, a(n) = n<+>n. This has a simple explanation: for n >= 3 in binary we have a(n) = (2^n-1)-n = "anti n". - Vladimir Shevelev, Feb 14 2012
a(n) is the number of binary sequences of length n having at least one pair 01. - Branko Curgus, May 23 2012
Nonzero terms are those integers k for which there exists a perfect (Hamming) error-correcting code. - L. Edson Jeffery, Nov 28 2012
a(n) is the number of length n binary words constructed in the following manner: Select two positions in which to place the first two 0's of the word. Fill in all (possibly none) of the positions before the second 0 with 1's and then complete the word with an arbitrary string of 0's or 1's. So a(n) = Sum_{k=2..n} (k-1)*2^(n-k). - Geoffrey Critzer, Dec 12 2013
Without first 0: a(n)/2^n equals Sum_{k=0..n} k/2^k. For example: a(5)=57, 57/32 = 0/1 + 1/2 + 2/4 + 3/8 + 4/16 + 5/32. - Bob Selcoe, Feb 25 2014
The first barycentric coordinate of the centroid of the first n rows of Pascal's triangle, assuming the numbers are weights, is A000295(n+1)/A000337(n). See attached figure. - César Eliud Lozada, Nov 14 2014
Starting (0, 1, 4, 11, ...), this is the binomial transform of (0, 1, 2, 2, 2, ...). - Gary W. Adamson, Jul 27 2015
Also the number of (non-null) connected induced subgraphs in the n-triangular honeycomb rook graph. - Eric W. Weisstein, Aug 27 2017
a(n) is the number of swaps needed in the worst case to transform a binary tree with n full levels into a heap, using (bottom-up) heapify. - Rudy van Vliet, Sep 19 2017
The utility of large networks, particularly social networks, with n participants is given by the terms a(n) of this sequence. This assertion is known as Reed's Law, see the Wikipedia link. - Johannes W. Meijer, Jun 03 2019
a(n-1) is the number of subsets of {1..n} in which the largest element of the set exceeds by at least 2 the next largest element. For example, for n = 5, a(4) = 11 and the 11 sets are {1,3}, {1,4}, {1,5}, {2,4}, {2,5}, {3,5}, {1,2,4}, {1,2,5}, {1,3,5}, {2,3,5}, {1,2,3,5}. - Enrique Navarrete, Apr 08 2020
a(n-1) is also the number of subsets of {1..n} in which the second smallest element of the set exceeds by at least 2 the smallest element. For example, for n = 5, a(4) = 11 and the 11 sets are {1,3}, {1,4}, {1,5}, {2,4}, {2,5}, {3,5}, {1,3,4}, {1,3,5}, {1,4,5}, {2,4,5}, {1,3,4,5}. - Enrique Navarrete, Apr 09 2020
a(n+1) is the sum of the smallest elements of all subsets of {1..n}. For example, for n=3, a(4)=11; the subsets of {1,2,3} are {1}, {2}, {3}, {1,2}, {1,3}, {2,3}, {1,2,3}, and the sum of smallest elements is 11. - Enrique Navarrete, Aug 20 2020
Number of subsets of an n-set that have more than one element. - Eric M. Schmidt, Mar 13 2021
Number of individual bets in a "full cover" bet on n-1 horses, dogs, etc. in different races. Each horse, etc. can be bet on or not, giving 2^n bets. But, by convention, singles (a bet on only one race) are not included, reducing the total number bets by n. It is also impossible to bet on no horses at all, reducing the number of bets by another 1. A full cover on 4 horses, dogs, etc. is therefore 6 doubles, 4 trebles and 1 four-horse etc. accumulator. In British betting, such a bet on 4 horses etc. is a Yankee; on 5, a super-Yankee. - Paul Duckett, Nov 17 2021
From Enrique Navarrete, May 25 2022: (Start)
Number of binary sequences of length n with at least two 1's.
a(n-1) is the number of ways to choose an odd number of elements greater than or equal to 3 out of n elements.
a(n+1) is the number of ways to split [n] = {1,2,...,n} into two (possibly empty) complementary intervals {1,2,...,i} and {i+1,i+2,...,n} and then select a subset from the first interval (2^i choices, 0 <= i <= n), and one block/cell (i.e., subinterval) from the second interval (n-i choices, 0 <= i <= n).
(End)
Number of possible conjunctions in a system of n planets; for example, there can be 0 conjunctions with one planet, one with two planets, four with three planets (three pairs of planets plus one with all three) and so on. - Wendy Appleby, Jan 02 2023
Largest exponent m such that 2^m divides (2^n-1)!. - Franz Vrabec, Aug 18 2023
It seems that a(n-1) is the number of odd r with 0 < r < 2^n for which there exist u,v,w in the x-independent beginning of the Collatz trajectory of 2^n x + r with u+v = w+1, as detailed in the link "Collatz iteration and Euler numbers?". A better understanding of this might also give a formula for A374527. - Markus Sigg, Aug 02 2024
This sequence has a connection to consecutively halved positional voting (CHPV); see Mendenhall and Switkay. - Hal M. Switkay, Feb 25 2025
a(n) is the number of subsets of size 2 and more of an n-element set. Equivalently, a(n) is the number of (hyper)edges of size 2 and more in a complete hypergraph of n vertices. - Yigit Oktar, Apr 05 2025

Examples

			G.f. = x^2 + 4*x^3 + 11*x^4 + 26*x^5 + 57*x^6 + 120*x^7 + 247*x^8 + 502*x^9 + ...
		

References

  • O. Bottema, Problem #562, Nieuw Archief voor Wiskunde, 28 (1980) 115.
  • L. Comtet, "Permutations by Number of Rises; Eulerian Numbers." Section 6.5 in Advanced Combinatorics: The Art of Finite and Infinite Expansions, rev. enl. ed. Dordrecht, Netherlands: Reidel, pp. 51 and 240-246, 1974.
  • F. N. David and D. E. Barton, Combinatorial Chance. Hafner, NY, 1962, p. 151.
  • R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics. Addison-Wesley, Reading, MA, 1990.
  • D. E. Knuth, The Art of Computer Programming. Addison-Wesley, Reading, MA, Vol. 3, p. 34.
  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 215.
  • 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

Cf. A008292 (classic version of Euler's triangle used by Comtet (1974)).
Cf. A173018 (version of Euler's triangle used by Graham, Knuth and Patashnik in Concrete Math. (1990)).
Cf. A002662 (partial sums).
Partial sums of A000225.
Row sums of A014473 and of A143291.
Second column of triangles A112493 and A112500.
Sequences A125128 and A130103 are essentially the same.
Column k=1 of A124324.

Programs

  • Haskell
    a000295 n = 2^n - n - 1  -- Reinhard Zumkeller, Nov 25 2013
    
  • Magma
    [2^n-n-1: n in [0..40]]; // Vincenzo Librandi, Jul 29 2015
    
  • Magma
    [EulerianNumber(n, 1): n in [0..40]]; // G. C. Greubel, Oct 02 2024
    
  • Maple
    [ seq(2^n-n-1, n=1..50) ];
    A000295 := -z/(2*z-1)/(z-1)**2; # Simon Plouffe in his 1992 dissertation
    # Grammar specification:
    spec := [S, { B = Set(Z, 1 <= card), C = Sequence(B, 2 <= card), S = Prod(B, C) }, unlabeled]:
    struct := n -> combstruct[count](spec, size = n+1);
    seq(struct(n), n = 0..33); # Peter Luschny, Jul 22 2014
  • Mathematica
    a[n_] = If[n==0, 0, n*(HypergeometricPFQ[{1, 1-n}, {2}, -1] - 1)];
    Table[a[n], {n,0,40}] (* Olivier Gérard, Mar 29 2011 *)
    LinearRecurrence[{4, -5, 2}, {0, 0, 1}, 40] (* Vincenzo Librandi, Jul 29 2015 *)
    Table[2^n -n-1, {n,0,40}] (* Eric W. Weisstein, Nov 16 2017 *)
  • PARI
    a(n)=2^n-n-1 \\ Charles R Greathouse IV, Jun 10 2011
    
  • SageMath
    [2^n -(n+1) for n in range(41)] # G. C. Greubel, Oct 02 2024

Formula

a(n) = 2^n - n - 1.
G.f.: x^2/((1-2*x)*(1-x)^2).
A107907(a(n+2)) = A000079(n+2). - Reinhard Zumkeller, May 28 2005
E.g.f.: exp(x)*(exp(x)-1-x). - Emeric Deutsch, Oct 28 2006
a(0)=0, a(1)=0, a(n) = 3*a(n-1) - 2*a(n-2) + 1. - Miklos Kristof, Mar 09 2005
a(0)=0, a(n) = 2*a(n-1) + n - 1 for all n in Z.
a(n) = Sum_{k=2..n} binomial(n, k). - Paul Barry, Jun 05 2003
a(n+1) = Sum_{i=1..n} Sum_{j=1..i} C(i, j). - Benoit Cloitre, Sep 07 2003
a(n+1) = 2^n*Sum_{k=0..n} k/2^k. - Benoit Cloitre, Oct 26 2003
a(0)=0, a(1)=0, a(n) = Sum_{i=0..n-1} i+a(i) for i > 1. - Gerald McGarvey, Jun 12 2004
a(n+1) = Sum_{k=0..n} (n-k)*2^k. - Paul Barry, Jul 29 2004
a(n) = Sum_{k=0..n} binomial(n, k+2); a(n+2) = Sum_{k=0..n} binomial(n+2, k+2). - Paul Barry, Aug 23 2004
a(n) = Sum_{k=0..floor((n-1)/2)} binomial(n-k-1, k+1)*2^(n-k-2)*(-1/2)^k. - Paul Barry, Oct 25 2004
a(0) = 0; a(n) = Stirling2(n,2) + a(n-1) = A000225(n-1) + a(n-1). - Thomas Wieder, Feb 18 2007
a(n) = A000325(n) - 1. - Jonathan Vos Post, Aug 29 2008
a(0) = 0, a(n) = Sum_{k=0..n-1} 2^k - 1. - Doug Bell, Jan 19 2009
a(n) = A000217(n-1) + A002662(n) for n>0. - Geoffrey Critzer, Feb 11 2009
a(n) = A000225(n) - n. - Zerinvary Lajos, May 29 2009
a(n) = n*(2F1([1,1-n],[2],-1) - 1). - Olivier Gérard, Mar 29 2011
Column k=1 of A173018 starts a'(n) = 0, 1, 4, 11, ... and has the hypergeometric representation n*hypergeom([1, -n+1], [-n], 2). This can be seen as a formal argument to prefer Euler's A173018 over A008292. - Peter Luschny, Sep 19 2014
E.g.f.: exp(x)*(exp(x)-1-x); this is U(0) where U(k) = 1 - x/(2^k - 2^k/(x + 1 - x^2*2^(k+1)/(x*2^(k+1) - (k+1)/U(k+1)))); (continued fraction, 3rd kind, 4-step). - Sergei N. Gladkovskii, Dec 01 2012
a(n) = A079583(n) - A000225(n+1). - Miquel Cerda, Dec 25 2016
a(0) = 0; a(1) = 0; for n > 1: a(n) = Sum_{i=1..2^(n-1)-1} A001511(i). - David Siegers, Feb 26 2019
a(n) = A007814(A028366(n)). - Franz Vrabec, Aug 18 2023
a(n) = Sum_{k=1..floor((n+1)/2)} binomial(n+1, 2*k+1). - Taras Goy, Jan 02 2025

A008574 a(0) = 1, thereafter a(n) = 4n.

Original entry on oeis.org

1, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, 80, 84, 88, 92, 96, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144, 148, 152, 156, 160, 164, 168, 172, 176, 180, 184, 188, 192, 196, 200, 204, 208, 212, 216, 220, 224, 228, 232
Offset: 0

Views

Author

N. J. A. Sloane; entry revised Aug 24 2014

Keywords

Comments

Number of squares on the perimeter of an (n+1) X (n+1) board. - Jon Perry, Jul 27 2003
Coordination sequence for square lattice (or equivalently the planar net 4.4.4.4).
Apparently also the coordination sequence for the planar net 3.4.6.4. - Darrah Chavey, Nov 23 2014
From N. J. A. Sloane, Nov 26 2014: (Start)
I confirm that this is indeed the coordination sequence for the planar net 3.4.6.4. The points at graph distance n from a fixed point in this net essentially lie on a hexagon (see illustration in link).
If n = 3k, k >= 1, there are 2k + 1 nodes on each edge of the hexagon. This counts the corners of the hexagon twice, so the number of points in the shell is 6(2k + 1) - 6 = 4n. If n = 3k + 1, the numbers of points on the six edges of the hexagon are 2k + 2 (4 times) and 2k + 1 (twice), for a total of 12k + 10 - 6 = 4n. If n = 3k + 2 the numbers are 2k + 2 (4 times) and 2k + 3 twice, and again we get 4n points.
The illustration shows shells 0 through 12, as well as the hexagons formed by shells 9 (green, 36 points), 10 (black, 40 points), 11 (red, 44 points), and 12 (blue, 48 points).
It is clear from the net that this period-3 structure continues forever, and establishes the theorem.
In contrast, for the 4.4.4.4 planar net, the successive shells are diamonds instead of hexagons, and again the n-th shell (n > 0) contains 4n points.
Of course the two nets are very different, since 4.4.4.4 has the symmetry of the square, while 3.4.6.4 has only mirror symmetry (with respect to a point), and has the symmetry of a regular hexagon with respect to the center of any of the 12-gons. (End)
Also the coordination sequence for a 6.6.6.6 point in the 3-transitive tiling {4.6.6, 6.6.6, 6.6.6.6}, see A265045, A265046. - N. J. A. Sloane, Dec 27 2015
Also the coordination sequence for 2-dimensional cyclotomic lattice Z[zeta_4].
Susceptibility series H_1 for 2-dimensional Ising model (divided by 2).
Also the Engel expansion of exp^(1/4); cf. A006784 for the Engel expansion definition. - Benoit Cloitre, Mar 03 2002
This sequence differs from A008586, multiples of 4, only in its initial term. - Alonso del Arte, Apr 14 2011
Number of 2 X n binary matrices avoiding simultaneously the right angled numbered polyomino patterns (ranpp) (00,0), (00;1) and (10;1). An occurrence of a ranpp (xy;z) in a matrix A=(a(i,j)) is a triple (a(i1,j1), a(i1,j2), a(i2,j1)) where i1 < i2 and j1 < j2 and these elements are in same relative order as those in the triple (x,y,z). - Sergey Kitaev, Nov 11 2004
Central terms of the triangle in A118013. - Reinhard Zumkeller, Apr 10 2006
Also the coordination sequence for the htb net. - N. J. A. Sloane, Mar 31 2018
This is almost certainly also the coordination sequence for Dual(3.3.4.3.4) with respect to a tetravalent node. - Tom Karzes, Apr 01 2020
Minimal number of segments (equivalently, corners) in a rook circuit of a 2n X 2n board (maximal number is A085622). - Ruediger Jehn, Jan 02 2021

Examples

			From _Omar E. Pol_, Aug 20 2011 (Start):
Illustration of initial terms as perimeters of squares (cf. Perry's comment above):
.                                         o o o o o o
.                             o o o o o   o         o
.                   o o o o   o       o   o         o
.           o o o   o     o   o       o   o         o
.     o o   o   o   o     o   o       o   o         o
. o   o o   o o o   o o o o   o o o o o   o o o o o o
.
. 1    4      8        12         16           20
(End)
		

Crossrefs

Cf. A001844 (partial sums), A008586, A054275, A054410, A054389, A054764.
Convolution square of A040000.
Row sums of A130323 and A131032.
List of coordination sequences for uniform planar nets: A008458 (the planar net 3.3.3.3.3.3), A008486 (6^3), A008574 (4.4.4.4 and 3.4.6.4), A008576 (4.8.8), A008579(3.6.3.6), A008706 (3.3.3.4.4), A072154 (4.6.12), A219529(3.3.4.3.4), A250120 (3.3.3.3.6), A250122 (3.12.12).
List of coordination sequences for Laves tilings (or duals of uniform planar nets): [3,3,3,3,3.3] = A008486; [3.3.3.3.6] = A298014, A298015, A298016; [3.3.3.4.4] = A298022, A298024; [3.3.4.3.4] = A008574, A296368; [3.6.3.6] = A298026, A298028; [3.4.6.4] = A298029, A298031, A298033; [3.12.12] = A019557, A298035; [4.4.4.4] = A008574; [4.6.12] = A298036, A298038, A298040; [4.8.8] = A022144, A234275; [6.6.6] = A008458.
Coordination sequences for the 20 2-uniform tilings in the order in which they appear in the Galebach catalog, together with their names in the RCSR database (two sequences per tiling): #1 krt A265035, A265036; #2 cph A301287, A301289; #3 krm A301291, A301293; #4 krl A301298, A298024; #5 krq A301299, A301301; #6 krs A301674, A301676; #7 krr A301670, A301672; #8 krk A301291, A301293; #9 krn A301678, A301680; #10 krg A301682, A301684; #11 bew A008574, A296910; #12 krh A301686, A301688; #13 krf A301690, A301692; #14 krd A301694, A219529; #15 krc A301708, A301710; #16 usm A301712, A301714; #17 krj A219529, A301697; #18 kre A301716, A301718; #19 krb A301720, A301722; #20 kra A301724, A301726.
See also A265045, A265046.

Programs

  • Haskell
    a008574 0 = 1; a008574 n = 4 * n
    a008574_list = 1 : [4, 8 ..]  -- Reinhard Zumkeller, Apr 16 2015
  • Mathematica
    f[0] = 1; f[n_] := 4 n; Array[f, 59, 0] (* or *)
    CoefficientList[ Series[(1 + x)^2/(1 - x)^2, {x, 0, 58}], x] (* Robert G. Wilson v, Jan 02 2011 *)
    Join[{1},Range[4,232,4]] (* Harvey P. Dale, Aug 19 2011 *)
    a[ n_] := 4 n + Boole[n == 0]; (* Michael Somos, Jan 07 2019 *)
  • PARI
    {a(n) = 4*n + !n}; /* Michael Somos, Apr 16 2007 */
    

Formula

Binomial transform is A000337 (dropping the 0 there). - Paul Barry, Jul 21 2003
Euler transform of length 2 sequence [4, -2]. - Michael Somos, Apr 16 2007
G.f.: ((1 + x) / (1 - x))^2. E.g.f.: 1 + 4*x*exp(x). - Michael Somos, Apr 16 2007
a(-n) = -a(n) unless n = 0. - Michael Somos, Apr 16 2007
G.f.: exp(4*atanh(x)). - Jaume Oliver Lafont, Oct 20 2009
a(n) = a(n-1) + 4, n > 1. - Vincenzo Librandi, Dec 31 2010
a(n) = A005408(n-1) + A005408(n), n > 1. - Ivan N. Ianakiev, Jul 16 2012
a(n) = 4*n = A008586(n), n >= 1. - Tom Karzes, Apr 01 2020

A023758 Numbers of the form 2^i - 2^j with i >= j.

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 7, 8, 12, 14, 15, 16, 24, 28, 30, 31, 32, 48, 56, 60, 62, 63, 64, 96, 112, 120, 124, 126, 127, 128, 192, 224, 240, 248, 252, 254, 255, 256, 384, 448, 480, 496, 504, 508, 510, 511, 512, 768, 896, 960, 992, 1008, 1016, 1020, 1022, 1023
Offset: 1

Views

Author

Keywords

Comments

Numbers whose digits in base 2 are in nonincreasing order.
Might be called "nialpdromes".
Subset of A077436. Proof: Since a(n) is of the form (2^i-1)*2^j, i,j >= 0, a(n)^2 = (2^(2i) - 2^(i+1))*2^(2j) + 2^(2j) where the first sum term has i-1 one bits and its 2j-th bit is zero, while the second sum term switches the 2j-th bit to one, giving i one bits, as in a(n). - Ralf Stephan, Mar 08 2004
Numbers whose binary representation contains no "01". - Benoit Cloitre, May 23 2004
Every polynomial with coefficients equal to 1 for the leading terms and 0 after that, evaluated at 2. For instance a(13) = x^4 + x^3 + x^2 at 2, a(14) = x^4 + x^3 + x^2 + x at 2. - Ben Paul Thurston, Jan 11 2008
From Gary W. Adamson, Jul 18 2008: (Start)
As a triangle by rows starting:
1;
2, 3;
4, 6, 7;
8, 12, 14, 15;
16, 24, 28, 30, 31;
...,
equals A000012 * A130123 * A000012, where A130123 = (1, 0,2; 0,0,4; 0,0,0,8; ...). Row sums of this triangle = A000337 starting (1, 5, 17, 49, 129, ...). (End)
First differences are A057728 = 1; 1; 1; 1; 2,1; 1; 4,2,1; 1; 8,4,2,1; 1; ... i.e., decreasing powers of 2, separated by another "1". - M. F. Hasler, May 06 2009
Apart from first term, numbers that are powers of 2 or the sum of some consecutive powers of 2. - Omar E. Pol, Feb 14 2013
From Andres Cicuttin, Apr 29 2016: (Start)
Numbers that can be digitally generated with twisted ring (Johnson) counters. This is, the binary digits of a(n) correspond to those stored in a shift register where the input bit of the first bit storage element is the inverted output of the last storage element. After starting with all 0’s, each new state is obtained by rotating the stored bits but inverting at each state transition the last bit that goes to the first position (see link).
Examples: for a(n) represented by three bits
Binary
a(5)= 4 -> 100 last bit = 0
a(6)= 6 -> 110 first bit = 1 (inverted last bit of previous number)
a(7)= 7 -> 111
and for a(n) represented by four bits
Binary
a(8) = 8 -> 1000
a(9) = 12 -> 1100 last bit = 0
a(10)= 14 -> 1110 first bit = 1 (inverted last bit of previous number)
a(11)= 15 -> 1111
(End)
Powers of 2 represented in bases which are terms of this sequence must always contain at least one digit which is also a power of 2. This is because 2^i mod (2^i - 2^j) = 2^j, which means the last digit always cycles through powers of 2 (or if i=j+1 then the first digit is a power of 2 and the rest are trailing zeros). The only known non-member of this sequence with this property is 5. - Ely Golden, Sep 05 2017
Numbers k such that k = 2^(1 + A000523(k)) - 2^A007814(k). - Daniel Starodubtsev, Aug 05 2021
A002260(n) = v(a(n)/2^v(a(n))+1) and A002024(n) = A002260(n) + v(a(n)) where v is the dyadic valuation (i.e., A007814). - Lorenzo Sauras Altuzarra, Feb 01 2023

Examples

			a(22) = 64 = 32 + 32 = 2^5 + a(16) = 2^A003056(20) + a(22-5-1).
a(23) = 96 = 64 + 32 = 2^6 + a(16) = 2^A003056(21) + a(23-6-1).
a(24) = 112 = 64 + 48 = 2^6 + a(17) = 2^A003056(22) + a(24-6-1).
		

Crossrefs

A000337(r) = sum of row T(r, c) with 0 <= c < r. See also A002024, A003056, A140129, A140130, A221975.
Cf. A007088, A130123, A101082 (complement), A340375 (characteristic function).
This is the base-2 version of A064222. First differences are A057728.
Subsequence of A077436, of A129523, of A277704, and of A333762.
Subsequences: A043569 (nonzero even terms, or equally, nonzero terms doubled), A175332, A272615, A335431, A000396 (its even terms only), A324200.
Positions of zeros in A049502, A265397, A277899, A284264.
Positions of ones in A283983, A283989.
Positions of nonzero terms in A341509 (apart from the initial zero).
Positions of squarefree terms in A260443.
Fixed points of A264977, A277711, A283165, A334666.
Distinct terms in A340632.
Cf. also A309758, A309759, A309761 (for analogous sequences).

Programs

  • Haskell
    import Data.Set (singleton, deleteFindMin, insert)
    a023758 n = a023758_list !! (n-1)
    a023758_list = 0 : f (singleton 1) where
    f s = x : f (if even x then insert z s' else insert z $ insert (z+1) s')
    where z = 2*x; (x, s') = deleteFindMin s
    -- Reinhard Zumkeller, Sep 24 2014, Dec 19 2012
    
  • Maple
    a:=proc(n) local n2,d: n2:=convert(n,base,2): d:={seq(n2[j]-n2[j-1],j=2..nops(n2))}: if n=0 then 0 elif n=1 then 1 elif d={0,1} or d={0} or d={1} then n else fi end: seq(a(n),n=0..2100); # Emeric Deutsch, Apr 22 2006
  • Mathematica
    Union[Flatten[Table[2^i - 2^j, {i, 0, 100}, {j, 0, i}]]] (* T. D. Noe, Mar 15 2011 *)
    Select[Range[0, 2^10], NoneTrue[Differences@ IntegerDigits[#, 2], # > 0 &] &] (* Michael De Vlieger, Sep 05 2017 *)
  • PARI
    for(n=0,2500,if(prod(k=1,length(binary(n))-1,component(binary(n),k)+1-component(binary(n),k+1))>0,print1(n,",")))
    
  • PARI
    A023758(n)= my(r=round(sqrt(2*n--))); (1<<(n-r*(r-1)/2)-1)<<(r*(r+1)/2-n)
    /* or, to illustrate the "decreasing digit" property and analogy to A064222: */
    A023758(n,show=0)={ my(a=0); while(n--, show & print1(a","); a=vecsort(binary(a+1)); a*=vector(#a,j,2^(j-1))~); a} \\ M. F. Hasler, May 06 2009
    
  • PARI
    is(n)=if(n<5,1,n>>=valuation(n,2);n++;n>>valuation(n,2)==1) \\ Charles R Greathouse IV, Jan 04 2016
    
  • PARI
    list(lim)=my(v=List([0]),t); for(i=1,logint(lim\1+1,2), t=2^i-1; while(t<=lim, listput(v,t); t*=2)); Set(v) \\ Charles R Greathouse IV, May 03 2016
    
  • Python
    def a_next(a_n): return (a_n | (a_n >> 1)) + (a_n & 1)
    a_n = 1; a = [0]
    for i in range(55): a.append(a_n); a_n = a_next(a_n) # Falk Hüffner, Feb 19 2022
    
  • Python
    from math import isqrt
    def A023758(n): return (1<<(m:=isqrt(n-1<<3)+1>>1))-(1<<(m*(m+1)-(n-1<<1)>>1)) # Chai Wah Wu, Feb 23 2025

Formula

a(n) = 2^s(n) - 2^((s(n)^2 + s(n) - 2n)/2) where s(n) = ceiling((-1 + sqrt(1+8n))/2). - Sam Alexander, Jan 08 2005
a(n) = 2^k + a(n-k-1) for 1 < n and k = A003056(n-2). The rows of T(r, c) = 2^r-2^c for 0 <= c < r read from right to left produce this sequence: 1; 2, 3; 4, 6, 7; 8, 12, 14, 15; ... - Frank Ellermann, Dec 06 2001
For n > 0, a(n) mod 2 = A010054(n). - Benoit Cloitre, May 23 2004
A140130(a(n)) = 1 and for n > 1: A140129(a(n)) = A002262(n-2). - Reinhard Zumkeller, May 14 2008
a(n+1) = (2^(n - r(r-1)/2) - 1) 2^(r(r+1)/2 - n), where r=round(sqrt(2n)). - M. F. Hasler, May 06 2009
Start with A000225. If k is in the sequence, then so is 2k. - Ralf Stephan, Aug 16 2013
G.f.: (x^2/((2-x)*(1-x)))*(1 + Sum_{k>=0} x^((k^2+k)/2)*(1 + x*(2^k-1))). The sum is related to Jacobi theta functions. - Robert Israel, Feb 24 2015
A049502(a(n)) = 0. - Reinhard Zumkeller, Jun 17 2015
a(n) = a(n-1) + a(n-d)/a(d*(d+1)/2 + 2) if n > 1, d > 0, where d = A002262(n-2). - Yuchun Ji, May 11 2020
A277699(a(n)) = a(n)^2, A306441(a(n)) = a(n+1). - Antti Karttunen, Feb 15 2021 (the latter identity from A306441)
Sum_{n>=2} 1/a(n) = A211705. - Amiram Eldar, Feb 20 2022

Extensions

Definition changed by N. J. A. Sloane, Jan 05 2008

A001855 Sorting numbers: maximal number of comparisons for sorting n elements by binary insertion.

Original entry on oeis.org

0, 1, 3, 5, 8, 11, 14, 17, 21, 25, 29, 33, 37, 41, 45, 49, 54, 59, 64, 69, 74, 79, 84, 89, 94, 99, 104, 109, 114, 119, 124, 129, 135, 141, 147, 153, 159, 165, 171, 177, 183, 189, 195, 201, 207, 213, 219, 225, 231, 237, 243, 249, 255, 261, 267, 273, 279, 285
Offset: 1

Views

Author

Keywords

Comments

Equals n-1 times the expected number of probes for a successful binary search in a size n-1 list.
Piecewise linear: breakpoints at powers of 2 with values given by A000337.
a(n) is the number of digits in the binary representation of all the numbers 1 to n-1. - Hieronymus Fischer, Dec 05 2006
It is also coincidentally the maximum number of comparisons for merge sort. - Li-yao Xia, Nov 18 2015

References

  • D. E. Knuth, The Art of Computer Programming. Addison-Wesley, Reading, MA, Vol. 3, Sect 5.3.1, Eq. (3); Sect. 6.2.1 (4).
  • J. W. Moon, Topics on Tournaments. Holt, NY, 1968, p. 48.
  • 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).
  • Tianxing Tao, On optimal arrangement of 12 points, pp. 229-234 in Combinatorics, Computing and Complexity, ed. D. Du and G. Hu, Kluwer, 1989.

Crossrefs

Programs

  • Haskell
    import Data.List (transpose)
    a001855 n = a001855_list !! n
    a001855_list = 0 : zipWith (+) [1..] (zipWith (+) hs $ tail hs) where
       hs = concat $ transpose [a001855_list, a001855_list]
    -- Reinhard Zumkeller, Jun 03 2013
    
  • Maple
    a := proc(n) local k; k := ilog2(n) + 1; 1 + n*k - 2^k end; # N. J. A. Sloane, Dec 01 2007 [edited by Peter Luschny, Nov 30 2017]
  • Mathematica
    a[n_?EvenQ] := a[n] = n + 2a[n/2] - 1; a[n_?OddQ] := a[n] = n + a[(n+1)/2] + a[(n-1)/2] - 1; a[1] = 0; a[2] = 1; Table[a[n], {n, 1, 58}] (* Jean-François Alcover, Nov 23 2011, after Pari *)
    a[n_] := n IntegerLength[n, 2] - 2^IntegerLength[n, 2] + 1;
    Table[a[n], {n, 1, 58}] (* Peter Luschny, Dec 02 2017 *)
    Accumulate[BitLength[Range[0, 100]]] (* Paolo Xausa, Sep 30 2024 *)
  • PARI
    a(n)=if(n<2,0,n-1+a(n\2)+a((n+1)\2))
    
  • PARI
    a(n)=local(m);if(n<2,0,m=length(binary(n-1));n*m-2^m+1)
    
  • Python
    def A001855(n):
        s, i, z = 0, n-1, 1
        while 0 <= i: s += i; i -= z; z += z
        return s
    print([A001855(n) for n in range(1, 59)]) # Peter Luschny, Nov 30 2017
    
  • Python
    def A001855(n): return n*(m:=(n-1).bit_length())-(1<Chai Wah Wu, Mar 29 2023

Formula

Let n = 2^(k-1) + g, 0 <= g <= 2^(k-1); then a(n) = 1 + n*k - 2^k. - N. J. A. Sloane, Dec 01 2007
a(n) = Sum_{k=1..n}ceiling(log_2 k) = n*ceiling(log_2 n) - 2^ceiling(log_2(n)) + 1.
a(n) = a(floor(n/2)) + a(ceiling(n/2)) + n - 1.
G.f.: x/(1-x)^2 * Sum_{k>=0} x^2^k. - Ralf Stephan, Apr 13 2002
a(1)=0, for n>1, a(n) = ceiling(n*a(n-1)/(n-1)+1). - Benoit Cloitre, Apr 26 2003
a(n) = n-1 + min { a(k)+a(n-k) : 1 <= k <= n-1 }, cf. A003314. - Vladeta Jovovic, Aug 15 2004
a(n) = A061168(n-1) + n - 1 for n>1. - Hieronymus Fischer, Dec 05 2006
a(n) = A123753(n-1) - n. - Peter Luschny, Nov 30 2017

Extensions

Additional comments from M. D. McIlroy (mcilroy(AT)dartmouth.edu)

A119258 Triangle read by rows: T(n,0) = T(n,n) = 1 and for 0

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 1, 5, 7, 1, 1, 7, 17, 15, 1, 1, 9, 31, 49, 31, 1, 1, 11, 49, 111, 129, 63, 1, 1, 13, 71, 209, 351, 321, 127, 1, 1, 15, 97, 351, 769, 1023, 769, 255, 1, 1, 17, 127, 545, 1471, 2561, 2815, 1793, 511, 1, 1, 19, 161, 799, 2561, 5503, 7937, 7423, 4097, 1023, 1
Offset: 0

Views

Author

Reinhard Zumkeller, May 11 2006

Keywords

Comments

From Richard M. Green, Jul 26 2011: (Start)
T(n,n-k) is the (k-1)-st Betti number of the subcomplex of the n-dimensional half cube obtained by deleting the interiors of all half-cube shaped faces of dimension at least k.
T(n,n-k) is the (k-2)-nd Betti number of the complement of the k-equal real hyperplane arrangement in R^n.
T(n,n-k) gives a lower bound for the complexity of the problem of determining, given n real numbers, whether some k of them are equal.
T(n,n-k) is the number of nodes used by the Kronrod-Patterson-Smolyak cubature formula in numerical analysis. (End)

Examples

			Triangle begins as:
  1;
  1, 1;
  1, 3,  1;
  1, 5,  7,  1;
  1, 7, 17, 15,  1;
  1, 9, 31, 49, 31, 1;
		

Crossrefs

A145661, A119258 and A118801 are all essentially the same (see the Shattuck and Waldhauser paper). - Tamas Waldhauser, Jul 25 2011

Programs

  • Haskell
    a119258 n k = a119258_tabl !! n !! k
    a119258_row n = a119258_tabl !! n
    a119258_list = concat a119258_tabl
    a119258_tabl = iterate (\row -> zipWith (+)
       ([0] ++ init row ++ [0]) $ zipWith (+) ([0] ++ row) (row ++ [0])) [1]
    -- Reinhard Zumkeller, Nov 15 2011
    
  • Magma
    function T(n,k)
      if k eq 0 or k eq n then return 1;
      else return 2*T(n-1,k-1) + T(n-1,k);
      end if;
      return T;
    end function;
    [T(n,k): k in [0..n], n in [0..12]]; // G. C. Greubel, Nov 18 2019
    
  • Maple
    # Case m = 2 of the more general:
    A119258 := (n,k,m) -> (1-m)^(-n+k)-m^(k+1)*pochhammer(n-k, k+1) *hypergeom([1,n+1],[k+2],m)/(k+1)!;
    seq(seq(round(evalf(A119258(n,k,2))),k=0..n), n=0..10); # Peter Luschny, Jul 25 2014
  • Mathematica
    T[n_, k_] := Binomial[n, k] Hypergeometric2F1[-k, n-k, n-k+1, -1];
    Table[T[n, k], {n, 0, 10}, {k, 0, n}] // Flatten (* Jean-François Alcover, Sep 10 2017 *)
  • PARI
    T(n,k) = if(k==0 || k==n, 1, 2*T(n-1, k-1) + T(n-1,k) ); \\ G. C. Greubel, Nov 18 2019
    
  • Sage
    @CachedFunction
    def T(n, k):
        if (k==0 or k==n): return 1
        else: return 2*T(n-1, k-1) + T(n-1, k)
    [[T(n, k) for k in (0..n)] for n in (0..12)] # G. C. Greubel, Nov 18 2019

Formula

T(2*n,n-1) = T(2*n-1,n) for n > 0;
central terms give A119259; row sums give A007051;
T(n,0) = T(n,n) = 1;
T(n,1) = A005408(n-1) for n > 0;
T(n,2) = A056220(n-1) for n > 1;
T(n,n-4) = A027608(n-4) for n > 3;
T(n,n-3) = A055580(n-3) for n > 2;
T(n,n-2) = A000337(n-1) for n > 1;
T(n,n-1) = A000225(n) for n > 0.
T(n,k) = [k<=n]*(-1)^k*Sum_{i=0..k} (-1)^i*C(k-n,k-i)*C(n,i). - Paul Barry, Sep 28 2007
From Richard M. Green, Jul 26 2011: (Start)
T(n,k) = [k<=n] Sum_{i=n-k..n} (-1)^(n-k-i)*2^(n-i)*C(n,i).
T(n,k) = [k<=n] Sum_{i=n-k..n} C(n,i)*C(i-1,n-k-1).
G.f. for T(n,n-k): x^k/(((1-2x)^k)*(1-x)). (End)
T(n,k) = R(n,k,2) where R(n, k, m) = (1-m)^(-n+k)-m^(k+1)*Pochhammer(n-k,k+1)* hyper2F1([1,n+1], [k+2], m)/(k+1)!. - Peter Luschny, Jul 25 2014
From Peter Bala, Mar 05 2018: (Start)
The n-th row polynomial R(n,x) equals the n-th degree Taylor polynomial of the function (1 + 2*x)^n/(1 + x) about 0. For example, for n = 4 we have (1 + 2*x)^4/(1 + x) = 1 + 7*x + 17*x^2 + 15*x^3 + x^4 + O(x^5).
Row reverse of A112857. (End)
Showing 1-10 of 70 results. Next