cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Previous Showing 21-30 of 21686 results. Next

A049347 Period 3: repeat [1, -1, 0].

Original entry on oeis.org

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

Views

Author

Keywords

Comments

G.f. 1/cyclotomic(3, x) (the third cyclotomic polynomial).
Self-convolution yields (-1)^n*A099254(n). - R. J. Mathar, Apr 06 2008
Hankel transform of A099324. - Paul Barry, Aug 10 2009
A057083(n) = p(-1) where p(x) is the unique degree-n polynomial such that p(k) = a(k) for k = 0..n. - Michael Somos, Apr 29 2012
a(n) appears, together with b(n) = A099837(n+3) in the formula 2*exp(2*Pi*n*I/3) = b(n) + a(n)*sqrt(3)*I, n >= 0, with I = sqrt(-1). See A164116 for the case N=5. - Wolfdieter Lang, Feb 27 2014
The binomial transform is 1, 0, -1, -1, 0, 1, 1, 0, -1, -1.. (see A010891). The inverse binom. transform is 1, -2, 3, -3, 0, 9, -27, 54, -81.. (see A057682). - R. J. Mathar, Feb 25 2023

Examples

			G.f. = 1 - x + x^3 - x^4 + x^6 - x^7 + x^9 - x^10 + x^12 - x^13 + x^15 + ...
		

References

  • A. T. Benjamin and J. J. Quinn, Proofs that really count: the art of combinatorial proof, M.A.A. 2003, id. 175.

Crossrefs

Alternating row sums of A049310 (Chebyshev-S). [Wolfdieter Lang, Nov 04 2011]

Programs

Formula

G.f.: 1/(1+x+x^2).
a(n) = +1 if n mod 3 = 0, a(n) = -1 if n mod 3 = 1, else 0.
a(n) = S(n, -1) = U(n, -1/2) (Chebyshev's U(n, x) polynomials.)
a(n) = 2*sqrt(3)*cos(2*Pi*n/3 + Pi/6)/3. - Paul Barry, Mar 15 2004
a(n) = Sum_{k >= 0} (-1)^(n-k)*C(n-k, k).
Given g.f. A(x), then B(x) = x * A(x) satisfies 0 = f(B(x), B(x^2)) where f(u, v) = u^2 - v + 2*u*v. - Michael Somos, Oct 03 2006
Euler transform of length 3 sequence [-1, 0, 1]. - Michael Somos, Oct 03 2006
a(n) = b(n+1) where b(n) is multiplicative with b(3^e) = 0^e, b(p^e) = 1 if p == 1 (mod 3), b(p^e) = (-1)^e if p == 2 (mod 3). - Michael Somos, Oct 03 2006
From Michael Somos, Oct 03 2006: (Start)
G.f.: (1 - x) /(1 - x^3).
a(n) = -a(1-n) = -a(n-1) - a(n-2) = a(n-3). (End)
From Michael Somos, Apr 29 2012: (Start)
G.f.: 1 / (1 + x / ( 1 - x / (1 + x))).
a(n) = (-1)^n * A010892(n).
a(n) * n! = A194770(n+1).
Revert transform of A001006. Convolution inverse of A130716. MOBIUS transform of A002324. EULER transform is A111317. BIN1 transform of itself. STIRLING transform is A143818(n+2). (End)
a(-n) = A057078(n). a(n) = A106510(n+1) unless n=0. - Michael Somos, Oct 15 2008
G.f. A(x) = 1/(1+x+x^2) = Q(0); Q(k) = 1- x/(1 - x^2/(x^2 - 1 + x/(x - 1 + x^2/(x^2 - 1/Q(k+1))))); (continued fraction 3 kind, 5-step ). - Sergei N. Gladkovskii, Jun 19 2012
a(n) = -1 + floor(67/333*10^(n+1)) mod 10. - Hieronymus Fischer, Jan 03 2013
a(n) = -1 + floor(19/26*3^(n+1)) mod 3. - Hieronymus Fischer, Jan 03 2013
a(n) = ceiling((n-1)/3) - ceiling(n/3) + floor(n/3) - floor((n-1)/3). - Wesley Ivan Hurt, Dec 06 2013
a(n) = n + 1 - 3*floor((n+2)/3). - Mircea Merca, Feb 04 2014
a(n) = A102283(n+1) for all n in Z. - Michael Somos, Sep 24 2019
E.g.f.: exp(-x/2)*(3*cos(sqrt(3)*x/2) - sqrt(3)*sin(sqrt(3)*x/2))/3. - Stefano Spezia, Oct 26 2022

Extensions

Edited by Charles R Greathouse IV, Mar 23 2010

A000587 Rao Uppuluri-Carpenter numbers (or complementary Bell numbers): e.g.f. = exp(1 - exp(x)).

Original entry on oeis.org

1, -1, 0, 1, 1, -2, -9, -9, 50, 267, 413, -2180, -17731, -50533, 110176, 1966797, 9938669, 8638718, -278475061, -2540956509, -9816860358, 27172288399, 725503033401, 5592543175252, 15823587507881, -168392610536153, -2848115497132448, -20819319685262839
Offset: 0

Views

Author

Keywords

Comments

Alternating row sums of Stirling2 triangle A048993.
Related to the matrix-exponential of the Pascal-matrix, see A000110 and A011971. - Gottfried Helms, Apr 08 2007
Closely linked to A000110 and especially the contribution there of Jonathan R. Love (japanada11(AT)yahoo.ca), Feb 22 2007, by offering what is a complementary finding.
Number of set partitions of 1..n with an even number of parts, minus the number of such partitions with an odd number of parts. - Franklin T. Adams-Watters, May 04 2010
After -2, the smallest prime is a(36) = -1454252568471818731501051, no others through a(100). What is the first prime >0 in the sequence? - Jonathan Vos Post, Feb 02 2011
a(723) ~ 1.9*10^1265 is almost certainly prime. - D. S. McNeil, Feb 02 2011
Stirling transform of a(n) = [1, -1, 0, 1, 1, ...] is A033999(n) = [1, -1, 1, -1, 1, ...]. - Michael Somos, Mar 28 2012
Negated coefficients in the asymptotic expansion: A005165(n)/n! ~ 1 - 1/n + 1/n^2 + 0/n^3 - 1/n^4 - 1/n^5 + 2/n^6 + 9/n^7 + 9/n^8 - 50/n^9 - 267/n^10 - 413/n^11 + O(1/n^12), starting from the O(1/n) term. - Vladimir Reshetnikov, Nov 09 2016
Named after Venkata Ramamohana Rao Uppuluri and John A. Carpenter of the Mathematics Division, Oak Ridge National Laboratory, Oak Ridge, Tennessee. They are called "Rényi numbers" by Fekete (1999), after the Hungarian mathematician Alfréd Rényi (1921-1970). - Amiram Eldar, Mar 11 2022

Examples

			G.f. = 1 - x + x^3 + x^4 - 2*x^5 - 9*x^6 - 9*x^7 + 50*x^8 + 267*x^9 + 413*x^10 - ...
		

References

  • N. A. Kolokolnikova, Relations between sums of certain special numbers (Russian), in Asymptotic and enumeration problems of combinatorial analysis, pp. 117-124, Krasnojarsk. Gos. Univ., Krasnoyarsk, 1976.
  • Alfréd Rényi, Új modszerek es eredmenyek a kombinatorikus analfzisben. I. MTA III Oszt. Ivozl., Vol. 16 (1966), pp. 7-105.
  • 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).
  • M. V. Subbarao and A. Verma, Some remarks on a product expansion. An unexplored partition function, in Symbolic Computation, Number Theory, Special Functions, Physics and Combinatorics (Gainesville, FL, 1999), pp. 267-283, Kluwer, Dordrecht, 2001.

Crossrefs

Cf. A000110, A011971 (base triangle PE), A078937 (PE^2).

Programs

  • Haskell
    a000587 n = a000587_list !! n
    a000587_list = 1 : f a007318_tabl [1] where
       f (bs:bss) xs = y : f bss (y : xs) where y = - sum (zipWith (*) xs bs)
    -- Reinhard Zumkeller, Mar 04 2014
  • Maple
    b:= proc(n, t) option remember; `if`(n=0, 1-2*t,
          add(b(n-j, 1-t)*binomial(n-1, j-1), j=1..n))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=0..35);  # Alois P. Heinz, Jun 28 2016
  • Mathematica
    Table[ -1 * Sum[ (-1)^( k + 1) StirlingS2[ n, k ], {k, 0, n} ], {n, 0, 40} ]
    With[{nn=30},CoefficientList[Series[Exp[1-Exp[x]],{x,0,nn}],x] Range[0,nn]!] (* Harvey P. Dale, Nov 04 2011 *)
    a[ n_] := If[ n < 0, 0, n! SeriesCoefficient[ Exp[ 1 - Exp[x]], {x, 0, n}]]; (* Michael Somos, May 27 2014 *)
    a[ n_] := If[ n < 0, 0, With[{m = n + 1}, SeriesCoefficient[ Series[ Nest[ x Factor[ 1 - # /. x -> x / (1 - x)] &, 0, m], {x, 0, m}], {x, 0, m}]]]; (* Michael Somos, May 27 2014 *)
    Table[BellB[n, -1], {n, 0, 20}] (* Vladimir Reshetnikov, Oct 20 2015 *)
    b[1] = 1; k = 1; Flatten[{1, Table[Do[j = k; k -= b[m]; b[m] = j;, {m, 1, n-1}]; b[n] = k; k*(-1)^n, {n, 1, 40}]}] (* Vaclav Kotesovec, Sep 09 2019 *)
  • PARI
    {a(n) = if( n<0, 0, n! * polcoeff( exp( 1 - exp( x + x * O(x^n))), n))}; /* Michael Somos, Mar 14 2011 */
    
  • PARI
    {a(n) = local(A); if( n<0, 0, n++; A = O(x); for( k=1, n, A = x - x * subst(A, x, x / (1 - x))); polcoeff( A, n))}; /* Michael Somos, Mar 14 2011 */
    
  • PARI
    Vec(serlaplace(exp(1 - exp(x+O(x^99))))) /* Joerg Arndt, Apr 01 2011 */
    
  • PARI
    a(n)=round(exp(1)*suminf(k=0,(-1)^k*k^n/k!))
    vector(20,n,a(n-1)) \\ Derek Orr, Sep 19 2014 -- a direct approach
    
  • PARI
    x='x+O('x^66); Vec(serlaplace(exp(1 - exp(x)))) \\ Michel Marcus, Sep 19 2014
    
  • Python
    # The objective of this implementation is efficiency.
    # n -> [a(0), a(1), ..., a(n)] for n > 0.
    def A000587_list(n):
        A = [0 for i in range(n)]
        A[n-1] = 1
        R = [1]
        for j in range(0, n):
            A[n-1-j] = -A[n-1]
            for k in range(n-j, n):
                A[k] += A[k-1]
            R.append(A[n-1])
        return R
    # Peter Luschny, Apr 18 2011
    
  • Python
    # Python 3.2 or higher required
    from itertools import accumulate
    A000587, blist, b = [1,-1], [1], -1
    for _ in range(30):
        blist = list(accumulate([b]+blist))
        b = -blist[-1]
        A000587.append(b) # Chai Wah Wu, Sep 19 2014
    
  • Sage
    expnums(26, -1) # Zerinvary Lajos, May 15 2009
    

Formula

a(n) = e*Sum_{k>=0} (-1)^k*k^n/k!. - Benoit Cloitre, Jan 28 2003
E.g.f.: exp(1 - e^x).
a(n) = Sum_{k=0..n} (-1)^k S2(n, k), where S2(i, j) are the Stirling numbers of second kind A008277.
G.f.: (x/(1-x))*A(x/(1-x)) = 1 - A(x); the binomial transform equals the negative of the sequence shifted one place left. - Paul D. Hanna, Dec 08 2003
With different signs: g.f.: Sum_{k>=0} x^k/Product_{L=1..k} (1 + L*x).
Recurrence: a(n) = -Sum_{i=0..n-1} a(i)*C(n-1, i). - Ralf Stephan, Feb 24 2005
Let P be the lower-triangular Pascal-matrix, PE = exp(P-I) a matrix-exponential in exact integer arithmetic (or PE = lim exp(P)/exp(1) as limit of the exponential); then a(n) = PE^-1 [n,1]. - Gottfried Helms, Apr 08 2007
Take the series 0^n/0! - 1^n/1! + 2^n/2! - 3^n/3! + 4^n/4! + ... If n=0 then the result will be 1/e, where e = 2.718281828... If n=1, the result will be -1/e. If n=2, the result will be 0 (i.e., 0/e). As we continue for higher natural number values of n sequence for the Roa Uppuluri-Carpenter numbers is generated in the numerator, i.e., 1/e, -1/e, 0/e, 1/e, 1/e, -2/e, -9/e, -9/e, 50/e, 267/e, ... . - Peter Collins (pcolins(AT)eircom.net), Jun 04 2007
The sequence (-1)^n*a(n), with general term Sum_{k=0..n} (-1)^(n-k)*S2(n, k), has e.g.f. exp(1-exp(-x)). It also has Hankel transform (-1)^C(n+1,2)*A000178(n) and binomial transform A109747. - Paul Barry, Mar 31 2008
G.f.: 1 / (1 + x / (1 - x / (1 + x / (1 - 2*x / (1 + x / (1 - 3*x / (1 + x / ...))))))). - Michael Somos, May 12 2012
From Sergei N. Gladkovskii, Sep 28 2012 to Feb 07 2014: (Start)
Continued fractions:
G.f.: -1/U(0) where U(k) = x*k - 1 - x + x^2*(k+1)/U(k+1).
G.f.: 1/(U(0)+x) where U(k) = 1 + x - x*(k+1)/(1 + x/U(k+1)).
G.f.: 1+x/G(0) where G(k) = x*k - 1 + x^2*(k+1)/G(k+1).
G.f.: (1 - G(0))/(x+1) where G(k) = 1 - 1/(1-k*x)/(1-x/(x+1/G(k+1) )).
G.f.: 1 + x/(G(0)-x) where G(k) = x*k + 2*x - 1 - x*(x*k+x-1)/G(k+1).
G.f.: G(0)/(1+x), where G(k) = 1-x^2*(k+1)/(x^2*(k+1)+(x*k-1-x)*(x*k-1)/G(k+1)).
(End)
a(n) = B_n(-1), where B_n(x) is n-th Bell polynomial. - Vladimir Reshetnikov, Oct 20 2015
From Mélika Tebni, May 20 2022: (Start)
a(n) = Sum_{k=0..n} (-1)^k*Bell(k)*A129062(n, k).
a(n) = Sum_{k=0..n} (-1)^k*k!*A130191(n, k). (End)

A316524 Signed sum over the prime indices of n.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Jul 05 2018

Keywords

Comments

If n = prime(x_1) * prime(x_2) * prime(x_3) * ... * prime(x_k) then a(n) = x_1 - x_2 + x_3 - ... + (-1)^(k-1) x_k, where the x_i are weakly increasing positive integers.
The value of a(n) depends only on the squarefree part of n, A007913(n). - Antti Karttunen, May 06 2022

Crossrefs

Cf. A027746, A112798, A119899 (positions of negative terms).
Cf. A344616 (absolute values), A344617 (signs).

Programs

  • Mathematica
    Table[Sum[Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]][[k]]*(-1)^(k-1),{k,PrimeOmega[n]}],{n,100}]
  • PARI
    a(n) = {my(f = factor(n), vp = []); for (k=1, #f~, for( j=1, f[k,2], vp = concat (vp, primepi(f[k,1])));); sum(k=1, #vp, vp[k]*(-1)^(k+1));} \\ Michel Marcus, Jul 06 2018
    
  • Python
    from sympy import factorint, primepi
    def A316524(n):
        fs = [primepi(p) for p in factorint(n,multiple=True)]
        return sum(fs[::2])-sum(fs[1::2]) # Chai Wah Wu, Aug 23 2021

Formula

a(n) = A344616(n) * A344617(n) = a(A007913(n)). - Antti Karttunen, May 06 2022

Extensions

More terms from Antti Karttunen, May 06 2022

A164555 Numerators of the "original" Bernoulli numbers; also the numerators of the Bernoulli polynomials at x=1.

Original entry on oeis.org

1, 1, 1, 0, -1, 0, 1, 0, -1, 0, 5, 0, -691, 0, 7, 0, -3617, 0, 43867, 0, -174611, 0, 854513, 0, -236364091, 0, 8553103, 0, -23749461029, 0, 8615841276005, 0, -7709321041217, 0, 2577687858367, 0, -26315271553053477373, 0, 2929993913841559, 0, -261082718496449122051
Offset: 0

Views

Author

Paul Curtz, Aug 15 2009

Keywords

Comments

Apart from a sign flip in a(1), the same as A027641.
a(n) is also the numerator of the n-th term of the binomial transform of the sequence of Bernoulli numbers, i.e., of the sequence of fractions A027641(n)/A027642(n).
a(n)/A027642(n) with e.g.f. x/(1-exp(-x)) is the a-sequence for the Sheffer matrix A094645, see the W. Lang link under A006232 for Sheffer a- and z-sequences. - Wolfdieter Lang, Jun 20 2011
a(n)/A027642(n) also give the row sums of the rational triangle of the coefficients of the Bernoulli polynomials A053382/A053383 (falling powers) or A196838/A196839 (rising powers). - Wolfdieter Lang, Oct 25 2011
Given M = the beheaded Pascal's triangle, A074909; with B_n as a vector V, with numerators shown: (1, 1, 1, ...). Then M*V = [1, 2, 3, 4, 5, ...]. If the sign in a(1) is negative in V, then M*V = [1, 0, 0, 0, ...]. - Gary W. Adamson, Mar 09 2012
One might interpret the term "'original' Bernoulli numbers" as numbers given by the e.g.f. x/(1-exp(-x)). - Peter Luschny, Jun 17 2012
Let B(n) = a(n)/A027642(n) then B(n) = Integral_{x=0..1} F_n(x) where F_n(x) are the signed Fubini polynomials F_n(x) = Sum_{k=0..n} (-1)^n*Stirling2(n,k)*k!*(-x)^k (see illustration). - Peter Luschny, Jan 09 2017

Examples

			From _Peter Luschny_, Aug 13 2017: (Start)
Integral_{x=0..1} 1 = 1,
Integral_{x=0..1} x = 1/2,
Integral_{x=0..1} 2*x^2 - x = 1/6,
Integral_{x=0..1} 6*x^3 - 6*x^2 + x = 0,
Integral_{x=0..1} 24*x^4 - 36*x^3 + 14*x^2 - x = -1/30,
Integral_{x=0..1} 120*x^5 - 240*x^4 + 150*x^3 - 30*x^2 + x = 0,
...
Integral_{x=0..1} Sum_{k=0..n} (-1)^n*Stirling2(n,k)*k!*(-x)^k = Bernoulli(n). (End)
		

References

  • Jacob Bernoulli, Ars Conjectandi, Basel: Thurneysen Brothers, 1713. See page 97.
  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See pp. 106-108.

Crossrefs

Programs

  • Haskell
    a164555 n = a164555_list !! n
    a164555_list = 1 : map (numerator . sum) (zipWith (zipWith (%))
       (zipWith (map . (*)) (tail a000142_list) a242179_tabf) a106831_tabf)
    -- Reinhard Zumkeller, Jul 04 2014
    
  • Maple
    A164555 := proc(n) if n <= 2 then 1; else numer(bernoulli(n)) ; fi; end: # R. J. Mathar, Aug 26 2009
    seq(numer(n!*coeff(series(t/(1-exp(-t)),t,n+2),t,n)),n=0..40); # Peter Luschny, Jun 17 2012
  • Mathematica
    CoefficientList[ Series[ x/(1 - Exp[-x]), {x, 0, 40}], x]*Range[0, 40]! // Numerator (* Jean-François Alcover, Mar 04 2013 *)
    Table[Numerator[BernoulliB[n,1]], {n, 0, 40}] (* Vaclav Kotesovec, Jan 03 2021 *)
  • Sage
    a = lambda n: bernoulli_polynomial(1,n).numerator()
    [a(n) for n in (0..40)] # Peter Luschny, Jan 09 2017

Formula

a(n) = numerator(B(n)) with B(n) = Sum_{k=0..n} (-1)^(n-k) * C(n+1, k+1) * S(n+k, k) / C(n+k, k) and S the Stirling set numbers. - Peter Luschny, Jun 25 2016
a(n) = numerator(n*EulerPolynomial(n-1, 1)/(2*(2^n-1))) for n>=1. - Peter Luschny, Sep 01 2017
From Artur Jasinski, Jan 01 2021: (Start)
a(n) = numerator(-2*cos(Pi*n/2)*Gamma(n+1)*zeta(n)/(2*Pi)^n) for n != 1.
a(n) = numerator(-n*zeta(1-n)) for n >= 1. In the case n = 0 take the limit. (End)

Extensions

Edited and extended by R. J. Mathar, Sep 03 2009
Name extended by Peter Luschny, Jan 09 2017

A033880 Abundance of n, or (sum of divisors of n) - 2n.

Original entry on oeis.org

-1, -1, -2, -1, -4, 0, -6, -1, -5, -2, -10, 4, -12, -4, -6, -1, -16, 3, -18, 2, -10, -8, -22, 12, -19, -10, -14, 0, -28, 12, -30, -1, -18, -14, -22, 19, -36, -16, -22, 10, -40, 12, -42, -4, -12, -20, -46, 28, -41, -7, -30, -6, -52, 12, -38, 8, -34, -26, -58, 48, -60, -28, -22
Offset: 1

Views

Author

Keywords

Comments

For no known n is a(n) = 1. If there is such an n it must be greater than 10^35 and have seven or more distinct prime factors (Hagis and Cohen 1982). - Jonathan Vos Post, May 01 2011
a(n) = -1 iff n is a power of 2. a(n) = 1 - n iff n is prime. - Omar E. Pol, Jan 30 2014 [If a(n) = -1 then n is called a least deficient number or an almost perfect number. All the powers of 2 are least deficient numbers but it is not known if there exists a least deficient number that is not a power of 2. See A000079. - Jianing Song, Oct 13 2019]
According to Deléglise (1998), the abundant numbers have natural density 0.2474 < A(2) < 0.2480 (cf. A302991). Since the perfect numbers having density 0, the deficient numbers have density 0.7520 < 1 - A(2) < 0.7526 (cf. A318172). - Daniel Forgues, Oct 10 2015
2-abundance of n, a special case of the k-abundance of n, defined as (sum of divisors of n) - k*n, k >= 1. - Daniel Forgues, Oct 24 2015
Not to be confused with the abundancy of n, defined as (sum of divisors of n) / n. (Cf. A017665 / A017666.) - Daniel Forgues, Oct 25 2015

Examples

			For n = 10 the divisors of 10 are 1, 2, 5, 10. The sum of proper divisors of 10 minus 10 is 1 + 2 + 5 - 10 = -2, so the abundance of 10 is a(10) = -2. - _Omar E. Pol_, Dec 27 2013
		

References

  • Richard K. Guy, "Almost Perfect, Quasi-Perfect, Pseudoperfect, Harmonic, Weird, Multiperfect and Hyperperfect Numbers." Section B2 in Unsolved Problems in Number Theory, 2nd ed., New York: Springer-Verlag, pp. 45-53, 1994.
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 147.

Crossrefs

Equals -A033879.
Lists of positions where certain values occur: A005100 (a(n) < 0), A000396 (a(n) = 0) and A005101 (a(n) > 0), A023197 (a(n) >= n), A028982 (a(n) odd).

Programs

  • Magma
    [SumOfDivisors(n)-2*n: n in [1..100]]; // Vincenzo Librandi, Oct 11 2015
    
  • Maple
    with(numtheory); n->sigma(n) - 2*n;
  • Mathematica
    Array[Total[Divisors[#]]-2#&,70] (* Harvey P. Dale, Sep 16 2011 *)
    Table[DivisorSigma[1, n] - 2*n, {n, 1, 70}] (* Amiram Eldar, Jun 09 2022 *)
  • PARI
    a(n)=sigma(n)-2*n \\ Charles R Greathouse IV, Nov 20 2012
    
  • Python
    from sympy import divisor_sigma
    def A033880(n): return divisor_sigma(n)-(n<<1) # Chai Wah Wu, Apr 12 2024
    
  • SageMath
    [sigma(n, 1)-2*n for n in range(1, 64)] # Stefano Spezia, Jul 18 2025

Formula

a(n) = A000203(n) - A005843(n). - Omar E. Pol, Dec 14 2008
a(n) = A001065(n) - n. - Omar E. Pol, Dec 27 2013
Sum_{k=1..n} a(k) ~ c * n^2, where c = Pi^2/12 - 1 = -0.1775329665... . - Amiram Eldar, Apr 06 2024

Extensions

Definition corrected Jul 04 2005

A036263 Second differences of primes.

Original entry on oeis.org

1, 0, 2, -2, 2, -2, 2, 2, -4, 4, -2, -2, 2, 2, 0, -4, 4, -2, -2, 4, -2, 2, 2, -4, -2, 2, -2, 2, 10, -10, 2, -4, 8, -8, 4, 0, -2, 2, 0, -4, 8, -8, 2, -2, 10, 0, -8, -2, 2, 2, -4, 8, -4, 0, 0, -4, 4, -2, -2, 8, 4, -10, -2, 2, 10, -8, 4, -8, 2, 2, 2, -2, 0, -2, 2, 2, -4, 4, 2, -8, 8, -8, 4, -2, 2, 2, -4, -2, 2, 8, -4
Offset: 1

Views

Author

Keywords

Examples

			a(3) = 5 + 11 - 2*7 = 16 - 14 = 2.
		

Crossrefs

For records see A293154, A293155.

Programs

  • Haskell
    a036263 n = a036263_list !! (n-1)
    a036263_list = zipWith (-) (tail a001223_list) a001223_list
    -- Reinhard Zumkeller, Oct 29 2011
    
  • Maple
    A036263:=n->ithprime(n) + ithprime(n+2) - 2*ithprime(n+1); seq(A036263(n), n=1..100); # Wesley Ivan Hurt, Apr 01 2014
  • Mathematica
    Table[Prime[n - 1] + Prime[n + 1] - 2*Prime[n], {n, 2, 105}]
    Differences[Prime[Range[100]], 2] (* Harvey P. Dale, Oct 14 2012 *)
  • PARI
    for(n=2,100,print1(prime(n+2)-2*prime(n+1)+prime(n)","))
    
  • Python
    from sympy import prime
    def A036263(n): return prime(n)-(prime(n+1)<<1)+prime(n+2) # Chai Wah Wu, Sep 28 2024

Formula

a(A064113(n)) = 0. - Reinhard Zumkeller, Jan 20 2012
a(n) = prime(n) + prime(n+2) - 2*prime(n+1). - Thomas Ordowski, Jul 21 2012
Conjecture: |a(1)| + |a(2)| + ... + |a(n)| ~ prime(n). - Thomas Ordowski, Jul 21 2012
a(n) = A001223(n+1) - A001223(n). - R. J. Mathar, Sep 19 2013
Sum_{i = 1..n - 1} a(i) = A046933(n), n >= 1. - Daniel Forgues, Apr 15 2014
Sum_{i = 2..n - 1} a(i) = prime(n + 1) - prime(n) - 2; Sum_{i = 2..n - 1} a(i) = 0 whenever prime(n) is a lesser of twin primes. - Hamdi Murat Yildirim, Jun 24 2014

A056594 Period 4: repeat [1,0,-1,0]; expansion of 1/(1 + x^2).

Original entry on oeis.org

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

Views

Author

Wolfdieter Lang, Aug 04 2000

Keywords

Comments

G.f. is inverse of cyclotomic(4,x). Unsigned: A000035(n+1).
Real part of i^n and imaginary part of i^(n+1), i=sqrt(-1). - Reinhard Zumkeller, Jul 22 2007
The BINOMIAL transform generates A009116(n); the inverse BINOMIAL transform generates (-1)^n*A009116(n). - R. J. Mathar, Apr 07 2008
a(n-1), n >= 1, is the nontrivial Dirichlet character modulo 4, called Chi_2(4;n) (the trivial one is Chi_1(4;n) given by periodic(1,0) = A000035(n)). See the Apostol reference, p. 139, the k = 4, phi(k) = 2 table. - Wolfdieter Lang, Jun 21 2011
a(n-1), n >= 1, is the character of the Dirichlet beta function. - Daniel Forgues, Sep 15 2012
a(n-1), n >= 1, is also the (strongly) multiplicative function h(n) of Theorem 5.12, p. 150, of the Niven-Zuckerman reference. See the formula section. This function h(n) can be employed to count the integer solutions to n = x^2 + y^2. See A002654 for a comment with the formula. - Wolfdieter Lang, Apr 19 2013
This sequence is duplicated in A101455 but with offset 1. - Gary Detlefs, Oct 04 2013
For n >= 2 this gives the determinant of the bipartite graph with 2*n nodes and the adjacency matrix A(n) with elements A(n;1,2) = 1 = A(n;n,n-1), and for 1 < i < n A(n;i,i+1) = 1 = A(n;i,i-1), otherwise 0. - Wolfdieter Lang, Jun 25 2023

Examples

			With a(n-1) = h(n) of Niven-Zuckerman: a(62) = h(63) = h(3^2*7^1) = (-1)^(2*1)*(-1)^(1*3) = -1 = h(3)^2*h(7) = a(2)^2*a(6) = (-1)^2*(-1) = -1. - _Wolfdieter Lang_, Apr 19 2013
		

References

  • T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1986.
  • I. S. Gradstein and I. M. Ryshik, Tables of series, products, and integrals, Volume 1, Verlag Harri Deutsch, 1981.
  • Ivan Niven and Herbert S. Zuckerman, An Introduction to the Theory of Numbers, New York: John Wiley (1980), p. 150.
  • Jerome Spanier and Keith B. Oldham, "Atlas of Functions", Hemisphere Publishing Corp., 1987, chapter 32, equation 32:6:1 at page 300.

Crossrefs

Cf. A049310, A074661, A131852, A002654, A146559 (binomial transform).

Programs

  • Magma
    &cat[ [1, 0, -1, 0]: n in [0..23] ]; // Bruno Berselli, Feb 08 2011
    
  • Maple
    A056594 := n->(1-irem(n,2))*(-1)^iquo(n,2); # Peter Luschny, Jul 27 2011
  • Mathematica
    CoefficientList[Series[1/(1 + x^2), {x, 0, 50}], x]
    a[n_]:= KroneckerSymbol[-4,n+1];Table[a[n],{n,0,93}] (* Thanks to Jean-François Alcover. - Wolfdieter Lang, May 31 2013 *)
    CoefficientList[Series[1/Cyclotomic[4, x], {x, 0, 100}], x] (* Vincenzo Librandi, Apr 03 2014 *)
  • Maxima
    A056594(n) := block(
            [1,0,-1,0][1+mod(n,4)]
    )$ /* R. J. Mathar, Mar 19 2012 */
    
  • PARI
    {a(n) = real( I^n )}
    
  • PARI
    {a(n) = kronecker(-4, n+1) }
    
  • Python
    def A056594(n): return (1,0,-1,0)[n&3] # Chai Wah Wu, Sep 23 2023

Formula

G.f.: 1/(1+x^2).
E.g.f.: cos(x).
a(n) = (1/2)*((-i)^n + i^n), where i = sqrt(-1). - Mitch Harris, Apr 19 2005
a(n) = (1/2)*((-1)^(n+floor(n/2)) + (-1)^floor(n/2)).
Recurrence: a(n)=a(n-4), a(0)=1, a(1)=0, a(2)=-1, a(3)=0.
a(n) = T(n, 0) = A053120(n, 0); T(n, x) Chebyshev polynomials of the first kind. - Wolfdieter Lang, Aug 21 2009
a(n) = S(n, 0) = A049310(n, 0); S(n, x) := U(n, x/2), Chebyshev polynomials of 2nd kind.
Sum_{k>=0} a(k)/(k+1) = Pi/4. - Jaume Oliver Lafont, Mar 30 2010
a(n) = Sum_{k=0..n} A101950(n,k)*(-1)^k. - Philippe Deléham, Feb 10 2012
a(n) = (1/2)*(1 + (-1)^n)*(-1)^(n/2). - Bruno Berselli, Mar 13 2012
a(0) = 1, a(n-1) = 0 if n is even, a(n-1) = Product_{j=1..m} (-1)^(e_j*(p_j-1)/2) if the odd n-1 = p_1^(e_1)*p_2^(e_2)*...*p_m^(e_m) with distinct odd primes p_j, j=1..m. See the function h(n) of Theorem 5.12 of the Niven-Zuckerman reference. - Wolfdieter Lang, Apr 19 2013
a(n) = (-4/(n+1)), n >= 0, where (k/n) is the Kronecker symbol. See the Eric Weisstein and Wikipedia links. Thanks to Wesley Ivan Hurt. - Wolfdieter Lang, May 31 2013
a(n) = R(n,0)/2 with the row polynomials R of A127672. This follows from the product of the zeros of R, and the formula Product_{k=0..n-1} 2*cos((2*k+1)*Pi/(2*n)) = (1 + (-1)^n)*(-1)^(n/2), n >= 1 (see the Gradstein and Ryshik reference, p. 63, 1.396 4., with x = sqrt(-1)). - Wolfdieter Lang, Oct 21 2013
a(n) = Sum_{k=0..n} i^(k*(k+1)), where i=sqrt(-1). - Bruno Berselli, Mar 11 2015
Dirichlet g.f. of a(n) shifted right: L(chi_2(4),s) = beta(s) = (1-2^(-s))*(d.g.f. of A034947), see comments by Lang and Forgues. - Ralf Stephan, Mar 27 2015
a(n) = cos(n*Pi/2). - Ridouane Oudra, Sep 29 2024

A006352 Coefficients in expansion of Eisenstein series E_2 (also called E_1 or G_2).

Original entry on oeis.org

1, -24, -72, -96, -168, -144, -288, -192, -360, -312, -432, -288, -672, -336, -576, -576, -744, -432, -936, -480, -1008, -768, -864, -576, -1440, -744, -1008, -960, -1344, -720, -1728, -768, -1512, -1152, -1296, -1152, -2184, -912, -1440, -1344, -2160, -1008, -2304, -1056, -2016, -1872, -1728
Offset: 0

Views

Author

Keywords

Comments

Ramanujan's Eisenstein series: P(q) (see A006352), Q(q) (A004009), R(q) (A013973).
The series Q(q), R(q) are modular forms, but P(q) is not. - Michael Somos, May 18 2017

Examples

			G.f. = 1 - 24*x - 72*x^2 - 96*x^3 - 168*x^4 - 144*x^5 - 288*x^6 + ...
		

References

  • R. C. Gunning, Lectures on Modular Forms. Princeton Univ. Press, Princeton, NJ, 1962, p. 53.
  • N. Koblitz, Introduction to Elliptic Curves and Modular Forms, Springer-Verlag, 1984, see pp. 111 and 113.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • Zagier, Don. "Elliptic modular forms and their applications." The 1-2-3 of modular forms. Springer Berlin Heidelberg, 2008. 1-103. See p. 19, Eq. (17).

Crossrefs

Cf. A006352 (E_2), A004009 (E_4), A013973 (E_6), A008410 (E_8), A013974 (E_10), A029828 (E_12), A058550 (E_14), A029829 (E_16), A029830 (E_20), A029831 (E_24).
Cf. A000594 (Delta), A076835, A145155 (Delta').

Programs

  • Maple
    E := proc(k) local n,t1; t1 := 1-(2*k/bernoulli(k))*add(sigma[k-1](n)*q^n,n=1..60); series(t1,q,60); end; E(2);
  • Mathematica
    a[n_] := -24*DivisorSigma[1, n]; a[0] = 1; Table[a[n], {n, 0, 46}] (* Jean-François Alcover, Dec 12 2012 *)
    a[ n_] := If[ n < 1, Boole[n == 0], -24 DivisorSigma[ 1, n]]; (* Michael Somos, Apr 08 2015 *)
  • PARI
    {a(n) = if( n<1, n==0, -24 * sigma(n))}; /* Michael Somos, Apr 09 2003 */
    
  • Python
    from sympy import divisor_sigma
    def a(n): return 1 if n == 0 else -24 * divisor_sigma(n)
    [a(n) for n in range(51)]  # Indranil Ghosh, Jul 15 2017

Formula

a(n) = -24*sigma(n) = -24*A000203(n), for n>0.
G.f. A(x) satisfies 0 = f(A(x), A(x^2), A(x^3), A(x^6)) where f(u1, u2, u3, u6) = u1^2 + 4*u2^2 + 9*u3^2 + 36*u6^2 - 8*u1*u2 + 6*u1*u3 + 24*u2*u6 - 72*u3*u6. - Michael Somos, May 29 2005
G.f.: 1 - 24*sum(k>=1, k*x^k/(1 - x^k)).
G.f.: 1 + 24 *x*deriv(eta(x))/eta(x) where eta(x) = prod(n>=1, 1-x^n); (cf. A000203). - Joerg Arndt, Sep 28 2012
G.f.: 1 - 24*x/(1-x) + 48*x^2/(Q(0) - 2*x^2 + 2*x), where Q(k)= (2*x^(k+2) - x - 1)*k - 1 - 2*x + 3*x^(k+2) - x*(k+1)*(k+3)*(1-x^(k+2))^2/Q(k+1); (continued fraction). - Sergei N. Gladkovskii, May 16 2013
G.f.: q*Delta'/Delta where Delta is the generating function of Ramanujan's tau function (A000594). - Seiichi Manyama, Jul 15 2017

A006232 Numerators of Cauchy numbers of first type.

Original entry on oeis.org

1, 1, -1, 1, -19, 9, -863, 1375, -33953, 57281, -3250433, 1891755, -13695779093, 24466579093, -132282840127, 240208245823, -111956703448001, 4573423873125, -30342376302478019, 56310194579604163
Offset: 0

Views

Author

Keywords

Comments

The corresponding denominators are given in A006233.
-a(n+1), n>=0, also numerators from e.g.f. 1/x-1/log(1+x), with denominators A075178(n). |a(n+1)|, n>=0, numerators from e.g.f. 1/x+1/log(1-x) with denominators A075178(n). For formula of unsigned a(n) see A075178.
The signed rationals a(n)/A006233(n) provide the a-sequence for the Stirling2 Sheffer matrix A048993. See the W. Lang link concerning Sheffer a- and z-sequences.
Cauchy numbers of the first type are also called Bernoulli numbers of the second kind.
Named after the French mathematician, engineer and physicist Augustin-Louis Cauchy (1789-1857). - Amiram Eldar, Jun 17 2021

Examples

			1, 1/2, -1/6, 1/4, -19/30, 9/4, -863/84, 1375/24, -33953/90, ...
		

References

  • Louis Comtet, Advanced Combinatorics, Reidel, 1974, p. 294.
  • Harold Jeffreys and B. S. Jeffreys, Methods of Mathematical Physics, Cambridge, 1946, p. 259.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Magma
    [Numerator((&+[StirlingFirst(n,k)/(k+1): k in [0..n]])): n in [0..20]]; // G. C. Greubel, Nov 13 2018
    
  • Maple
    seq(numer(add(stirling1(n,k)/(k+1),k=0..n)),n=0..20); # Peter Luschny, Apr 28 2009
  • Mathematica
    a[n_] := Numerator[ Sum[ StirlingS1[n, k]/(k + 1), {k, 0, n}]]; Table[a[n], {n, 0, 19}] (* Jean-François Alcover, Nov 03 2011, after Maple *)
    a[n_] := Numerator[ Integrate[ Gamma[x+1]/Gamma[x-n+1], {x, 0, 1}]]; Table[a[n], {n, 0, 19}] (* Jean-François Alcover, Jul 29 2013 *)
    a[ n_] := If[ n < 0, 0, (-1)^n Numerator @ Integrate[ Pochhammer[ -x, n], {x, 0, 1}]]; (* Michael Somos, Jul 12 2014 *)
    a[ n_] := If[ n < 0, 0, Numerator [ n! SeriesCoefficient[ x / Log[ 1 + x], {x, 0, n}]]]; (* Michael Somos, Jul 12 2014 *)
    Join[{1}, Array[Numerator[(1/#) Integrate[Product[(x - k), {k, 0, # - 1}], {x, 0, 1}]] &, 25]] (* Michael De Vlieger, Nov 13 2018 *)
  • PARI
    for(n=0,20, print1(numerator( sum(k=0,n, stirling(n, k, 1)/(k+1)) ), ", ")) \\ G. C. Greubel, Nov 13 2018
    
  • Python
    # Results are abs values
    from fractions import gcd
    aa,n,sden = [0,1],1,1
    while n < 20:
        j,snom,sden,a = 1,0,(n+1)*sden,0
        while j < len(aa):
            snom,j = snom+aa[j]*(sden//(j+1)),j+1
        nom,den = snom,sden
        print(n,nom//gcd(nom,den))
        aa,j = aa+[-aa[j-1]],j-1
        while j > 0:
            aa[j],j = n*aa[j]-aa[j-1],j-1
        n = n+1 # A.H.M. Smeets, Nov 14 2018
    
  • Python
    from fractions import Fraction
    from sympy.functions.combinatorial.numbers import stirling
    def A006232(n): return sum(Fraction(stirling(n,k,kind=1,signed=True),k+1) for k in range(n+1)).numerator # Chai Wah Wu, Jul 09 2023
  • Sage
    def A006232_list(len):
        f, R, C = 1, [1], [1]+[0]*(len-1)
        for n in (1..len-1):
            for k in range(n, 0, -1):
                C[k] = -C[k-1] * k / (k + 1)
            C[0] = -sum(C[k] for k in (1..n))
            R.append((C[0]*f).numerator())
            f *= n
        return R
    print(A006232_list(20)) # Peter Luschny, Feb 19 2016
    

Formula

Numerator of integral of x(x-1)...(x-n+1) from 0 to 1.
E.g.f.: x/log(1+x). (Note: the numerator of the coefficient of x^n/n! is a(n) - Michael Somos, Jul 12 2014)
Numerator of Sum_{k=0..n} A048994(n,k)/(k+1). - Peter Luschny, Apr 28 2009
Sum_{k=1..n} 1/k = C + log(n) + 1/(2n) + Sum_{k=2..inf} |a(n)|/A075178(n-1) * 1/(n*(n+1)*...*(n+k-1)) (section 0.131 in Gradshteyn and Ryzhik tables). - Ralf Stephan, Jul 12 2014
a(n) = numerator(f(n) * n!), where f(0) = 1, f(n) = Sum_{k=0..n-1} (-1)^(n-k+1) * f(k) / (n-k+1). - Daniel Suteu, Feb 23 2018
Sum_{k = 1..n} (1/k) = A001620 + log(n) + 1/(2n) - Sum_{k >= 2} abs((a(k)/A006233(k)/k/(Product_{j = 0..k-1} (n-j)))), (see I. S. Gradsteyn, I. M. Ryzhik). - A.H.M. Smeets, Nov 14 2018

A001057 Canonical enumeration of integers: interleaved positive and negative integers with zero prepended.

Original entry on oeis.org

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
Offset: 0

Views

Author

Keywords

Comments

Go forwards and backwards with increasing step sizes. - Daniele Parisse and Franco Virga, Jun 06 2005
The partial sums of the divergent series 1 - 2 + 3 - 4 + ... give this sequence. Euler summed it to 1/4 which was one of the first examples of summing divergent series. - Michael Somos, May 22 2007
From Peter Luschny, Jul 12 2009: (Start)
The general formula for alternating sums of powers is in terms of the Swiss-Knife polynomials P(n,x) A153641 2^(-n-1)(P(n,1)-(-1)^k P(n,2k+1)). Thus
a(k) = 2^(-2)(P(1,1)-(-1)^k P(1,2k+1)). (End)
Let A be the Hessenberg matrix of order n, defined by: A[1,j]=1, A[i,i]:=-1, A[i,i-1]=-1, and A[i,j]=0 otherwise. Then, for n>=4, a(n-3)=(-1)^(n-1)*coeff(charpoly(A,x),x). - Milan Janjic, Jan 26 2010
Cantor ordering of the integers producing a 1-1 and onto correspondence between the natural numbers and the integers showing that the set Z of integers has the same cardinality as the set N of natural numbers. The cardinal of N is the first transfinite cardinal aleph_null (or aleph_naught), which is the cardinality of a given infinite set if and only if it is countably infinite (denumerable), i.e., it can be put in 1-1 and onto correspondence (with a proper Cantor ordering) with the natural numbers. - Daniel Forgues, Jan 23 2010
a(n) is the determinant of the (n+2) X (n+2) (0,1)-Toeplitz matrix M satisfying: M(i,j)=0 iff i=j or i=j-1. The matrix M arises in the variation of ménage problem where not a round table, but one side of a rectangular table is considered (see comments of Vladimir Shevelev in A000271). Namely M(i,j) defines the class of permutations p of 1,2,...,n+2 such that p(i)<>i and p(i)<>i+1 for i=1,2,...,n+1, and p(n+2)<>n+2. And a(n) is also the difference between the number of even and odd such permutations. - Dmitry Efimov, Mar 02 2017

Examples

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

Crossrefs

Cf. A008619, A004526, A166711, A166871, A130472 (negation), A142150 (partial sums), A010551 (partial products for n > 0).
Alternating row sums of A104578 are a(n+1), for n >= 0.

Programs

  • Haskell
    a001057 n = (n' + m) * (-1) ^ (1 - m) where (n',m) = divMod n 2
    a001057_list = 0 : concatMap (\x -> [x,-x]) [1..]
    -- Reinhard Zumkeller, Apr 02 2012
    
  • Maple
    a := n -> (1-(-1)^n*(2*n+1))/4; # Peter Luschny, Jul 12 2009
  • Mathematica
    Join[{0},Riffle[Range[35],-Range[35]]] (* Harvey P. Dale, Sep 21 2011 *)
    a[ n_] := -(-1)^n Ceiling[n/2]; (* Michael Somos, Jun 05 2013 *)
    LinearRecurrence[{-1, 1, 1}, {0, 1, -1}, 63] (* Jean-François Alcover, Jan 07 2019 *)
  • PARI
    {a(n) = if( n%2, n\2 + 1, -n/2)}; /* Michael Somos, Jul 20 1999 */
    
  • Python
    def a(n): return n//2 + 1 if n%2 else -n//2
    print([a(n) for n in range(63)]) # Michael S. Branicky, Jul 14 2022

Formula

Euler transform of [-1, 2] is sequence a(n+1). - Michael Somos, Jun 11 2003
G.f.: x / ((1 + x) * (1 - x^2)). - Michael Somos, Jul 20 1999
E.g.f.: (exp(x) - (1 - 2*x) * exp(-x)) / 4. - Michael Somos, Jun 11 2003
a(n) = 1 - 2*a(n-1) -a(n-2); a(2*n) = -n, a(2*n+1) = n+1. - Michael Somos, Jul 20 1999
|a(n+1)| = A008619(n). |a(n-1)| = A004526(n). - Michael Somos, Jul 20 1999
a(n) = -a(n-1) + a(n-2) + a(n-3). a(n) = (-1)^(n+1) * floor((n+1) / 2). - Michael Somos, Jun 11 2003
a(1) = 1, a(n) = a(n-1)+n or a(n-1)-n whichever is closer to 0 on the number line. Or abs(a(n)) = min{abs(a(n-1)+n), abs(a(n-1)-n)}. - Amarnath Murthy, Jul 01 2003
a(n) = Sum_{k=0..n} k*(-1)^(k+1). - Paul Barry, Aug 20 2003
a(n) = (1-(2n+1)*(-1)^n)/4. - Paul Barry, Feb 02 2004
a(0) = 0; a(n) = (-1)^(n-1) * (n-|a(n-1)|) for n >= 1. - Rick L. Shepherd, Jul 14 2004
a(n) = a(n-1)-n*(-1)^n, a(0)=0; or a(n) = -a(n-1)+(1-(-1)^n)/2, a(0)=0. - Daniele Parisse and Franco Virga, Jun 06 2005
a(n) = ceiling(n/2) * (-1)^(n+1), n >= 0. - Franklin T. Adams-Watters, Nov 25 2011 (corrected by Daniel Forgues, Jul 21 2012)
a(n) = a(-1-n) for all n in Z. - Michael Somos, Jun 05 2013
Sum_{n>=1} 1/a(n) = 0. - Jaume Oliver Lafont, Jul 14 2017

Extensions

Thanks to Michael Somos for helpful comments.
Name edited by Franklin T. Adams-Watters, Jan 30 2012
Previous Showing 21-30 of 21686 results. Next