Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A034968
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A034968 Minimal number of factorials which add to n. +0
6
0, 1, 1, 2, 2, 3, 1, 2, 2, 3, 3, 4, 2, 3, 3, 4, 4, 5, 3, 4, 4, 5, 5, 6, 1, 2, 2, 3, 3, 4, 2, 3, 3, 4, 4, 5, 3, 4, 4, 5, 5, 6, 4, 5, 5, 6, 6, 7, 2, 3, 3, 4, 4, 5, 3, 4, 4, 5, 5, 6, 4, 5, 5, 6, 6, 7, 5, 6, 6, 7, 7, 8, 3, 4, 4, 5, 5, 6, 4, 5, 5, 6, 6, 7, 5, 6, 6, 7, 7, 8, 6, 7, 7, 8, 8, 9, 4, 5, 5, 6, 6, 7, 5, 6, 6, 7 (list; graph; listen)
OFFSET

0,4

COMMENT

Equivalently, sum of digits when n is written in factorial base (A007623).

Also minimum number of adjacent transpositions needed to produce each permutation in the list A055089 (or number of swappings needed to bubble sort each such permutation).

FORMULA

a(n)=n-sum(i>=2, (i-1)*floor(n/i!)) - Benoit Cloitre (benoit7848c(AT)orange.fr), Aug 26 2003

G.f. 1/(1-x)*Sum_{k>0}(Sum_{i=1}^k i*x^(i*k!))/(Sum_{i=0}^k x^(i*k!)) [From Franklin T. Adams-Watters (FrankTAW(AT)Netscape.net), May 13 2009]

EXAMPLE

a(205=1!*1+3!*2+4!*3+5!*1)=1+2+3+1=6.

MAPLE

[seq(convert(fac_base(j), `+`), j=0..119)]; # fac_base and PermRevLexUnrank given in A055089. Perm2InversionVector in A064039

Or alternatively: [seq(convert(Perm2InversionVector(PermRevLexUnrank(j)), `+`), j=0..119)];

PROGRAM

(PARI) a(n)=local(k, r); k=2; r=0; while(n>0, r+=n%k; n\=k; k++); r [From Franklin T. Adams-Watters (FrankTAW(AT)Netscape.net), May 13 2009]

CROSSREFS

Partial sums of first n! terms: A001809. See A055091 for the minimum number of any transpositions. A034968[A056019[n]] = A034968[n] for all n.

Sequence in context: A097028 A092331 A089293 this_sequence A054707 A166269 A055460

Adjacent sequences: A034965 A034966 A034967 this_sequence A034969 A034970 A034971

KEYWORD

nonn

AUTHOR

Erich Friedman (erich.friedman(AT)stetson.edu)

EXTENSIONS

Additional comments from Antti Karttunen, Aug 23, 2001.

page 1

Search completed in 0.002 seconds

Lookup | Welcome | Find friends | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
More pages | Superseeker | Maintained by N. J. A. Sloane (njas@research.att.com)

Last modified November 27 22:38 EST 2009. Contains 167602 sequences.


AT&T Labs Research