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.

A056158 Equivalent of the Kurepa hypothesis for left factorial.

Original entry on oeis.org

-4, -2, -4, 2, -20, 86, -532, 3706, -29668, 266990, -2669924, 29369138, -352429684, 4581585862, -64142202100, 962133031466, -15394128503492, 261700184559326, -4710603322067908, 89501463119290210, -1790029262385804244
Offset: 3

Views

Author

Aleksandar Petojevic, Jul 31 2000

Keywords

Comments

For a prime p > 2 we have !p == -a(p) mod p, where the left factorial !n = Sum_{k=0..n-1} k! (A003422).

Programs

  • Magma
    [n eq 3 select -4 else -(n-3)*Self(n-3)-2*(n-1): n in [3..30]]; // Vincenzo Librandi, Feb 22 2016
    
  • Mathematica
    a[3] = -4; a[n_]:= -(n-3)*a[n-1] - 2*(n-1); Array[a, 30, 3] (* James Spahlinger, Feb 20 2016 *)
    Drop[CoefficientList[Series[2*x^2*(Exp[1/x -1]*ExpIntegralEi[(x-1)/x] + x/(x-1)), {x,0,15}, Assumptions -> x > 0], x],3] (* G. C. Greubel, Mar 29 2019 *)
  • PARI
    m=30; v=concat([-4], vector(m-1)); for(n=2, m, v[n]=-(n-1)*v[n-1] -2*(n+1)); v \\ G. C. Greubel, Mar 29 2019
    
  • Sage
    @CachedFunction
    def Self(n):
       if n == 3 : return -4
       return -(n-3)*Self(n-1) - 2*(n-1)
    [Self(n) for n in (3..30)] # G. C. Greubel, Mar 29 2019

Formula

a(3) = -4, a(n) = -(n-3)*a(n-1) - 2*(n-1).
a(n) = 2*(-1)^(n-1)*(n-3)!*Sum_{k=0..n-3} frac((k+2)*(-1)^(k+1))*k!.
Conjecture: a(n) + (n-5)*a(n-1) + (-2*n+9)*a(n-2) + (n-5)*a(n-3) = 0. - R. J. Mathar, Jan 31 2014
a(n) ~ (-1)^n * 2 * exp(-1) * (n-3)!. - Vaclav Kotesovec, Jan 05 2019
G.f.: 2*x^2*(exp(-1+1/x) * Exponential-Integral((x-1)/x) + x/(x-1)). - G. C. Greubel, Mar 29 2019

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Oct 03 2000