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 81-90 of 288 results. Next

A064384 Primes p such that p divides 0!-1!+2!-3!+...+(-1)^{p-1}(p-1)!.

Original entry on oeis.org

2, 5, 13, 37, 463
Offset: 1

Views

Author

Kevin Buzzard (buzzard(AT)ic.ac.uk), Sep 28 2001

Keywords

Comments

If p is in the sequence then p divides 0!-1!+2!-3!+...+(-1)^N N! for all sufficiently large N. Naive heuristics suggest that the sequence should be infinite but very sparse.
Same as the terms > 1 in A124779. - Jonathan Sondow, Nov 09 2006
A prime p is in the sequence if and only if p|A(p-1), where A(0) = 1 and A(n) = n*A(n-1)+1 = A000522(n). - Jonathan Sondow, Dec 22 2006
Also, a prime p is in this sequence if and only if p divides A061354(p-1). - Alexander Adamchuk, Jun 14 2007
Michael Mossinghoff has calculated that 2, 5, 13, 37, 463 are the only terms up to 150 million. - Jonathan Sondow, Jun 12 2007

Examples

			5 is in the sequence because 5 is prime and it divides 0!-1!+2!-3!+4!=20.
		

References

  • R. K. Guy, Unsolved Problems in Theory of Numbers, Springer-Verlag, Third Edition, 2004, B43.

Crossrefs

Programs

  • Mathematica
    Select[Select[Range[500], PrimeQ], (Mod[Sum[(-1)^(p - 1)*p!, {p, 2, # - 1}], #] == 0) &] (* Julien Kluge, Feb 13 2016 *)
    a[0] = 1; a[n_] := a[n] = n*a[n - 1] + 1; Select[Select[Range[500], PrimeQ], (Mod[a[# - 1], #] == 0) &] (* Julien Kluge, Feb 13 2016 with the sequence approach suggested by Jonathan Sondow *)
    Select[Prime[Range[500]],Divisible[AlternatingFactorial[#]-1,#]&] (* Harvey P. Dale, Jan 08 2021 *)
  • PARI
    A=1;for(n=1,1000,if(isprime(n),if(Mod(A,n)==0,print(n)));A=n*A+1) \\ Jonathan Sondow, Dec 22 2006

Extensions

Edited by Max Alekseyev, Mar 05 2011

A087350 a(n) = Sum_{k=0..n} (3*n)!/(3*k)!.

Original entry on oeis.org

1, 7, 841, 423865, 559501801, 1527439916731, 7478345832314977, 59677199741873516461, 724719913665311983902385, 12718834484826225317486856751, 309830808050366848733979830454361, 10142621332336809160155563729753961697, 434509897877308904421064350182659719099481
Offset: 0

Views

Author

Vladeta Jovovic, Oct 20 2003

Keywords

Crossrefs

Programs

  • PARI
    a(n)={sum(k=0, n, (3*n)!/(3*k)!)} \\ Andrew Howroyd, Jan 27 2020

Formula

a(n) = floor((3*n)!*C) where C = 1/3*exp(1)+2/3*exp(-1/2)*cos(1/2*3^(1/2)) = 1.16805831337591852551625692...

Extensions

Terms a(11) and beyond from Andrew Howroyd, Jan 27 2020

A092582 Triangle read by rows: T(n,k) is the number of permutations p of [n] having length of first run equal to k.

Original entry on oeis.org

1, 1, 1, 3, 2, 1, 12, 8, 3, 1, 60, 40, 15, 4, 1, 360, 240, 90, 24, 5, 1, 2520, 1680, 630, 168, 35, 6, 1, 20160, 13440, 5040, 1344, 280, 48, 7, 1, 181440, 120960, 45360, 12096, 2520, 432, 63, 8, 1, 1814400, 1209600, 453600, 120960, 25200, 4320, 630, 80, 9, 1
Offset: 1

Views

Author

Emeric Deutsch and Warren P. Johnson (wjohnson(AT)bates.edu), Apr 10 2004

Keywords

Comments

Row sums are the factorial numbers (A000142). First column is A001710.
T(n,k) = number of permutations of [n] in which 1,2,...,k is a subsequence but 1,2,...,k,k+1 is not. Example: T(4,2)=8 because 1324, 1342, 1432, 4132, 3124, 3142, 3412 and 4312, are the only permutations of [4] in which 12 is a subsequence but 123 is not. - Emeric Deutsch, Nov 12 2004
T(n,k) is the number of deco polyominoes of height n with k cells in the last column. (A deco polyomino is a directed column-convex polyomino in which the height, measured along the diagonal, is attained only in the last column). - Emeric Deutsch, Jan 06 2005
T(n,k) is the number of permutations p of [n] for which the smallest i such that p(i)Emeric Deutsch, Feb 23 2008
Adding columns 2,4,6,... one obtains the derangement numbers 0,1,2,9,44,... (A000166). See the Bona reference (p. 118, Exercises 41,42). - Emeric Deutsch, Feb 23 2008
Matrix inverse of A128227*A154990. - Mats Granvik, Feb 08 2009
Differences in the columns of A173333 which counts the n-permutations with an initial ascending run of length at least k. - Geoffrey Critzer, Jun 18 2017
The triangle with each row reversed is A130477. - Michael Somos, Jun 25 2017

Examples

			T(4,3) = 3 because 1243, 1342 and 2341 are the only permutations of [4] having length of first run equal to 3.
     1;
     1,    1;
     3,    2,   1;
    12,    8,   3,   1;
    60,   40,  15,   4,  1;
   360,  240,  90,  24,  5,  1;
  2520, 1680, 630, 168, 35,  6,  1;
  ...
		

References

  • M. Bona, Combinatorics of Permutations, Chapman&Hall/CRC, Boca Raton, Florida, 2004.

Crossrefs

Programs

  • GAP
    Flat(List([1..11],n->Concatenation([1],List([1..n-1],k->Factorial(n)*k/Factorial(k+1))))); # Muniru A Asiru, Jun 10 2018
    
  • Magma
    A092582:= func< n,k | k eq n select 1 else k*Factorial(n)/Factorial(k+1) >;
    [A092582(n,k): k in [1..n], n in [1..12]]; // G. C. Greubel, Sep 06 2022
    
  • Mathematica
    Drop[Drop[Abs[Map[Select[#, # < 0 &] &, Map[Differences, nn = 10; Range[0, nn]! CoefficientList[Series[(Exp[y x] - 1)/(1 - x), {x, 0, nn}], {x, y}]]]], 1], -1] // Grid (* Geoffrey Critzer, Jun 18 2017 *)
  • PARI
    {T(n, k) = if( n<1 || k>n, 0, k==n, 1, n! * k /(k+1)!)}; /* Michael Somos, Jun 25 2017 */
    
  • SageMath
    def A092582(n,k): return 1 if (k==n) else k*factorial(n)/factorial(k+1)
    flatten([[A092582(n,k) for k in (1..n)] for n in (1..12)]) # G. C. Greubel, Sep 06 2022

Formula

T(n, k) = n!*k/(k+1)! for k
Inverse of:
1;
-1, 1;
-1, -2, 1;
-1, -2, -3, 1;
-1, -2, -3, -4, 1;
... where A002260 = (1; 1,2; 1,2,3; ...). - Gary W. Adamson, Feb 22 2012
T(2n,n) = A092956(n-1) for n>0. - Alois P. Heinz, Jun 19 2017
From Alois P. Heinz, Dec 17 2021: (Start)
Sum_{k=1..n} k * T(n,k) = A002627(n).
|Sum_{k=1..n} (-1)^k * T(n,k)| = A055596(n) for n>=1. (End)
From G. C. Greubel, Sep 06 2022: (Start)
T(n, 1) = A001710(n).
T(n, 2) = 2*A001715(n) + [n=2]/3, n >= 2.
T(n, 3) = 3*A001720(n) + [n=3]/4, n >= 3.
T(n, 4) = 4*A001725(n) + [n=4]/5, n >= 4.
T(n, n-1) = A000027(n-1).
T(n, n-2) = A005563(n-1), n >= 3. (End)
Sum_{k=0..n} (k+1) * T(n,k) = A000522(n). - Alois P. Heinz, Apr 28 2023

A093964 a(n) = Sum_{k=1..n} k*k!*C(n,k).

Original entry on oeis.org

0, 1, 6, 33, 196, 1305, 9786, 82201, 767208, 7891281, 88776910, 1085051121, 14322674796, 203121569833, 3080677142466, 49764784609065, 853110593298256, 15469738758475041, 295858753755835158, 5951981987323272001, 125652953065713520020, 2777591594084193600441
Offset: 0

Author

Ralf Stephan, Apr 20 2004

Keywords

Comments

Limit to which the columns of array A093966 converge.
Number of objects in all permutations of n objects taken 1,2,...,n at a time. Example: a(2)=6 because the permutations of {a,b} taken 1 and 2 at a time are: a,b,ab and ba, containing altogether 1+1+2+2=6 objects. a(n)=Sum(k*A008279(n,k),k=1..n). - Emeric Deutsch, Aug 16 2006
The number of sequences -where each member is an element in a set consisting of n elements- such that the last member is a repetition of a former member. Example: Set of possible members: {l,r}. Sequences such that the last member is a repetition of a former member: l,l; r,r; l,r,l; l,r,r; r,l,l; r,l,r. a(n)=Sum(k*A008279(n,k),k=1..n). [From Franz Fritsche (ff(AT)simple-line.de), Feb 22 2009]
The total number of elements in all ascending runs (including runs of length 1) over all permutations of {1,2,...,n}. a(2) = 6 because in the permutations [1,2] and [2,1] there are 4 runs of length 1 and 1 run of length 2. a(n) = Sum_{k>=1} A132159(n,k)*k. - Geoffrey Critzer, Feb 24 2014

Examples

			G.f. = x + 6*x^2 + 33*x^3 + 196*x^4 + 1305*x^5 + 9786*x^6 + 82201*x^7 + ...
		

Crossrefs

Row n=2 of A210472. - Alois P. Heinz, Jan 23 2013

Programs

  • Magma
    [0] cat [n le 2 select 6^(n-1) else n*((n+1)*Self(n-1) - (n-1)*Self(n-2))/(n-1): n in [1..30]]; // G. C. Greubel, Dec 29 2021
    
  • Maple
    seq(add(k*n!/(n-k)!,k=1..n),n=0..20); # Emeric Deutsch, Aug 16 2006
    # second Maple program:
    a:= proc(n) a(n):=`if`(n<2, n, n*((n+1)/(n-1)*a(n-1)-a(n-2))) end:
    seq(a(n), n=0..30);  # Alois P. Heinz, Jan 21 2013
  • Mathematica
    nn=21;Range[0,nn]!CoefficientList[Series[D[Exp[y x]/(1-x)^2,y]/.y->1,{x,0,nn}],x] (* Geoffrey Critzer, Feb 24 2014 *)
  • PARI
    a(n)=sum(k=1,n,k*k!*binomial(n,k))
    
  • Sage
    [factorial(n)*( x*exp(x)/(1-x)^2 ).series(x,n+1).list()[n] for n in (0..30)] # G. C. Greubel, Dec 29 2021

Formula

E.g.f.: x*exp(x)/(1-x)^2. - Vladeta Jovovic, Apr 24 2004
a(n) = 1 + (n-1)*floor(e*n!) = 1 + (n-1)*A000522(n) = A000522(n+1) - 2*A000522(n) = A001339(n) - A000522(n). - Henry Bottomley, Dec 22 2008
a(n) = n if n < 2, a(n) = n*((n+1)/(n-1)*a(n-1) - a(n-2)) for n >= 2. - Alois P. Heinz, Jan 21 2013
E.g.f.: x*(1- 12*x/(Q(0)+6*x-3*x^2))/(1-x)^2, where Q(k) = 2*(4*k+1)*(32*k^2+16*k+x^2-6) - x^4*(4*k-1)*(4*k+7)/Q(k+1) ; (continued fraction). - Sergei N. Gladkovskii, Nov 18 2013
G.f.: conjecture: T(0)/x - 1/x, where T(k) = 1 - x^2*(k+1)^2/(x^2*(k+1)^2 - (1 - 2*x*(k+1))*(1 - 2*x*(k+2))/T(k+1) ); (continued fraction). - Sergei N. Gladkovskii, Nov 18 2013
a(n) = n*a(n-1) + A007526(n), a(0) = 0. - David M. Cerna, May 12 2014

Extensions

a(0) inserted by Alois P. Heinz, Jan 21 2013

A124779 a(n) = gcd(A(n), A(n+2))/gcd(d(n), d(n+2)) where A(n) = Sum_{k=0..n} n!/k! and d(n) = gcd(A(n), n!).

Original entry on oeis.org

1, 2, 5, 1, 1, 1, 1, 1, 1, 1, 13, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 37, 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

Author

Jonathan Sondow, Nov 07 2006

Keywords

Comments

The next term > 1 is a(460) = 463. The primes 2, 5, 13, 37, 463 are the only terms > 1 up to n = 600000. If a(n) > 1 with n > 1, then a(n) = n+3 is prime. This uses A(n+2) = (n+2)(n+1)*A(n) + n+3. The terms > 1 are A064384 = primes p such that p divides 0!-1!+2!-3!+...+(-1)^{p-1}(p-1)!. The proof uses (n-1)!/(n-k-1)! = (n-1)(n-2)...(n-k) == (-1)^k k! (mod n). Cf. Cloitre's comment in A064383.
An integer p > 1 is in the sequence if and only if p is prime and p|A(p-1), where A(0) = 1 and A(n) = n*A(n-1)+1 for n > 0. - Jonathan Sondow, Dec 22 2006
Michael Mossinghoff has calculated that there are only five primes in the sequence up to 150 million. Heuristics suggest it contains infinitely many. - Jonathan Sondow, Jun 12 2007

Examples

			a(2) = gcd(A(2), A(4))/gcd(d(2), d(4)) = gcd(5, 65)/gcd(1, 1) = 5/1 = 5.
		

References

  • R. K. Guy, Unsolved Problems in Number Theory, Springer-Verlag, 3rd edition, 2004, B43.

Crossrefs

A(n) = A000522, d(n) = A093101, gcd(A(n), A(n+2)) = A124780, gcd(d(n), d(n+2)) = A124781, (n+3)/gcd(A(n), A(n+2)) = A124782, (n+3)/gcd(d(n), d(n+2)) = A123901. Cf. A061354, A061355, A123899, A123900.
Cf. A129924.

Programs

  • Mathematica
    (A[n_] := Sum[n!/k!, {k, 0, n}]; d[n_] := GCD[A[n],n! ]; Table[GCD[A[n],A[n+2]]/GCD[d[n],d[n+2]], {n,0,100}])
  • PARI
    A124779(n)={my(An=A000522(n),A2=A000522(n+2));gcd(An, A2)/gcd([An,n!,A2,(n+2)!])} \\ M. F. Hasler, Jun 04 2019

Formula

a(n) = A124780(n)/A124781(n) = A124782(n)/A123901(n).
a(n) = gcd(A(n), A(n+2))/gcd(A(n), A(n+2), n!) where A(n)=1+n+n(n-1)+...+n!. - Jonathan Sondow, Nov 10 2006
a(n) = gcd(N(n), N(n+2)), where N(n) = A061354(n) = numerator of Sum[1/k!,{k,0,n}]. - Jonathan Sondow, Jun 12 2007

A142999 a(0) = 0, a(1) = 1; for n > 1, a(n+1) = (2*n + 1)*a(n) + n^4*a(n-1).

Original entry on oeis.org

0, 1, 3, 31, 460, 12076, 420336, 21114864, 1325949696, 109027627776, 10771080883200, 1316468976307200, 187978181665996800, 31997755234356019200, 6232784237890147123200, 1409976507981835100160000, 359243973790625586216960000, 104259271562188189469245440000
Offset: 0

Author

Peter Bala, Jul 18 2008

Keywords

Comments

This is the case m = 0 of the general recurrence a(0) = 1, a(1) = 1, a(n+1) = (2*m + 1)*(2*n + 1)*a(n) + n^4*a(n-1) (we suppress the dependence of a(n) on m), which arises when accelerating the convergence of the series Sum_{k >= 1} (-1)^(k+1)/k^2 for the constant 1/2*zeta(2). For other cases see A143000 (m = 1), A143001 (m = 2) and A143002 (m = 3).
The solution to the general recurrence may be expressed as a sum: a(n) = n!^2*p_m(n)*Sum_{k = 1..n} (-1)^(k+1)/(k^2*p_m(k-1)*p_m(k)), where p_m(x) := Sum_ {k = 0..m} C(m,k)*C(x,k)*C(x+k,k). Note that the polynomial q_m(x) := Sum_{k = 0..m} C(m,k)*C(m+k,k)*C(x,k), obtained by interchanging the roles of m and x, may be variously described as the Ehrhart polynomial of the polytope formed from the convex hull of a root system of type A_m, the polynomial that generates the crystal ball sequence for the A_m lattice [Bacher et al.], or the discrete Chebyshev polynomial D_m(N;x) at N = -1 [Gogin & Hirvensalo]. Compare with the comments in A142995.
The first few values are p_0(x) = 1, p_1(x) = x^2 + x + 1, p_2(x) = (x^4 + 2*x^3 + 7*x^2 + 6*x + 4)/4 and p_3(x) = (x^6 + 3*x^5 + 22*x^4 + 39*x^3 + 85*x^2 + 66*x + 36)/36.
The polynomial p_m(x) is the unique polynomial solution of the difference equation (x + 1)^2*f(x+1) - x^2*f(x-1) = (2*m + 1)*(2*x + 1)*f(x), normalized so that f(0) = 1. These polynomials have their zeros on the vertical line Re x = -1/2 in the complex plane; that is, the polynomials p_m(x-1), m = 1, 2, 3, ..., satisfy a Riemann hypothesis (adapt the proof of the lemma on p.4 of [BUMP et al.]).
The general recurrence in the first paragraph above has a second solution b(n) = (n!^2)*p_m(n) with initial conditions b(0) = 1, b(1) = 2*m + 1. Hence the behavior of a(n) for large n is given by lim_{n -> oo} a(n)/b(n) = Sum_{k >= 1} (-1)^(k+1)/(k^2*p_m(k-1)*p_m(k)) = 1/((2*m + 1) + 1^4/(3*(2*m + 1) + 2^4/(5*(2*m + 1) + ... + n^4/(((2*n + 1)*(2*m + 1) + ...)))) = (1/2)*Sum_{k >= 1} 1/(m + k)^2. The final equality follows from a result of Ramanujan; see [Berndt, Chapter 12, Corollary to Entry 30].
For results of a similar nature for the constants e, log(2), zeta(2) and zeta(3) see A000522, A142979, A142995 and A143003 respectively.

References

  • Bruce C. Berndt, Ramanujan's Notebooks Part II, Springer-Verlag.

Programs

  • Maple
    a := n -> n!^2*add ((-1)^(k+1)/k^2, k = 1..n): seq(a(n), n = 0..20);
  • Mathematica
    f[k_] := (k^2) (-1)^(k + 1)
    t[n_] := Table[f[k], {k, 1, n}]
    a[n_] := SymmetricPolynomial[n - 1, t[n]]
    Table[a[n], {n, 1, 18}]    (* A142999 signed *)
    (* Clark Kimberling, Dec 30 2011 *)
    RecurrenceTable[{a[0]==0,a[1]==1,a[n]==(2(n-1)+1)a[n-1]+(n-1)^4 a[n-2]},a,{n,20}] (* Harvey P. Dale, Apr 26 2014 *)

Formula

a(n) = (n!^2) * Sum_{k = 1..n} (-1)^(k+1)/k^2.
Recurrence: a(0) = 0, a(1) = 1, a(n+1) = (2*n + 1)*a(n) + (n^4)*a(n-1).
The sequence b(n) := n!^2 satisfies the same recurrence with the initial conditions b(0) = 1, b(1) = 1. Hence we obtain the finite continued fraction expansion a(n)/b(n) = 1/(1 + 1^4/(3 + 2^4/(5 + 3^4/(7 + ... + (n - 1)^4/(2*n - 1))))), for n >= 2.
Limit_{n -> oo} a(n)/b(n) = 1/(1 + 1^4/(3 + 2^4/(5 + 3^4/(7 + ... + n^4/((2*n + 1) + ...))))) = Sum_{k >= 1} (-1)^(k+1)/k^2 = 1/2*zeta(2).
Sum_{n>=0} a(n) * x^n / (n!)^2 = -polylog(2,-x) / (1 - x). - Ilya Gutkovskiy, Jul 15 2020

Extensions

a(0)=0 added by Vincenzo Librandi, Apr 27 2014

A330044 Expansion of e.g.f. exp(x) / (1 - x^3).

Original entry on oeis.org

1, 1, 1, 7, 25, 61, 841, 5251, 20497, 423865, 3780721, 20292031, 559501801, 6487717237, 44317795705, 1527439916731, 21798729916321, 180816606476401, 7478345832314977, 126737815733490295, 1236785588298582841, 59677199741873516461, 1171057417377450325801
Offset: 0

Author

Ilya Gutkovskiy, Nov 28 2019

Keywords

Crossrefs

Programs

  • Magma
    [n le 3 select 1 else 1 + 6*Binomial(n-1,3)*Self(n-3): n in [1..41]]; // G. C. Greubel, Dec 05 2021
    
  • Mathematica
    nmax = 22; CoefficientList[Series[Exp[x]/(1 - x^3), {x, 0, nmax}], x] Range[0, nmax]!
    Table[Sum[n!/(n - 3 k)!, {k, 0, Floor[n/3]}], {n, 0, 22}]
  • Sage
    [sum(factorial(3*k)*binomial(n, 3*k) for k in (0..n//3)) for n in (0..40)] # G. C. Greubel, Dec 05 2021

Formula

G.f.: Sum_{k>=0} (3*k)! * x^(3*k) / (1 - x)^(3*k + 1).
a(0) = a(1) = a(2) = 1; a(n) = n * (n - 1) * (n - 2) * a(n - 3) + 1.
a(n) = Sum_{k=0..floor(n/3)} n! / (n - 3*k)!.
a(n) ~ n! * (exp(1)/3 + 2*cos(sqrt(3)/2 - 2*Pi*n/3) / (3*exp(1/2))). - Vaclav Kotesovec, Apr 18 2020
a(n) = A158757(n, 2*n). - G. C. Greubel, Dec 05 2021

A330045 Expansion of e.g.f. exp(x) / (1 - x^4).

Original entry on oeis.org

1, 1, 1, 1, 25, 121, 361, 841, 42001, 365905, 1819441, 6660721, 498971881, 6278929801, 43710250585, 218205219961, 21795091762081, 358652470233121, 3210080802962401, 20298322381652065, 2534333270094778681, 51516840824285500441, 563561785768079119561
Offset: 0

Author

Ilya Gutkovskiy, Nov 28 2019

Keywords

Crossrefs

Outer diagonal of A158777.

Programs

  • Mathematica
    nmax = 22; CoefficientList[Series[Exp[x]/(1 - x^4), {x, 0, nmax}], x] Range[0, nmax]!
    Table[Sum[n!/(n - 4 k)!, {k, 0, Floor[n/4]}], {n, 0, 22}]

Formula

G.f.: Sum_{k>=0} (4*k)! * x^(4*k) / (1 - x)^(4*k + 1).
a(0) = a(1) = a(2) = a(3) = 1; a(n) = n*(n - 1)*(n - 2)*(n - 3)*a(n - 4) + 1.
a(n) = Sum_{k=0..floor(n/4)} n! / (n - 4*k)!.
a(n) ~ n! * (2*cos(Pi*n/2 - 1) + exp(1) + (-1)^n*exp(-1))/4. - Vaclav Kotesovec, Apr 18 2020

A009102 Expansion of e.g.f. cos(x)/(1+x).

Original entry on oeis.org

1, -1, 1, -3, 13, -65, 389, -2723, 21785, -196065, 1960649, -21567139, 258805669, -3364473697, 47102631757, -706539476355, 11304631621681, -192178737568577, 3459217276234385, -65725128248453315, 1314502564969066301
Offset: 0

Author

Keywords

Comments

The absolute value of a(n) equals the real part of the permanent of the n X n matrix with (1+i)'s along the main diagonal, and 1's everywhere else. - John M. Campbell, Jul 10 2011

Crossrefs

Cf. A009551, A000142, A000166, A000522, A000023, A053486, A010844 (incomplete Gamma function values at other points).

Programs

  • Magma
    m:=30; R:=PowerSeriesRing(Rationals(), m); b:=Coefficients(R!(Cos(x)/(1+x))); [Factorial(n-1)*b[n]: n in [1..m]]; // G. C. Greubel, Jul 26 2018
  • Maple
    G(x):=cos(x)/(1+x): f[0]:=G(x): for n from 1 to 20 do f[n]:=diff(f[n-1],x) od: x:=0: seq(f[n],n=0..20); # Zerinvary Lajos, Apr 03 2009
    g:= gfun:-rectoproc({a(0) = 1, a(1) = -1, a(2) = 1, a(n+3) = -(n+3)*a(n+2)-a(n+1)-(n+1)*a(n)},a(n),remember):
    seq(g(n),n=0..30); # Robert Israel, Oct 27 2015
  • Mathematica
    Table[SeriesCoefficient[Cos[x]/(1+x), {x, 0, n}] n!, {n, 0, 20}]
    Round@Table[(-1)^n Re[Gamma[n+1, I] E^I], {n, 0, 20}] (* Vladimir Reshetnikov, Oct 27 2015 *)
    With[{nn=20},CoefficientList[Series[Cos[x]/(1+x),{x,0,nn}],x] Range[0,nn]!] (* Harvey P. Dale, Feb 18 2024 *)
  • PARI
    x='x+O('x^30); Vec(serlaplace(cos(x)/(1+x))) \\ G. C. Greubel, Jul 26 2018
    

Formula

a(n) = (-1)^n*round(n!*cos(1)). - Vladeta Jovovic, Aug 11 2002
a(n) = (-1)^n * n! * Sum_{k=0..floor(n/2)} (-1)^k/(2k)!. Unsigned sequence satisfies e.g.f. cos(x)/(1-x). - Ralf Stephan, Apr 16 2004
E.g.f.: cos(x)/(1+x) = U(0)/(1-x^2) where U(k) = 1 - x/(1 - x/(x + (2*k+1)*(2*k+2)/U(k+1))) ; (continued fraction, 3-step). - Sergei N. Gladkovskii, Oct 17 2012
From Vladimir Reshetnikov, Oct 27 2015: (Start)
a(n) = Re((-i)^n*hypergeom([1,-n], [], i)).
a(n) = (-1)^n*(cos(1)*(n+2)!+cos(Pi*n/2)*hypergeom([1], [n/2+2,(n+3)/2], -1/4)+sin(Pi*n/2)*(n+2)*hypergeom([1], [n/2+1,(n+3)/2], -1/4))/(n^2+3*n+2).
a(n) = (-1)^n*Re(Gamma(n+1, i)*exp(i)) = (-1)^n*(Gamma(n+1, i)*exp(i)+Gamma(n+1, -i)*exp(-i))/2, where Gamma(a, x) is the upper incomplete Gamma function, i=sqrt(-1).
Gamma(n+1, i) = exp(-i)*((-1)^n*a(n) + A009551(n)*i).
a(0) = 1, a(1) = -1, a(2) = 1, a(n+3) = -(n+3)*a(n+2)-a(n+1)-(n+1)*a(n). (End)

Extensions

Extended with signs by Olivier Gérard, Mar 15 1997

A009551 Expansion of sin(x)/(1-x).

Original entry on oeis.org

0, 1, 2, 5, 20, 101, 606, 4241, 33928, 305353, 3053530, 33588829, 403065948, 5239857325, 73358002550, 1100370038249, 17605920611984, 299300650403729, 5387411707267122, 102360822438075317, 2047216448761506340
Offset: 0

Author

Keywords

Comments

a(n) equals the imaginary part of the permanent of the n X n matrix with (1+i)'s along the main diagonal, and 1's everywhere else. - John M. Campbell, Jul 10 2011

Crossrefs

Cf. A009102, A000142, A000166, A000522, A000023, A053486, A010844 (incomplete Gamma function values at other points).

Programs

  • Magma
    I:=[1,2,5]; [0] cat [n le 3 select I[n] else n*Self(n-1)-Self(n-2)+(n-2)*Self(n-3): n in [1..30]]; // G. C. Greubel, Jan 19 2018
  • Maple
    restart: G(x):=sin(x)/(1-x): f[0]:=G(x): for n from 1 to 21 do f[n]:=diff(f[n-1],x) od: x:=0: seq(f[n],n=0..20); # Zerinvary Lajos, Apr 03 2009
  • Mathematica
    Table[n!*SeriesCoefficient[Sin[x]/(1-x),{x,0,n}],{n,0,20}] (* corrected by Vaclav Kotesovec, Oct 07 2012 *)
    With[{nn=30},CoefficientList[Series[Sin[x]/(1-x),{x,0,nn}],x] Range[0,nn]!] (* Harvey P. Dale, Apr 17 2013 *)
    Round@Table[Im[Gamma[n+1, I] E^I], {n, 0, 20}] (* Vladimir Reshetnikov, Oct 27 2015 *)
  • PARI
    a(n) = round(n!*sin(1))
    

Formula

a(n) = round(n!*sin(1)), n>=1. - Vladeta Jovovic, Aug 11 2002
a(n) = n! * Sum_{k=0..floor(n/2)} (-1)^k/(2k-1)!, n>0. - Ralf Stephan, Apr 16 2004
a(n) = n*a(n-1) - a(n-2) +(n-2)*a(n-3). - Vaclav Kotesovec, Oct 07 2012
From Vladimir Reshetnikov, Oct 27 2015: (Start)
a(n) = Im(i^n*hypergeom([1,-n], [], i)).
a(n) = n!*sin(1)-cos(Pi*n/2)*hypergeom([1], [n/2+1,(n+3)/2], -1/4)/(n+1) + sin(Pi*n/2)*hypergeom([1], [n/2+2,(n+3)/2], -1/4)/(n^2+3*n+2).
a(n) = Im(Gamma(n+1, i)*exp(i)) = (Gamma(n+1, i)*exp(i)-Gamma(n+1, -i)*exp(-i))/(2*i), where Gamma(a, x) is the upper incomplete Gamma function, i=sqrt(-1).
Gamma(n+1, i) = exp(-i)*((-1)^n*A009102(n) + a(n)*i). (End)

Extensions

More terms from Benoit Cloitre, Aug 13 2002
Previous Showing 81-90 of 288 results. Next