A217626 First differences of A215940, or first differences of permutations of (0,1,2,...,m-1) reading them as decimal numbers, divided by 9 (with 10>=m, and m! > n).
1, 9, 2, 9, 1, 78, 1, 19, 3, 8, 2, 77, 2, 8, 3, 19, 1, 78, 1, 9, 2, 9, 1, 657, 1, 9, 2, 9, 1, 178, 1, 29, 4, 7, 3, 66, 2, 18, 4, 18, 2, 67, 1, 19, 3, 8, 2, 646, 1, 19, 3, 8, 2, 67, 1, 29, 4, 7, 3, 176, 3, 7, 4, 29, 1, 67, 2, 8, 3, 19, 1, 646, 2, 8, 3, 19, 1
Offset: 1
Examples
a(1)= A215940(2) - A215940(1) = 1 - 0 = 1. a(2)= A215940(3) - A215940(2) = 10-01 = 9. a(3)= A215940(4) - A215940(3) = 12-10 = 2. a(4)= A215940(5) - A215940(4) = 21-12 = 9. a(5)= A215940(6) - A215940(5) = 22-21 = 1. From _R. J. Cano_, May 09 2017: (Start) On the central terms for subsequences consisting of the first y!-1 terms with even y: Let us pick y=4; The first y!-1=23 terms are: (1,9,2,9,1,78,1,19,3,8,2,77,2,8,3,19,1,78,1,9,2,9,1) the central term there is a(12)=77. If we look into A237265, the 4th matrix defining it contains as its (4/2+1)th or third row, the permutation 3124 which in lexicographic order is preceded by 2431, therefore by subtracting and dividing by 9 we obtain: (3124-2431)/9 = 693/9 = (2013-1320)/9 = 77 = a(12). (End)
Links
- A. Karttunen, Table of n, a(n) for n = 1..40319
- R. J. Cano, Compressed file: a(n) for n = 1..3628799, the first 10!-1 terms of this sequence.
- R. J. Cano, Additional information about this sequence.
- R. J. Cano, Template for a base-independent sequencer in C.
Crossrefs
Programs
-
C
// See LINKS.
-
Maple
A217626:=n->A215940(n+1)-A215940(n);
-
Mathematica
maxm = 5; Table[dd = FromDigits /@ Permutations[Range[m]]; (Drop[dd, If[m == 1, 0, (m - 1)!]] - First[dd])/9, {m, 1, maxm}] // Flatten // Differences (* Jean-François Alcover, Apr 25 2013 *)
-
PARI
first_terms(n)={n=max(3,n);my(m:small=n!);my(a:vec=vector(m-1),i:small=0,x:vec=numtoperm(n,0),y:vec,z:vec,u:small,B:small=11);m\=2;m--;while(i++<=m,u=!(i%6);y=numtoperm(n,i);z=(y-x)[1..n-1];if(u,z=vector(#z,j,vecsum(z[1..j])));a[i]=fromdigits(z,B-u);a[#a-i+1]=a[i];x=y;);z=(numtoperm(n,m+1)-y)[1..n-1];a[m+1]=fromdigits(vector(#z,j,vecsum(z[1..j])),B--);return(a)} \\ Computes the first either 5 or n!-1 terms. - R. J. Cano, May 28 2017
-
Scheme
(define (A217626 n) (/ (A219664 n) 9)) ;; - Antti Karttunen, Dec 18 2012
Formula
a(n) = A219664(n)/9, for n=1..362879. - Antti Karttunen, Dec 18 2012
a(n) = A209280(n)/9, for n < 9!. - M. F. Hasler, Jan 12 2013
Extensions
Definition simplified by M. F. Hasler, Jan 12 2013
Comments