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

A014288 a(n) = floor(Sum_{k=0..n} k!/2), or floor( A003422(n+1)/2 ).

Original entry on oeis.org

0, 1, 2, 5, 17, 77, 437, 2957, 23117, 204557, 2018957, 21977357, 261478157, 3374988557, 46964134157, 700801318157, 11162196262157, 189005910310157, 3390192763174157, 64212742967590157, 1280663747055910157, 26826134832910630157, 588826498721714470157
Offset: 0

Views

Author

Keywords

Comments

The first term a(0) would be a fraction if the floor( ... ) function were omitted; for n >= 2, all terms from A003422 are even. - M. F. Hasler, Dec 16 2007

Crossrefs

Programs

  • Magma
    [Floor((&+[Factorial(j): j in [0..n]])/2): n in [0..30]]; // G. C. Greubel, Sep 05 2022
    
  • Maple
    a:= proc(n) a(n):= `if`(n<3, n, (n+1)*a(n-1)-n*a(n-2)) end:
    seq(a(n), n=0..25);  # Alois P. Heinz, Feb 01 2013
  • Mathematica
    f[x_] := {Floor[1 + (n - x[[2]])*x[[1]]], x[[2]] + 1};
    a[0] = 0; a[n_] := Nest[f, {1, 0}, n][[1]]/2 (* Joseph E. Cooper III (easonrevant(AT)gmail.com), Aug 19 2008 *) (* updated by Jean-François Alcover, Jun 01 2015 *)
    a[n_]:=-(1/2) Subfactorial[-1]-1/2(-1)^n Gamma[2+n] Subfactorial[-2-n]; Table[a[n] //FullSimplify,{n,0,25}] (* Gerry Martens, May 29 2015 *)
  • PARI
    A014288(n)=sum(k=0,n,k!)>>1 \\ M. F. Hasler, Dec 16 2007
    
  • Python
    from math import factorial
    def A014288(n): return sum(factorial(k) for k in range(n+1))>>1 # Chai Wah Wu, Nov 01 2023
  • SageMath
    [sum(factorial(j) for j in (0..n))//2 for n in (0..30)] # G. C. Greubel, Sep 05 2022
    

Formula

a(0)=0, a(1)=1, a(2)=2, a(n) = (n+1)*a(n-1) - n*a(n-2). - Benoit Cloitre, Sep 07 2002
a(0) = 0, a(n) = (1/2)*floor(1 + 1*floor(1 + 2*floor(1 + ... + (n-1)*floor(1+n*floor(1))). - Joseph E. Cooper III (easonrevant(AT)gmail.com), Aug 19 2008
G.f.: G(0)/(1-x)/2 -1/2, where G(k)= 1 + (2*k + 1)*x/( 1 - 2*x*(k+1)/(2*x*(k+1) + 1/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, May 24 2013
G.f.: A(x) = (Sum_{n>=0} x^n*n!)/(2-2*x) - 1/2 = G(0)/(4*(1-x)) - 1/2, where G(k) = 1 + 1/(1 - x/(x + 1/(k+1)/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, Jun 02 2013
a(n) ~ n!/2. - Vaclav Kotesovec, Aug 10 2013
E.g.f.: -1/2 + (exp(x)/2)*Sum_{k>=0} (k! - k*Gamma(k,x)). - Robert Israel, Jun 01 2015
a(n) = ((n+1)!*ExpIntegral(n+2,-1)+Ei(1)+Pi*i)/(2*e). - Ammar Khatab, Aug 14 2020

Extensions

Edited by M. F. Hasler, Dec 16 2007

A025016 Final digits of !n = Sum_{i=0..n} i! (A003422) for very large n, read from right.

Original entry on oeis.org

4, 1, 3, 0, 4, 9, 0, 2, 4, 0, 2, 9, 8, 2, 5, 6, 3, 3, 2, 4, 4, 6, 5, 5, 2, 5, 0, 9, 3, 0, 5, 0, 1, 3, 9, 5, 3, 2, 3, 4, 0, 8, 4, 9, 9, 7, 0, 1, 1, 2, 6, 8, 3, 7, 4, 8, 6, 8, 7, 4, 9, 7, 4, 7, 4, 2, 2, 9, 0, 0, 4, 3, 3, 0, 5, 6, 5, 8, 6, 5, 0, 0, 2, 6, 6, 5, 1, 5, 9, 7, 8, 8, 1, 6, 2, 0, 2, 8, 1, 2, 1, 3, 7, 6, 1, 1, 5, 8
Offset: 0

Views

Author

Keywords

Comments

Reversed digits of 10-adic sum of all factorials.
More generally, the 10-adic sum: B(n) = Sum_{k>=0} k^n*k! is given by: B(n) = A014182(n)*B(0) + A014619(n) for n>=0, where B(0) is the 10-adic sum of factorials (this constant). - Paul D. Hanna, Aug 12 2006

Examples

			!20 = 256132749111820314, !30 = 16158688114800553828940314 ... .
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{x, f=1}, While[Mod[f!, 10^(n+1)]>0, f += 1]; x = Sum[ Mod[k!, 10^(n+1)], {k, 0, f}]; Quotient[10*Mod[x, 10^(n+1)], 10^(n+1)]]; Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Nov 18 2015, after Paul D. Hanna *)
  • PARI
    {a(n)=local(x,f=1);while(f!%10^(n+1)>0,f+=1); x=sum(k=0,f,k!%10^(n+1));(10*(x%10^(n+1)))\10^(n+1)} \\ Paul D. Hanna, Aug 12 2006

A101752 Table (read by rows) giving the coefficients of sum formulas of n-th Left factorials (A003422).

Original entry on oeis.org

1, 0, 1, 5, -16, 8, 69, -767, 1314, 117, 1774, -30405, 78914, 69024
Offset: 1

Views

Author

André F. Labossière, Dec 17 2004

Keywords

Comments

The k-th row (k>=1) contains T(i,k) for i=1 to k+1, where k=[2*n+1+(-1)^(n-1)]/4 and T(i,k) satisfies !n = Sum_{i=1..k+1} T(i,k) * n^(k-i+1) / k!.

Examples

			!7 = 874; substituting n=7 in the formula of the k-th row we obtain k=4 and the coefficients T(i,4) will be the following: 117,1774,-30405,78914,69024, => !7 = [ 117*7^4 +1774*7^3 -30405*7^2 +78914*7 +69024 ]/4! = 874.
		

Crossrefs

Cf. A094216.

A102411 Even triangle !n. This table read by rows gives the coefficients of sum formulas of n-th Left factorials (A003422). The k-th row (6>=k>=1) contains T(i,k) for i=1 to k+2, where k=[2*n+1+(-1)^(n-1)]/4 and T(i,k) satisfies !n = Sum_{i=1..k+2} T(i,k) * n^(i-1) / (2*k-2)!.

Original entry on oeis.org

0, 1, 0, -16, 5, 1, 0, 5256, -3068, 276, 32, 0, 2070720, 2367420, -912150, 53220, 3510, 0, -36031524480, 15327895296, -40587120, -387492840, 21414120, 758184, 840, -212459319878400, -75473246681280, 38182549456800, -2562251680800, -195611371200, 13639812480, 285616800, 453600
Offset: 1

Views

Author

André F. Labossière, Jan 07 2005

Keywords

Comments

The sum of signed coefficients for each k-th row is divisible by (2*k-2)!. Moreover, another variant (but an incomplete one, and sorted differently) of the above sequence is presented in A101752.

Examples

			Triangle starts:
0, 1, 0;
-16, 5, 1, 0;
5256, -3068, 276, 32, 0;
2070720, 2367420, -912150, 53220, 3510, 0;
-36031524480, 15327895296, -40587120, -387492840, 21414120, 758184, 840;
...
!11=4037914; substituting n=11 in the formula of the k-th row we obtain k=6 and the coefficients T(i,6) are those needed for computing !11.
=> !11 = [ -212459319878400 -75473246681280*11 +38182549456800*11^2 -2562251680800*11^3 -195611371200*11^4 +13639812480*11^5 +285616800*11^6 +453600*11^7 ]/10! = 4037914.
		

Crossrefs

A102412 Odd triangle !n. This table read by rows gives the coefficients of sum formulas of n-th Left factorials (A003422). The k-th row (6>=k>=1) contains T(i,k) for i=1 to k+1, where k=[2*n+3+(-1)^n]/4 and T(i,k) satisfies !n = Sum_{i=1..k+1} T(i,k) * n^(i-1) / (2*k-2)!.

Original entry on oeis.org

0, 1, -4, 4, 0, 96, -396, 108, 0, 1012320, -192900, -64890, 11460, 90, -2038014720, 1977810240, -304486560, -12131280, 2792160, 21840, -33190735737600, 4445760574080, 2334485260800, -394554283200, 2330344800, 1198048320, 8215200
Offset: 1

Views

Author

André F. Labossière, Jan 07 2005

Keywords

Comments

Incidentally, the sum of signed coefficients for each k-th row is divisible by (2*k-2)!.

Examples

			Triangle starts:
0, 1;
-4, 4, 0;
96, -396, 108, 0;
1012320, -192900, -64890, 11460, 90;
-2038014720, 1977810240, -304486560, -12131280, 2792160, 21840;
...
!11=4037914; substituting n=11 in the formula of the k-th row we obtain k=6 and the coefficients T(i,6) are those needed for computing !11.
=> !11 = [ -33190735737600 +4445760574080*11 +2334485260800*11^2 -394554283200*11^3 +2330344800*11^4 +1198048320*11^5 +8215200*11^6 ]/10! = 4037914.
		

Crossrefs

A275608 Numbers that divide no nonzero terms of A003422.

Original entry on oeis.org

3, 6, 8, 9, 12, 13, 15, 16, 18, 20, 21, 24, 25, 26, 27, 28, 29, 30, 32, 33, 35, 36, 39, 40, 42, 43, 44, 45, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 63, 64, 65, 66, 67, 68, 69, 70, 72, 75, 76, 78, 79, 80, 81, 83, 84, 85, 86, 87, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100
Offset: 1

Views

Author

Robert Israel, Nov 14 2016

Keywords

Comments

Numbers k such that A013584(k) = 0.
If k is in the sequence, then so is every multiple of k.

Examples

			3 is in the sequence because A003422(1)=1 and A003422(2)=2 are not divisible by 3, and A003422(k) == 1 (mod 3) for k >= 3.
4 is not in the sequence because A003422(3) = 4 is divisible by 4.
		

Crossrefs

Complement of A049045.

Programs

  • Maple
    filter:= proc(n) local t,r,m;
      r:= 1; t:= 1;
      for m from 1 do
        r:= r*m mod n;
        if r = 0 then return true fi;
        t:= t + r mod n;
        if t = 0 then return false fi;
      od;
    end proc:
    select(filter, [$2..100]);
  • Mathematica
    okQ[n_] := Module[{t, r, m}, r = 1; t = 1; For[m = 1, True, m++, r = Mod[r*m, n]; If[r == 0, Return[True]]; t = Mod[t + r, n]; If[t == 0, Return[False]]]];
    Select[Range[2, 100], okQ] (* Jean-François Alcover, Apr 12 2019, after Robert Israel *)

A049041 Least k > 0 such that A049042(n) | A003422(k-1).

Original entry on oeis.org

2, 4, 6, 6, 5, 7, 7, 12, 22, 16, 55, 54, 42, 24, 25, 86, 97, 133, 64, 94, 72, 58, 49, 69, 19, 78, 14, 208, 167, 138, 80, 59, 63, 142, 41, 110, 22, 286, 39, 84, 215, 80, 14, 305, 188, 151, 53, 187, 180, 44, 32, 83, 92, 300, 16, 421, 146, 507, 28, 243, 119, 429, 239, 415
Offset: 1

Views

Author

Keywords

References

  • F. Smarandache, Definitions solved and unsolved problems, conjectures and theorems in number theory and geometry, edited by M. Perez, Xiquan Publishing House, 2000.

Crossrefs

A049044 Least k > 0 such that A049045(n) | A003422(k-1).

Original entry on oeis.org

1, 2, 3, 4, 6, 4, 6, 6, 5, 7, 6, 7, 12, 5, 22, 7, 16, 7, 55, 12, 54, 42, 22, 6, 16, 24, 25, 86, 55, 97, 133, 54, 42, 6, 64, 94, 72, 58, 24, 49, 69, 19, 25, 78, 86, 14, 208, 167, 138, 80, 97, 59, 133, 63, 142, 41, 110, 64, 22, 94, 286, 72, 39, 58, 84, 215, 80, 14, 49, 305, 69
Offset: 1

Views

Author

Keywords

Crossrefs

A102639 Combinatorial triangle !n. This table read by rows gives the coefficients of general sum formulas of n-th left factorials (A003422). The k-th row (k>=1) contains T(i,k) for i=1 to 2*k and k=1 to n-2, where T(i,k) satisfies !n = n + Sum_{k=1..n-2} Sum_{i=1..2*k} T(i,k) * C(n-k-1,i).

Original entry on oeis.org

1, 1, 3, 8, 8, 3, 9, 46, 101, 114, 65, 15, 33, 272, 975, 1935, 2289, 1615, 630, 105, 153, 1796, 9175, 26795, 49474, 60080, 48104, 24535, 7245, 945, 873, 13424, 90255, 353507, 902164, 1582455, 1953272, 1700860, 1025927, 408870, 97020, 10395, 5913
Offset: 1

Views

Author

André F. Labossière, Feb 01 2005

Keywords

Comments

The coefficients T(i,k) along the i-th columns of the triangle are the consecutive partial sums of those found in table A094216.

Examples

			!7 = 7 + 1*C(7-2,1) + 1*C(7-2,2) + 3*C(7-3,1) + ... + 33*C(7-5,1) + 272*C(7-5,2) + 153*C(7-6,1) = 7 + 5 + 10 + 12 + 8*C(4,2) + 8*C(4,3) + 3*C(4,4) + 9*C(3,1) + 46*C(3,2) + 101*C(3,3) + 66 + 272 + 153 = 7 + 5 + 10 + 12 + 48 + 32 + 3 + 27 + 138 + 101 + 66 + 272 + 153 = 874.
		

Crossrefs

A124375 Numbers k such that A003422(k+1)/2 is prime.

Original entry on oeis.org

2, 3, 4, 7, 8, 9, 10, 29, 75, 162, 270, 272, 353, 720, 1795, 3732, 4768, 9315, 12220, 41531
Offset: 1

Views

Author

Alexander Adamchuk, Oct 28 2006

Keywords

Comments

Sum_{i=0..k} i! = k! + !k = A003422(k+1), where !k is left factorial !k = Sum_{i=0..k-1} i! = A003422(k). Left factorials are even for k > 1. Corresponding primes of the form (k! + !k)/2 = (a(n)! + !a(n))/2 are listed in A124374(n) = {2, 5, 17, 2957, 23117, 204557, 2018957, 4578979328975537786697650470157, ...}.
A near-duplicate of A100614: a(n) = A100614(n) - 1. - Ryan Propper, Feb 07 2008

Crossrefs

Programs

  • Mathematica
    f=0;Do[f=f+n!;If[PrimeQ[f/2],Print[{n,f/2}]],{n,0,353}]
    Flatten[Position[Accumulate[(Range[0,12220]!)]/2,?PrimeQ]]-1 (* _Harvey P. Dale, Jul 02 2019 *)

Extensions

More terms from Ryan Propper, Feb 07 2008
a(20) from Jinyuan Wang, Mar 20 2021
Showing 1-10 of 121 results. Next