|
Search: id:A056542
|
|
|
| A056542 |
|
a(n) = n*a(n-1) + 1, a(1) = 0. |
|
+0 12
|
|
| 0, 1, 4, 17, 86, 517, 3620, 28961, 260650, 2606501, 28671512, 344058145, 4472755886, 62618582405, 939278736076, 15028459777217, 255483816212690, 4598708691828421, 87375465144740000, 1747509302894800001
(list; graph; listen)
|
|
|
OFFSET
|
1,3
|
|
|
COMMENT
|
For n>=2 also operation count to create all permutations of n distinct elements using Algorithm L (lexicographic permutation generation) from Knuth's The Art of Computer Programming, Vol. 4, chapter 7.2.1.2. Sequence gives number of loop repetitions of the j search loop in step L2. - Hugo Pfoertner (hugo(AT)pfoertner.org), Feb 06 2003
This sequence shares divisibility properties with A000522; each of the primes in A072456 divide only a finite number of terms of this sequence. - T. D. Noe (noe(AT)sspectra.com), Jul 07 2005
|
|
REFERENCES
|
D. E. Knuth: The Art of Computer Programming, Volume 4, Combinatorial Algorithms, Volume 4A, Enumeration and Backtracking. Pre-fascicle 2B, A draft of section 7.2.1.2: Generating all permutations. Available online; see link.
Tom Meuller, Prime and Composite Terms in Sloane's Sequence A056542, Journal of Integer Sequences, Vol. 8 (2005), Article 05.3.3.
R. Sedgewick, Permutation generation methods, Computing Surveys, 9 (1977), 137-164.
|
|
LINKS
|
T. D. Noe, Table of n, a(n) for n=1..100
D. E. Knuth, TAOCP Vol. 4, Pre-fascicle 2b (generating all permutations).
Tom Muller, Prime and Composite Terms in Sloane's Sequence A056542, Journal of Integer Sequences, Vol. 8 (2005), Article 05.3.3. [Includes factorizations of a(1) through a(50)]
Hugo Pfoertner, FORTRAN implementation of Knuth's Algorithm L for lexicographic permutation generation.
Sam Wagstaff, Factorizations of a(51) through a(90)
|
|
FORMULA
|
a(n) = floor[(e-2)*n! ] = A002627(n)-n! = A000522(n)-2*n! = n!-A056543(n).
a:=n->sum((n-j)!*binomial(n,j),j=2..n). - Zerinvary Lajos (zerinvarylajos(AT)yahoo.com), Jul 31 2006
|
|
EXAMPLE
|
a(4)=4*a(3)+1=4*4+1=17
|
|
MAPLE
|
a:=n->sum((n-j)!*binomial(n, j), j=2..n): seq(a(n), n=1..20); - Zerinvary Lajos (zerinvarylajos(AT)yahoo.com), Jul 31 2006
a:=n->sum(n!/k!, k=2..n): seq(a(n), n=1..20); - Zerinvary Lajos (zerinvarylajos(AT)yahoo.com), Jun 17 2007
|
|
MATHEMATICA
|
tmp=0; Join[{tmp}, Table[tmp=n*tmp+1, {n, 2, 100}]] (T. D. Noe (noe(AT)sspectra.com), Jul 12 2005)
FoldList[ #1*#2 + 1 &, 0, Range[2, 21]] (from Robert G. Wilson v (rgwv(at)rgwv.com), Oct 11 2005)
|
|
CROSSREFS
|
Cf. A079751 (same recursion formula, but starting from a(3)=0), A038155, A038156, A080047, A080048, A080049.
Cf. A007808, A002627.
Sequence in context: A104979 A081052 A020074 this_sequence A110508 A114190 A135168
Adjacent sequences: A056539 A056540 A056541 this_sequence A056543 A056544 A056545
|
|
KEYWORD
|
easy,nonn
|
|
AUTHOR
|
Henry Bottomley (se16(AT)btinternet.com), Jun 20 2000
|
|
EXTENSIONS
|
More terms from James A. Sellers (sellersj(AT)math.psu.edu), Jul 04 2000
|
|
|
Search completed in 0.002 seconds
|