A219664 Repeating part of A220664: First differences of the numbers given as concatenation of permutations of (1,...,m) for sufficiently large m.
9, 81, 18, 81, 9, 702, 9, 171, 27, 72, 18, 693, 18, 72, 27, 171, 9, 702, 9, 81, 18, 81, 9, 5913, 9, 81, 18, 81, 9, 1602, 9, 261, 36, 63, 27, 594, 18, 162, 36, 162, 18, 603, 9, 171, 27, 72, 18, 5814, 9, 171, 27, 72, 18, 603, 9, 261, 36, 63, 27, 1584, 27, 63, 36
Offset: 1
Examples
The first four permutations of nine elements at A030299(A003422(9)..A003422(9)+3) (the terms A030299(46234..46237)) are: 123456789, 123456798, 123456879, 123456897. As 123456897-123456879 = 18, thus we have a(3) = 18. We could compute the same value from any smaller set of permutations of at least three elements, for example, from the five element permutations used in A107346. In that case, the permutations A030299(A003422(5)..A003422(5)+3) (the terms A030299(34..37)) are: 12345, 12354, 12435, 12453, ... and we get the same result, a(3) = 12453-12435 = 18.
Links
- A. Karttunen, Table of n, a(n) for n = 1..5039
Programs
-
PARI
A219664(n)=for(k=2,n+1, k!>n || next; k=vecsort( vector( (#k=vector(k,j,10^j)~\10)!,i,numtoperm(#k,i)*k )); return(k[n+1]-k[n])) \\ (It is of course more efficient to calculate a whole vector of the first k!-1 terms. Also, for n>9!, this might yield incorrect terms.) - M. F. Hasler, Jan 12 2013
-
Scheme
(define (A219664 n) (A220664 (A220655 n)))
Comments