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

A358449 Euler transform of (0, 1, -2, 4, -8, 16, ...), (cf. A122803).

Original entry on oeis.org

1, 1, -1, 3, -4, 4, -2, 2, 2, -26, 80, -168, 351, -749, 1485, -2779, 5134, -9314, 16318, -27522, 44596, -68484, 96148, -113172, 77125, 122309, -750801, 2411307, -6424162, 15607886, -35846784, 79201548, -170009469, 356687423, -734287141, 1487086199, -2967980133
Offset: 0

Views

Author

Peter Luschny, Nov 17 2022

Keywords

Crossrefs

Programs

  • Maple
    # Uses EulerTransform from A358369.
    a := EulerTransform(BinaryRecurrenceSequence(-2, 0)): seq(a(n), n=0..36);
  • Sage
    # uses[EulerTransform from A166861]
    b = BinaryRecurrenceSequence(-2, 0)
    a = EulerTransform(b)
    print([a(n) for n in range(37)])

A004526 Nonnegative integers repeated, floor(n/2).

Original entry on oeis.org

0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 36
Offset: 0

Views

Author

Keywords

Comments

Number of elements in the set {k: 1 <= 2k <= n}.
Dimension of the space of weight 2n+4 cusp forms for Gamma_0(2).
Dimension of the space of weight 1 modular forms for Gamma_1(n+1).
Number of ways 2^n is expressible as r^2 - s^2 with s > 0. Proof: (r+s) and (r-s) both should be powers of 2, even and distinct hence a(2k) = a(2k-1) = (k-1) etc. - Amarnath Murthy, Sep 20 2002
Lengths of sides of Ulam square spiral; i.e., lengths of runs of equal terms in A063826. - Donald S. McDonald, Jan 09 2003
Number of partitions of n into two parts. A008619 gives partitions of n into at most two parts, so A008619(n) = a(n) + 1 for all n >= 0. Partial sums are A002620 (Quarter-squares). - Rick L. Shepherd, Feb 27 2004
a(n+1) is the number of 1's in the binary expansion of the Jacobsthal number A001045(n). - Paul Barry, Jan 13 2005
Number of partitions of n+1 into two distinct (nonzero) parts. Example: a(8) = 4 because we have [8,1],[7,2],[6,3] and [5,4]. - Emeric Deutsch, Apr 14 2006
Complement of A000035, since A000035(n)+2*a(n) = n. Also equal to the partial sums of A000035. - Hieronymus Fischer, Jun 01 2007
Number of binary bracelets of n beads, two of them 0. For n >= 2, a(n-2) is the number of binary bracelets of n beads, two of them 0, with 00 prohibited. - Washington Bomfim, Aug 27 2008
Let A be the Hessenberg n X n matrix defined by: A[1,j] = j mod 2, A[i,i]:=1, A[i,i-1] = -1, and A[i,j] = 0 otherwise. Then, for n >= 1, a(n+1) = (-1)^n det(A). - Milan Janjic, Jan 24 2010
From Clark Kimberling, Mar 10 2011: (Start)
Let RT abbreviate rank transform (A187224). Then
RT(this sequence) = A187484;
RT(this sequence without 1st term) = A026371;
RT(this sequence without 1st 2 terms) = A026367;
RT(this sequence without 1st 3 terms) = A026363. (End)
The diameter (longest path) of the n-cycle. - Cade Herron, Apr 14 2011
For n >= 3, a(n-1) is the number of two-color bracelets of n beads, three of them are black, having a diameter of symmetry. - Vladimir Shevelev, May 03 2011
Pelesko (2004) refers erroneously to this sequence instead of A008619. - M. F. Hasler, Jul 19 2012
Number of degree 2 irreducible characters of the dihedral group of order 2(n+1). - Eric M. Schmidt, Feb 12 2013
For n >= 3 the sequence a(n-1) is the number of non-congruent regions with infinite area in the exterior of a regular n-gon with all diagonals drawn. See A217748. - Martin Renner, Mar 23 2013
a(n) is the number of partitions of 2n into exactly 2 even parts. a(n+1) is the number of partitions of 2n into exactly 2 odd parts. This just rephrases the comment of E. Deutsch above. - Wesley Ivan Hurt, Jun 08 2013
Number of the distinct rectangles and square in a regular n-gon is a(n/2) for even n and n >= 4. For odd n, such number is zero, see illustration in link. - Kival Ngaokrajang, Jun 25 2013
x-coordinate from the image of the point (0,-1) after n reflections across the lines y = n and y = x respectively (alternating so that one reflection is applied on each step): (0,-1) -> (0,1) -> (1,0) -> (1,2) -> (2,1) -> (2,3) -> ... . - Wesley Ivan Hurt, Jul 12 2013
a(n) is the number of partitions of 2n into exactly two distinct odd parts. a(n-1) is the number of partitions of 2n into exactly two distinct even parts, n > 0. - Wesley Ivan Hurt, Jul 21 2013
a(n) is the number of permutations of length n avoiding 213, 231 and 312, or avoiding 213, 312 and 321 in the classical sense which are breadth-first search reading words of increasing unary-binary trees. For more details, see the entry for permutations avoiding 231 at A245898. - Manda Riehl, Aug 05 2014
Also a(n) is the number of different patterns of 2-color, 2-partition of n. - Ctibor O. Zizka, Nov 19 2014
Minimum in- and out-degree for a directed K_n (see link). - Jon Perry, Nov 22 2014
a(n) is also the independence number of the triangular graph T(n). - Luis Manuel Rivera Martínez, Mar 12 2015
For n >= 3, a(n+4) is the least positive integer m such that every m-element subset of {1,2,...,n} contains distinct i, j, k with i + j = k (equivalently, with i - j = k). - Rick L. Shepherd, Jan 24 2016
More generally, the ordinary generating function for the integers repeated k times is x^k/((1 - x)(1 - x^k)). - Ilya Gutkovskiy, Mar 21 2016
a(n) is the number of numbers of the form F(i)*F(j) between F(n+3) and F(n+4), where 2 < i < j and F = A000045 (Fibonacci numbers). - Clark Kimberling, May 02 2016
The arithmetic function v_2(n,2) as defined in A289187. - Robert Price, Aug 22 2017
a(n) is also the total domination number of the (n-3)-gear graph. - Eric W. Weisstein, Apr 07 2018
Consider the numbers 1, 2, ..., n; a(n) is the largest integer t such that these numbers can be arranged in a row so that all consecutive terms differ by at least t. Example: a(6) = a(7) = 3, because of respectively (4, 1, 5, 2, 6, 3) and (1, 5, 2, 6, 3, 7, 4) (see link BMO - Problem 2). - Bernard Schott, Mar 07 2020
a(n-1) is also the number of integer-sided triangles whose sides a < b < c are in arithmetic progression with a middle side b = n (see A307136). Example, for b = 4, there exists a(3) = 1 such triangle corresponding to Pythagorean triple (3, 4, 5). For the triples, miscellaneous properties and references, see A336750. - Bernard Schott, Oct 15 2020
For n >= 1, a(n-1) is the greatest remainder on division of n by any k in 1..n. - David James Sycamore, Sep 05 2021
Number of incongruent right triangles that can be formed from the vertices of a regular n-gon is given by a(n/2) for n even. For n odd such number is zero. For a regular n-gon, the number of incongruent triangles formed from its vertices is given by A069905(n). The number of incongruent acute triangles is given by A005044(n). The number of incongruent obtuse triangles is given by A008642(n-4) for n > 3 otherwise 0, with offset 0. - Frank M Jackson, Nov 26 2022
The inverse binomial transform is 0, 0, 1, -2, 4, -8, 16, -32, ... (see A122803). - R. J. Mathar, Feb 25 2023

Examples

			G.f. = x^2 + x^3 + 2*x^4 + 2*x^5 + 3*x^6 + 3*x^7 + 4*x^8 + 4*x^9 + 5*x^10 + ...
		

References

  • G. L. Alexanderson et al., The William Powell Putnam Mathematical Competition - Problems and Solutions: 1965-1984, M.A.A., 1985; see Problem A-1 of 27th Competition.
  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 120, P(n,2).
  • Graham, Knuth and Patashnik, Concrete Mathematics, Addison-Wesley, NY, 1989, page 77 (partitions of n into at most 2 parts).

Crossrefs

a(n+2) = A008619(n). See A008619 for more references.
A001477(n) = a(n+1)+a(n). A000035(n) = a(n+1)-A002456(n).
a(n) = A008284(n, 2), n >= 1.
Zero followed by the partial sums of A000035.
Column 2 of triangle A094953. Second row of A180969.
Partial sums: A002620. Other related sequences: A010872, A010873, A010874.
Cf. similar sequences of the integers repeated k times: A001477 (k = 1), this sequence (k = 2), A002264 (k = 3), A002265 (k = 4), A002266 (k = 5), A152467 (k = 6), A132270 (k = 7), A132292 (k = 8), A059995 (k = 10).
Cf. A289187, A139756 (binomial transf).

Programs

  • Haskell
    a004526 = (`div` 2)
    a004526_list = concatMap (\x -> [x, x]) [0..]
    -- Reinhard Zumkeller, Jul 27 2012
    
  • Magma
    [Floor(n/2): n in [0..100]]; // Vincenzo Librandi, Nov 19 2014
    
  • Maple
    A004526 := n->floor(n/2); seq(floor(i/2),i=0..50);
  • Mathematica
    Table[(2n - 1)/4 + (-1)^n/4, {n, 0, 70}] (* Stefan Steinerberger, Apr 02 2006 *)
    f[n_] := If[OddQ[n], (n - 1)/2, n/2]; Array[f, 74, 0] (* Robert G. Wilson v, Apr 20 2012 *)
    With[{c=Range[0,40]},Riffle[c,c]] (* Harvey P. Dale, Aug 26 2013 *)
    CoefficientList[Series[x^2/(1 - x - x^2 + x^3), {x, 0, 75}], x] (* Robert G. Wilson v, Feb 05 2015 *)
    LinearRecurrence[{1, 1, -1}, {0, 0, 1}, 75] (* Robert G. Wilson v, Feb 05 2015 *)
    Floor[Range[0, 40]/2] (* Eric W. Weisstein, Apr 07 2018 *)
  • Maxima
    makelist(floor(n/2),n,0,50); /* Martin Ettl, Oct 17 2012 */
    
  • PARI
    a(n)=n\2 /* Jaume Oliver Lafont, Mar 25 2009 */
    
  • PARI
    x='x+O('x^100); concat([0, 0], Vec(x^2/((1+x)*(x-1)^2))) \\ Altug Alkan, Mar 21 2016
    
  • Python
    def a(n): return n//2
    print([a(n) for n in range(74)]) # Michael S. Branicky, Apr 30 2022
  • Sage
    def a(n) : return( dimension_cusp_forms( Gamma0(2), 2*n+4) ); # Michael Somos, Jul 03 2014
    
  • Sage
    def a(n) : return( dimension_modular_forms( Gamma1(n+1), 1) ); # Michael Somos, Jul 03 2014
    

Formula

G.f.: x^2/((1+x)*(x-1)^2).
a(n) = floor(n/2).
a(n) = ceiling((n+1)/2). - Eric W. Weisstein, Jan 11 2024
a(n) = 1 + a(n-2).
a(n) = a(n-1) + a(n-2) - a(n-3).
a(2*n) = a(2*n+1) = n.
a(n+1) = n - a(n). - Henry Bottomley, Jul 25 2001
For n > 0, a(n) = Sum_{i=1..n} (1/2)/cos(Pi*(2*i-(1-(-1)^n)/2)/(2*n+1)). - Benoit Cloitre, Oct 11 2002
a(n) = (2*n-1)/4 + (-1)^n/4; a(n+1) = Sum_{k=0..n} k*(-1)^(n+k). - Paul Barry, May 20 2003
E.g.f.: ((2*x-1)*exp(x) + exp(-x))/4. - Paul Barry, Sep 03 2003
G.f.: (1/(1-x)) * Sum_{k >= 0} t^2/(1-t^4) where t = x^2^k. - Ralf Stephan, Feb 24 2004
a(n+1) = A000120(A001045(n)). - Paul Barry, Jan 13 2005
a(n) = (n-(1-(-1)^n)/2)/2 = (1/2)*(n-|sin(n*Pi/2)|). Likewise: a(n) = (n-A000035(n))/2. Also: a(n) = Sum_{k=0..n} A000035(k). - Hieronymus Fischer, Jun 01 2007
The expression floor((x^2-1)/(2*x)) (x >= 1) produces this sequence. - Mohammad K. Azarian, Nov 08 2007; corrected by M. F. Hasler, Nov 17 2008
a(n+1) = A002378(n) - A035608(n). - Reinhard Zumkeller, Jan 27 2010
a(n+1) = A002620(n+1) - A002620(n) = floor((n+1)/2)*ceiling((n+1)/2) - floor(n^2/4). - Jonathan Vos Post, May 20 2010
For n >= 2, a(n) = floor(log_2(2^a(n-1) + 2^a(n-2))). - Vladimir Shevelev, Jun 22 2010
a(n) = A180969(2,n). - Adriano Caroli, Nov 24 2010
A001057(n-1) = (-1)^n*a(n), n > 0. - M. F. Hasler, Jul 19 2012
a(n) = A008615(n) + A002264(n). - Reinhard Zumkeller, Apr 28 2014
Euler transform of length 2 sequence [1, 1]. - Michael Somos, Jul 03 2014

Extensions

Partially edited by Joerg Arndt, Mar 11 2010, and M. F. Hasler, Jul 19 2012

A033999 a(n) = (-1)^n.

Original entry on oeis.org

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

Vasiliy Danilov (danilovv(AT)usa.net), Jun 15 1998

Keywords

Comments

(-1)^(n+1) = signed area of parallelogram with vertices (0,0), U=(F(n),F(n+1)), V=(F(n+1),F(n+2)), where F = A000045 (Fibonacci numbers). The area of every such parallelogram is 1. The signed area is -1 if and only if F(n+1)^2 > F(n)*F(n+2), or, equivalently, n is even, or, equivalently, the vector U is "above" V, indicating that U and V "cross" as n -> n+1. - Clark Kimberling, Sep 09 2013
Periodic with period length 2. - Ray Chandler, Apr 03 2017
From Bernard Schott, May 11 2022: (Start)
Cesàro mean theorem: When a(n) has a limit (finite or infinite) in the usual sense, then c(n) = (a(1)+...+a(n))/n has the same Cesàro limit, but the converse is false. This sequence is a counterexample in the case of a finite Cesàro limit (see A237420 for counterexample with an infinite Cesàro limit).
This sequence is not convergent in the usual sense because a(2n) = 1 while a(2n+1) = -1; the successive arithmetic means c(n) of the first n terms of the sequence are 1/1, 0/2, 1/3, 0/4, 1/5, 0/6, ... so c(2n) = 1/(2n+1) and c(2n+1) = 0, hence the Cesàro limit is 0 because c(n) -> 0 when n -> oo.
In fact, when sequence a(n) is "Period k: [a1, a2, ..., ak]", then the Cesàro limit c of this sequence is (a1+a2+...+ak)/k.
Note that the converse of the theorem is true iff a(n) is monotonic (End).

Examples

			G.f. = 1 - x + x^2 - x^3 + x^4 - x^5 + x^6 - x^7 + x^8 - x^9 + x^10 - x^11 + x^12 + ...
		

References

  • J. M. Arnaudiès, P. Delezoide et H. Fraysse, Exercices résolus d'Analyse du cours de mathématiques - 2, Dunod, Exercice 10, pp. 14-16.

Crossrefs

About Cesàro mean theorem: A114112, A237420.
Cf. A072691 (abs. val. Dgf at s=2), A197070 (abs. val. Dgf at s=3), A267315 (abs. val. Dgf at s=4).

Programs

Formula

G.f.: 1/(1+x).
E.g.f.: exp(-x).
Linear recurrence: a(0)=1, a(n)=-a(n-1) for n>0. - Jaume Oliver Lafont, Mar 20 2009
Sum_{k=0..n} a(k) = A059841(n). - Jaume Oliver Lafont, Nov 21 2009
Sum_{k>=0} a(k)/(k+1) = log(2). - Jaume Oliver Lafont, Mar 30 2010
Euler transform of length 2 sequence [ -1, 1]. - Michael Somos, Mar 21 2011
Moebius transform is length 2 sequence [ -1, 2]. - Michael Somos, Mar 21 2011
a(n) = -b(n) where b(n) = multiplicative with b(2^e) = -1 if e>0, b(p^e) = 1 if p>2. - Michael Somos, Mar 21 2011
a(n) = a(-n) = a(n + 2) = cos(n * Pi). a(n) = c_2(n) if n>1 where c_k(n) is Ramanujan's sum. - Michael Somos, Mar 21 2011
a(n) = (1/2)*Product_{k=0..2*n-1} 2*cos((2*k+1)*Pi/(4*n)), n >= 1. See the product given in the Oct 21 2013 formula comment in A056594, and replace there n -> 2*n. - Wolfdieter Lang, Oct 23 2013
D.g.f.: (2^(1-s)-1)*zeta(s) = -eta(s) (the Dirichlet eta function). - Ralf Stephan, Mar 27 2015
From Ilya Gutkovskiy, Aug 17 2016: (Start)
a(n) = T_n(-1), where T_n(x) are the Chebyshev polynomials of the first kind.
Binomial transform of A122803. (End)
a(n) = exp(i*Pi*n) = exp(-i*Pi*n). - Carauleanu Marc, Sep 15 2016
a(n) = Sum_{k=0..n} (-1)^k*A063007(n, k), n >= 0. - Wolfdieter Lang, Sep 13 2016

A130595 Triangle read by rows: lower triangular matrix which is inverse to Pascal's triangle (A007318) regarded as a lower triangular matrix.

Original entry on oeis.org

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, -1, 7, -21, 35, -35, 21, -7, 1, 1, -8, 28, -56, 70, -56, 28, -8, 1, -1, 9, -36, 84, -126, 126, -84, 36, -9, 1, 1, -10, 45, -120, 210, -252, 210, -120, 45, -10, 1, -1, 11, -55, 165, -330, 462, -462, 330, -165, 55, -11, 1
Offset: 0

Views

Author

Philippe Deléham, Jun 17 2007

Keywords

Comments

Triangle T(n,k), read by rows, given by [-1,0,0,0,0,0,0,0,...] DELTA [1,0,0,0,0,0,0,0,...] where DELTA is the operator defined in A084938.
Coefficients of the polynomials generated by the e.g.f. exp(x*t)*exp(-t). - Peter Luschny, Jul 13 2009
Riordan array (1/(1+x), x/(1+x)). - Philippe Deléham, Nov 29 2009
Multiplication of a sequence (written as column vector) by this matrix (to the left) yields the inverse Binomial transform of the sequence. - M. F. Hasler, Nov 01 2014
From Tom Copeland, Nov 16 2016: (Start)
This signed Pascal matrix IP and the Pascal matrix P contain the coefficients of a prototypical pair of Appell polynomial sequences that are inverse under umbral composition with e.g.f.s e^((x-1)*t) = e^(-t) e^(xt) = f(t) e^(xt) and e^((x+1)t) = e^t e^(xt) = g(t) e^(xt) and row polynomials q_n(x) = (x-1)^n and p_n(x) = (x+1)^n, respectively. The inverse property for an Appell pair is reflected in IP*P = identity matrix, f(t) = 1/g(t), the umbral relation p_n(q.(x)) = x^n = q_n(p.(x)), and their respective raising operators R_(Ip) = x - h(D) and R_P = x + h(D) differing only in the sign of the differential term (h(D) = 1, in this case). The lowering operator for an Appell sequence is L = D = d/dx with L p_n(x) = n*p_(n-1)(x), and the raising operator is defined by R p_n(x) = p_(n+1)(x).
The related signed Pascal matrix M with M(n,k) = (-1)^n IP(n,k) = (-1)^k P(n,k) has the e.g.f. e^((1-x)t) = e^t e^(-xt), and w_n(x) = (1-x)^n is not an Appell sequence, but it is a Sheffer sequence with lowering and raising operators L = -D and R = 1 - x, and M = M^(-1) since w_n(w.(x)) = (1-w.(x))^n = sum_{k = 0,..,n} binomial(n,k) (-1)^k w_k(x) = (1-(1-x))^n = x^n.
Umbral composition of a pair of Sheffer polynomial sequences, of which Appell sequences are a special class, is equivalent to the multiplication of their respective coefficient matrices.
(End)

Examples

			Triangle begins with T(0,0):
   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;
  -1,    7,  -21,   35,  -35,   21,   -7,    1;
   1,   -8,   28,  -56,   70,  -56,   28,   -8,    1;
  -1,    9,  -36,   84, -126,  126,  -84,   36,   -9,    1;
  ...
As polynomials:
  + 1;
  - 1 + 1 x;
  + 1 - 2 x + 1 x^2;
  - 1 + 3 x - 3 x^2 + 1 x^3;
  + 1 - 4 x + 6 x^2 - 4 x^3 + 1 x^4;
		

Crossrefs

Sums include: A000007 (row sums), A019590, A039834 (diagonal sums), A049347 (alternating sign diagonal sums), A063524, A085750, A122803 (alternating sign sums).

Programs

  • Haskell
    a130595 n = a130595_list !! n
    a130595_list = concat $ iterate ([-1,1] *) [1]
    instance Num a => Num [a] where
       fromInteger k = [fromInteger k]
       (p:ps) + (q:qs) = p + q : ps + qs
       ps + qs         = ps ++ qs
       (p:ps) * qs'@(q:qs) = p * q : ps * qs' + [p] * qs
        *                = []
    -- Reinhard Zumkeller, Apr 02 2011
    
  • Haskell
    a130595 n k = a130595_tabl !! n !! k
    a130595_row n = a130595_tabl !! n
    a130595_tabl = iterate (\row -> zipWith (-) ([0] ++ row) (row ++ [0])) [1]
    -- Reinhard Zumkeller, Apr 13 2013
    
  • Magma
    [(-1)^(n+k)*Binomial(n,k): k in [0..n], n in [0..15]]; // G. C. Greubel, Jun 22 2024
    
  • Maple
    A130595 := proc(n,k)
            (-1)^(n+k)*binomial(n,k) ;
    end proc: # R. J. Mathar, Feb 13 2013
  • Mathematica
    nmax = 11; t[n_, k_] := (-1)^(n-k)*Binomial[n, k]; Flatten[ Table[ t[n, k], {n, 0, nmax}, {k, 0, n}] ] (* Jean-François Alcover, Dec 01 2011 *)
    Table[Binomial[-1-k, n-k],{n,0,11},{k,0,n}]//Flatten (* Robert A. Russell, Jan 16 2020 *)
  • PARI
    A130595(n,k)=(-1)^(n+k)*binomial(n,k) \\ M. F. Hasler, Nov 01 2014
    
  • SageMath
    flatten([[(-1)^(n+k)*binomial(n,k) for k in range(n+1)] for n in range(16)]) # G. C. Greubel, Jun 22 2024

Formula

T(n,k) = (-1)^(n-k)*binomial(n,k) = (-1)^(n-k)*A007318(n,k).
T(n,k) = T(n-1,k-1) - T(n-1,k). - Philippe Deléham, Oct 10 2011
G.f.: 1/(1+x-x*y). - R. J. Mathar, Aug 11 2015 [corrected by Anders Claesson, Nov 28 2015]
Conjecture from Dale Gerdemann, Nov 28 2015:
T(n,k) = (n-k+1)*T(n-1,k-1) + (k-1)*T(n-1,k).
Proof from Anders Claesson, Nov 29 2015:
It follows from T(n,k) = T(n-1,k-1) - T(n-1,k) and n*T(n-1,k-1) = k*T(n,k) that: (n-k+1)*T(n-1,k-1) + (k-1)*T(n-1,k) = n*T(n-1,k-1) - (k-1)*T(n-1,k-1) + (k-1)*T(n-1,k) = n*T(n-1,k-1) - (k-1)*(T(n-1,k-1) - T(n-1,k)) = n*T(n-1,k-1) - (k-1)*T(n,k) = n*T(n-1,k-1) - k*T(n,k) + T(n,k) = T(n,k). QED
(-1)^(n+1) Sum_{k=1..n} T(n,k)/k = Sum_{k=1..n} 1/k = H(n) where H(n) is the n-th harmonic number. For a proof see link "Relation between binomial coefficients and harmonic numbers". - Wolfgang Hintze, Oct 22 2016
T(n,k) = binomial(-1-k,n-k). - Robert A. Russell, Jan 16 2020
From G. C. Greubel, Jun 22 2024: (Start)
T(n, n-k) = (-1)^n*T(n, k).
Sum_{k=0..n} T(n, k) = A000007(n).
Sum_{k=0..n} (-1)^k*T(n, k) = A122803(n).
Sum_{k=0..floor(n/2)} T(n-k, k) = A039834(n+1).
Sum_{k=0..floor(n/2)} (-1)^k*T(n-k, k) = A049347(n).
Sum_{k=0..n} k*T(n, k) = A063524(n).
Sum_{k=0..n} (-1)^k*k*T(n, k) = A085750(n+1).
Sum_{k=0..n} (k+1)*T(n, k) = A019590(n). (End)

Extensions

Edited by N. J. A. Sloane, Nov 27 2011

A077925 Expansion of 1/((1-x)*(1+2*x)).

Original entry on oeis.org

1, -1, 3, -5, 11, -21, 43, -85, 171, -341, 683, -1365, 2731, -5461, 10923, -21845, 43691, -87381, 174763, -349525, 699051, -1398101, 2796203, -5592405, 11184811, -22369621, 44739243, -89478485, 178956971, -357913941, 715827883, -1431655765, 2863311531, -5726623061
Offset: 0

Views

Author

N. J. A. Sloane, Nov 17 2002

Keywords

Comments

a(n+1) is the reflection of a(n) through a(n-1) on the numberline. - Floor van Lamoen, Aug 31 2004
If a zero is added as the (new) a(0) in front, the sequence represents the inverse binomial transform of A001045. Partial sums are in A077898. - R. J. Mathar, Aug 30 2008
a(n) = A077953(2*n+3). - Reinhard Zumkeller, Oct 07 2008
Related to the Fibonacci sequence by an INVERT transform: if A(x) = 1+x^2*g(x) is the generating function of the a(n) prefixed with 1, 0, then 1/A(x) = 2+(x+1)/(x^2-x+1) is the generating function of 1, 0, -1, 1, -2, 3, ..., the signed Fibonacci sequence A000045 prefixed with 1. - Gary W. Adamson, Jan 07 2011
Also: Gaussian binomial coefficients [n+1,1], or q-integers, for q=-2, diagonal k=1 in the triangular (or column r=1 in the square) array A015109. - M. F. Hasler, Nov 04 2012
With a leading zero, 0, 1, -1, 3, -5, 11, -21, 43, -85, 171, -341, 683, ... we obtain the Lucas U(-1,-2) sequence. - R. J. Mathar, Jan 08 2013
Let m = a(n). Then 18*m^2 - 12*m + 1 = A000225(2n+3). - Roderick MacPhee, Jan 17 2013

Examples

			G.f. = 1 - x + 3*x^2 - 5*x^3 + 11*x^4 - 21*x^5 + 43*x^6 - 85*x^7 + ...
		

Crossrefs

Cf. A001045 (unsigned version).
Cf. A014983, A014985, A014986. - Zerinvary Lajos, Dec 16 2008

Programs

Formula

G.f.: 1/(1+x-2*x^2).
a(n) = (1-(-2)^(n+1))/3. - Vladeta Jovovic, Apr 17 2003
a(n) = Sum_{k=0..n} (-2)^k. - Paul Barry, May 26 2003
a(n+1) - a(n) = A122803(n). - R. J. Mathar, Aug 30 2008
a(n) = Sum_{k=0..n} A112555(n,k)*(-2)^k. - Philippe Deléham, Sep 11 2009
a(n) = A082247(n+1) - 1. - Philippe Deléham, Oct 07 2009
G.f.: Q(0)/(3*x), where Q(k) = 1 - 1/(4^k - 2*x*16^k/(2*x*4^k + 1/(1 + 1/(2*4^k - 8*x*16^k/(4*x*4^k - 1/Q(k+1)))))); (continued fraction). - Sergei N. Gladkovskii, May 22 2013
G.f.: Q(0)/2 , where Q(k) = 1 + 1/(1 - x*(4*k-1 + 2*x)/( x*(4*k+1 + 2*x) + 1/Q(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Sep 08 2013
E.g.f.: (2*exp(-2*x) + exp(x))/3. - Ilya Gutkovskiy, Nov 12 2016
a(n) = A086893(n+2) - A061547(n+3), n >= 0. - Yosu Yurramendi, Jan 16 2017
a(n) = (-1)^n*A001045(n+1). - M. F. Hasler, Feb 13 2020
a(n) - a(n-1) = a(n-1) - a(n+1) = (-2)^n, a(n+1) = - a(n) + 2*a(n-1) = 1 - 2*a(n). - Michael Somos, Feb 22 2023

A007442 Inverse binomial transform of primes.

Original entry on oeis.org

2, 1, 1, -1, 3, -9, 23, -53, 115, -237, 457, -801, 1213, -1389, 445, 3667, -15081, 41335, -95059, 195769, -370803, 652463, -1063359, 1570205, -1961755, 1560269, 1401991, -11023119, 36000427, -93408425, 214275735, -450374071, 879254493, -1599245737, 2695465017
Offset: 1

Views

Author

Keywords

Comments

a(n) is the (n-1)-st difference of the first n primes. Although the magnitude of the terms appears to grow exponentially, a plot shows that the sequence a(n)/2^n has quite a bit of structure. See A082594 for an interesting application. - T. D. Noe, May 09 2003
Graph this divided by A122803 using plot2! - Franklin T. Adams-Watters
From Robert G. Wilson v, Jan 28 2020: (Start)
a(n) is odd for all n>1.
As opposed to A331573, there are terms where abs(a(n)) >= abs(a(n+1)). (End)

Examples

			a(4) = 7 - 3*5 + 3*3 - 2 = -1.
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Mathematica
    Diff[lst_List] := Table[lst[[i + 1]] - lst[[i]], {i, Length[lst] - 1}]; n=1000; dt = Prime[Range[n]]; a = Range[n]; a[[1]] = 2; Do[dt = Diff[dt]; a[[i]] = dt[[1]], {i, 2, n}]; a
    u = Table[Prime[Range[k]], {k, 1, 100}];Flatten[Table[Differences[u[[k]], k - 1], {k, 1, 100}]] (* Clark Kimberling, May 15 2015 *)
    t = Array[Prime, 30]; f[x_] := Rest[x] - Most[x];
    Flatten[Last /@ (NestList[f, t[[1 ;; #]], (# - 1)] & /@ Range[1, 29])] (* Horst H. Manninger, Mar 22 2021 *)
  • PARI
    vector(50, n, sum(k=0, n-1,(-1)^(n-k-1)*binomial(n-1, k)*prime(k+1))) \\ Altug Alkan, Oct 17 2015

Formula

a(n) = Sum_{k=0..n-1} (-1)^(n-k-1) binomial(n-1, k) prime(k+1).
a(n) = A095195(n,n-1). - Alois P. Heinz, Sep 25 2013
G.f.: Sum_{k>=1} prime(k)*x^k/(1 + x)^k. - Ilya Gutkovskiy, Apr 23 2019

Extensions

Incorrect conjecture concerning the sign of even terms removed by Glen Whitney, Nov 10 2024

A053985 Replace 2^k with (-2)^k in binary expansion of n.

Original entry on oeis.org

0, 1, -2, -1, 4, 5, 2, 3, -8, -7, -10, -9, -4, -3, -6, -5, 16, 17, 14, 15, 20, 21, 18, 19, 8, 9, 6, 7, 12, 13, 10, 11, -32, -31, -34, -33, -28, -27, -30, -29, -40, -39, -42, -41, -36, -35, -38, -37, -16, -15, -18, -17, -12, -11, -14, -13, -24, -23, -26, -25, -20, -19
Offset: 0

Views

Author

Henry Bottomley, Apr 03 2000

Keywords

Comments

Base 2 representation for n (in lexicographic order) converted from base -2 to base 10.
Maps natural numbers uniquely onto integers; within each group of positive values, maximum is in A002450; a(n)=n iff n can be written only with 1's and 0's in base 4 (A000695).
a(n) = A004514(n) - n. - Reinhard Zumkeller, Dec 27 2003
Schroeppel gives formula n = (a(n) + b) XOR b where b = binary ...101010, and notes this formula is reversible. The reverse a(n) = (n XOR b) - b is a bit twiddle to transform 1 bits to -1. Odd position 0 or 1 in n is flipped by "XOR b" to 1 or 0, then "- b" gives 0 or -1. Only odd position 1's are changed, so b can be any length sure to cover those. - Kevin Ryde, Jun 26 2020

Examples

			a(9)=-7 because 9 is written 1001 base 2 and (-2)^3 + (-2)^0 = -8 + 1 = -7.
Or by Schroeppel's formula, b = binary 1010 then a(9) = (1001 XOR 1010) - 1010 = decimal -7. - _Kevin Ryde_, Jun 26 2020
		

Crossrefs

Programs

  • Mathematica
    f[n_Integer, b_Integer] := Block[{l = IntegerDigits[n]}, Sum[l[[ -i]]*(-b)^(i - 1), {i, 1, Length[l]}]]; a = Table[ FromDigits[ IntegerDigits[n, 2]], {n, 0, 80}]; b = {}; Do[b = Append[b, f[a[[n]], 2]], {n, 1, 80}]; b
    (* Second program: *)
    Array[FromDigits[IntegerDigits[#, 2], -2] &, 62, 0] (* Michael De Vlieger, Jun 27 2020 *)
  • PARI
    a(n) = fromdigits(binary(n), -2) \\ Rémy Sigrist, Sep 01 2018
    
  • Python
    def A053985(n): return  -(b:=int('10'*(n.bit_length()+1>>1),2)) + (n^b) if n else 0 # Chai Wah Wu, Nov 18 2022

Formula

From Ralf Stephan, Jun 13 2003: (Start)
G.f.: (1/(1-x)) * Sum_{k>=0} (-2)^k*x^2^k/(1+x^2^k).
a(0) = 0, a(2*n) = -2*a(n), a(2*n+1) = -2*a(n)+1. (End)
a(n) = Sum_{k>=0} A030308(n,k)*A122803(k). - Philippe Deléham, Oct 15 2011
a(n) = (n XOR b) - b where b = binary ..101010 [Schroeppel]. Any b of this form (A020988) with bitlength(b) >= bitlength(n) suits. - Kevin Ryde, Jun 26 2020

A176059 Periodic sequence: Repeat 3, 2.

Original entry on oeis.org

3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3
Offset: 0

Views

Author

Klaus Brockhaus, Apr 07 2010

Keywords

Comments

Interleaving of A010701 and A007395.
Also continued fraction expansion of (3+sqrt(15))/2.
Also decimal expansion of 32/99.
a(n) = A010693(n+1).
Essentially first differences of A047218.
Binomial transform of 3 followed by -A122803.
Inverse binomial transform of 3 followed by A020714.
Second inverse binomial transform of A057198 without initial term 1.

Crossrefs

Cf. A010701 (all 3's sequence), A007395 (all 2's sequence), A176058 (decimal expansion of (3+sqrt(15))/2), A010693 (repeat 2, 3), A047218 (congruent to {0, 3} mod 5), A122803 (powers of -2), A020714 (5*2^n), A057198 ((5*3^(n-1)+1)/2, n > 0).
Cf. A026532 (partial products).

Programs

Formula

a(n) = (5+(-1)^n)/2.
a(n) = a(n-2) for n > 1; a(0) = 3, a(1) = 2.
a(n) = -a(n-1)+5 for n > 0; a(0) = 3.
a(n) = 3*((n+1) mod 2)+2*(n mod 2).
G.f.: (3+2*x)/((1-x)*(1+x)).
E.g.f.: 3*cosh(x) + 2*sinh(x). - Stefano Spezia, Aug 04 2025

A110164 Expansion of (1-x^2)/(1+2x).

Original entry on oeis.org

1, -2, 3, -6, 12, -24, 48, -96, 192, -384, 768, -1536, 3072, -6144, 12288, -24576, 49152, -98304, 196608, -393216, 786432, -1572864, 3145728, -6291456, 12582912, -25165824, 50331648, -100663296, 201326592, -402653184, 805306368, -1610612736, 3221225472
Offset: 0

Views

Author

Paul Barry, Jul 14 2005

Keywords

Comments

Diagonal sums of Riordan array ((1-x)/(1+x),x/(1+x)^2), A110162.
The positive sequence with g.f. (1-x^2)/(1-2x) gives the row sums of the Riordan array (1+x,x/(1-x)). - Paul Barry, Jul 18 2005
The inverse g.f. is (1 + 2*x + x^2 + 2*x^3 + x^4 + 2*x^5 + x^6 + ...). - Gary W. Adamson, Jan 07 2011
In absolute value, essentially the same as A007283(n) = A003945(n+1) = A042950(n+1) = A082505(n+1) = A087009(n+3) = A091629(n) = A098011(n+4) = A111286(n+2). - M. F. Hasler, Apr 19 2015

Crossrefs

Programs

Formula

a(n) = 3*(-2)^(n-2) = 3*A122803(n-2) for n >= 2. a(n) = -2 a(n-1) for n >= 3. - M. F. Hasler, Apr 19 2015
E.g.f.: (1/4) - (x/2) + (3/4)*exp(-2*x). - Alejandro J. Becerra Jr., Jan 29 2021

A368150 Triangular array T(n,k), read by rows: coefficients of strong divisibility sequence of polynomials p(1,x) = 1, p(2,x) = 1 + 3*x, p(n,x) = u*p(n-1,x) + v*p(n-2,x) for n >= 3, where u = p(2,x), v = 1 - x^2.

Original entry on oeis.org

1, 1, 3, 2, 6, 8, 3, 15, 25, 21, 5, 30, 76, 90, 55, 8, 60, 188, 324, 300, 144, 13, 114, 439, 948, 1251, 954, 377, 21, 213, 961, 2529, 4207, 4527, 2939, 987, 34, 390, 2026, 6246, 12606, 17154, 15646, 8850, 2584, 55, 705, 4136, 14640, 34590, 56970, 65840
Offset: 1

Views

Author

Clark Kimberling, Dec 25 2023

Keywords

Comments

Because (p(n,x)) is a strong divisibility sequence, for each integer k, the sequence (p(n,k)) is a strong divisibility sequence of integers.

Examples

			First eight rows:
   1
   1    3
   2    6    8
   3   15   25    21
   5   30   76    90     55
   8   60  188   324    300   144
  13  114  439   948   1251   954   377
  21  213  961  2529   4207  4527  2939   987
Row 4 represents the polynomial p(4,x) = 3 + 15*x + 25*x^2 + 21*x^3, so (T(4,k)) = (3,15,25,21), k=0..3.
		

Crossrefs

Cf. A000045 (column 1); A001906 (p(n,n-1)); A000302 (row sums), (p(n,1)); A122803 (alternating row sums), (p(n,-1)); A190972 (p(n,2)), A116415, (p(n,-2)); A190990, (p(n,3)); A057084, (p(n,-3)); A094440, A367208, A367209, A367210, A367211, A367297, A367298, A367299, A367300, A367301, A368151.

Programs

  • Mathematica
    p[1, x_] := 1; p[2, x_] := 1 + 3 x; u[x_] := p[2, x]; v[x_] := 1 - x^2;
    p[n_, x_] := Expand[u[x]*p[n - 1, x] + v[x]*p[n - 2, x]]
    Grid[Table[CoefficientList[p[n, x], x], {n, 1, 10}]]
    Flatten[Table[CoefficientList[p[n, x], x], {n, 1, 10}]]

Formula

p(n,x) = u*p(n-1,x) + v*p(n-2,x) for n >= 3, where p(1,x) = 1, p(2,x) = 1 + 3*x, u = p(2,x), and v = 1 - x^2.
p(n,x) = k*(b^n - c^n), where k = -1/sqrt(5 + 6*x + 5*x^2), b = (1/2)*(3*x + 1 - 1/k), c = (1/2)*(3*x + 1 + 1/k).
Showing 1-10 of 37 results. Next