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.

A135996 Difference between 2^n and the largest factorial <= 2^n.

Original entry on oeis.org

0, 0, 2, 2, 10, 8, 40, 8, 136, 392, 304, 1328, 3376, 3152, 11344, 27728, 25216, 90752, 221824, 161408, 685696, 1734272, 565504, 4759808, 13148416, 29925632, 27192064, 94300928, 228518656, 57869312, 594740224, 1668482048, 3815965696, 2362913792
Offset: 0

Views

Author

Ctibor O. Zizka, Mar 03 2008, Mar 16 2008

Keywords

Examples

			a(6) = 2^6 - 4! = 40
a(7) = 2^7 - 5! = 8
a(8) = 2^8 - 5! = 136
		

Crossrefs

Cf. A000142.

Programs

  • Maple
    A048764 := proc(n) local a; for a from 1 do if a! > n then RETURN((a-1)!); fi ; od: end: A135996 := proc(n) 2^n-A048764(2^n) ; end: seq(A135996(n),n=0..60) ; # R. J. Mathar, Mar 16 2008
  • Mathematica
    d2n[n_]:=Module[{n2=2^n,fcts=Reverse[Range[100]!]},n2-Select[fcts,#<= n2&,1]]; Flatten[Array[d2n,40,0]] (* Harvey P. Dale, Aug 22 2012 *)

Formula

a(n) = 2^n - A048764(2^n). - R. J. Mathar, Mar 16 2008

Extensions

More terms from R. J. Mathar, Mar 16 2008