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.

Showing 1-6 of 6 results.

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).

Original entry on oeis.org

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

Views

Author

R. J. Cano, Oct 04 2012

Keywords

Comments

Terms do not depend on the choice of m, provided that m!>n (the index of the considered term), and the numbers associated to a permutation s of {0,...,m-1} are N(s) = Sum_{i=1..m} s(i)*10^(m-i). This defines the present sequence for any arbitrarily large index, not limited to n <= 10!, for example.
Similar sequences might be built in another base b, they would always start (1, b-1, 2, b-1, 1, ...). The partial sums of this kind of sequence would yield the analog of A215940 in the corresponding base.
There are at least two palindromic patterns which are repeated throughout this sequence: one of them is "1,b-1,2,b-1,1" (It is optional here whether or not to include the 1's), another is built from the first 4!-1 terms (See the corresponding link for details).
Also, for 1<=n<=(9!)-1: The repeating parts in the first differences of A030299 divided by nine, i.e. a(n) = A219664(n)/9. - Antti Karttunen, Dec 18 2012. Edited by: R. J. Cano, May 09 2017
There are more palindromic patterns than those mentioned above: Similar to the first 3!-1 and the first 4!-1 terms, the first k!-1 terms are repeated for all other k>4. Frequent are also multiples of these, e.g., k*[1,9,2,9,1] = [2,18,4,18,2], [3,27,6,27,3], ...), [1, 19, 3, 8, 2, 67, 1, 29, 4, 7, 3, 176, 3, 7, 4, 29, 1, 67, 2, 8, 3, 19, 1], and others. The "middle part" of roughly half the length (e.g., [9,2,9] or [67,...,67] in the last example), is repeated even more frequently. - M. F. Hasler, Jan 14 2013
From R. J. Cano, Apr 04 2016: (Start)
Conjecture 1: Given 1A217626 and so on).
Lemma: Let P be an arbitrary set consisting of m integers; let x[i] be an element in P (with 1<=i<=m); let y[j] = x[j+1] - x[j] (with 1 <= j <= m-1) be the 1st differences of P. These differences are symmetric if y[j]=y[m-j] which for P implies the condition x[j]+x[m-j+1]=x[j+1]+x[m-j];
Consequence: When m=n! and P is a set with all the permutations for the letters 0..n-1, the preceding lemma implies P has associated at least a set Q such that 1st differences in Q are symmetric.
Generating algorithm: Such Q can be built based upon P and the condition given by the preceding lemma if it is removed from P (until P becomes empty) its 1st element tau, inserting them both in Q tau and its arithmetic complement to repdigit (n-1)*111...1 (n times 1) removing the mentioned complement from P.
Conjecture 2: The autosimilarity shown by a(n) is a consequence of the fact that the corresponding P is the set of the n! permutations in increasing sequence for the letters 0..n-1, and Q=P (it holds if they are replaced "a(n)" and "increasing" respectively with "-1*a(n)" and "decreasing").
Note: "Q=P" is a necessary but not sufficient condition for observing the autosimilarity in a(n).
Application: The "generating algorithm" described previously might be potentially useful for parallel computing. In combination with the partition scheme proposed at links in A237265, and multiple indirection. For example notice that in such sense an algorithm for generating k! permutations with an increasing sequence would require only k!/2 iterations because the other half would be already determined by symmetry.
Conjecture 3: For n>2, given P the set of permutations in increasing sequence for the letters 0..n-1, there are distributed with a symmetric pattern among its (n!)! permutations all those A000165(n!\2) of them such that their 1st differences are symmetric. Moreover by setting to zero the other elements whose 1st differences are not symmetric, we obtain an antisymmetric sequence.
(End)
Conjecture 4: If 2<=mR. J. Cano, Apr 19 2017
Consider the first y!-1 terms for even y; The central term a(y!/2) is determined by the difference between the (y/2+1)th row from the y-th matrix defining the irregular table in A237265 and the consecutive permutation preceding it in lexicographic order (See EXAMPLE). - R. J. Cano, May 09 2017

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)
		

Crossrefs

Cf. A219995 [ On the summation of 1/a(n) ].

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) = A215940(n+1) - A215940(n).
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

A237451 Zero-based column index to irregular tables organized as successively larger square matrices.

Original entry on oeis.org

0, 0, 1, 0, 1, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5
Offset: 1

Views

Author

Antti Karttunen, Feb 08 2014

Keywords

Comments

With sequences constructed of successively larger square matrices (cf. A074279), a(n) will return the distance of n from the left edge of the matrix that n is located in, with 0 standing for the leftmost column (please see the Example section).
A237452 gives the corresponding row index.
A238013 and A121997 give these same row and column indices, starting the numbering with index 1. - M. F. Hasler, Feb 17 2014

Examples

			This irregular table begins as:
0;
0,1;
0,1;
0,1,2;
0,1,2;
0,1,2;
0,1,2,3;
0,1,2,3;
0,1,2,3;
0,1,2,3;
0,1,2,3,4;
0,1,2,3,4;
0,1,2,3,4;
0,1,2,3,4;
0,1,2,3,4;...
		

Crossrefs

Programs

  • Python
    from sympy import integer_nthroot
    def A237451(n): return (n-(k:=(m:=integer_nthroot(3*n,3)[0])+(6*n>m*(m+1)*((m<<1)+1)))*(k-1)*((k<<1)-1)//6-1)%k # Chai Wah Wu, Nov 04 2024
  • Scheme
    (define (A237451 n) (modulo (-1+ (A064866 n)) (A074279 n)))
    

Formula

a(n) = (A064866(n)-1) modulo A074279(n).
a(n) = A121997(n)-1. - M. F. Hasler, Feb 16 2014

A237452 Zero-based row index to irregular tables organized as successively larger square matrices.

Original entry on oeis.org

0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 2, 2, 2, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5
Offset: 1

Views

Author

Antti Karttunen, Feb 08 2014

Keywords

Comments

With sequences constructed of successively larger kxk square matrices (cf. A074279), a(n) will return the distance of n from the top edge of the matrix that n is located in, with 0 standing for the topmost row in that matrix (please see the Example section).
A237451 gives the corresponding column index.
A238013 and A121997 give these same row and column indices, but starting the numbering with index 1. - M. F. Hasler, Feb 17 2014

Examples

			This irregular table begins as:
0;
0,0;
1,1;
0,0,0;
1,1,1;
2,2,2;
0,0,0,0;
1,1,1,1;
2,2,2,2;
3,3,3,3;
0,0,0,0,0;
1,1,1,1,1;
2,2,2,2,2;
3,3,3,3,3;
4,4,4,4,4;
...
		

Crossrefs

Programs

  • Python
    from sympy import integer_nthroot
    def A237452(n): return (n-1-(k:=(m:=integer_nthroot(3*n,3)[0])+(6*n>m*(m+1)*((m<<1)+1)))*(k-1)*((k<<1)-1)//6)//k # Chai Wah Wu, Nov 04 2024
  • Scheme
    (define (A237452 n) (floor->exact (/ (-1+ (A064866 n)) (A074279 n))))
    

Formula

a(n) = floor((A064866(n)-1)/A074279(n)).
a(n) = A238013(n)-1. - M. F. Hasler, Feb 16 2014

A237447 Infinite square array: row 1 is the positive integers 1, 2, 3, ..., and on any subsequent row n, n is moved to the front: n, 1, ..., n-1, n+1, n+2, ...

Original entry on oeis.org

1, 2, 2, 3, 1, 3, 4, 3, 1, 4, 5, 4, 2, 1, 5, 6, 5, 4, 2, 1, 6, 7, 6, 5, 3, 2, 1, 7, 8, 7, 6, 5, 3, 2, 1, 8, 9, 8, 7, 6, 4, 3, 2, 1, 9, 10, 9, 8, 7, 6, 4, 3, 2, 1, 10, 11, 10, 9, 8, 7, 5, 4, 3, 2, 1, 11, 12, 11, 10, 9, 8, 7, 5, 4, 3, 2, 1, 12, 13, 12, 11, 10, 9, 8, 6, 5, 4, 3, 2, 1, 13, 14, 13, 12, 11, 10, 9, 8, 6, 5, 4, 3, 2, 1, 14, 15, 14, 13, 12, 11, 10, 9, 7, 6, 5, 4, 3, 2, 1, 15
Offset: 1

Views

Author

Antti Karttunen, Feb 10 2014

Keywords

Comments

Row n is the lexicographically earliest permutation of positive integers beginning with n. This also holds for the reverse colexicographic order, thus A007489(n-1) gives the position of n-th row of this array (which is one-based) in zero-based arrays A195663 & A055089.
The finite n X n square matrices in sequence A237265 converge towards this infinite square array.
Rows can be constructed also simply as follows: The first row is A000027 (natural numbers, also known as positive integers). For the n-th row, n=2, ..., pick n out from the terms of A000027 and move it to the front. This will create a permutation with one cycle of length n, in cycle notation: (1 n n-1 n-2 ... 3 2), which is the inverse of (1 2 ... n-1 n).
There are A000110(n) ways to choose n permutations from the n first rows of this table so that their composition is identity (counting all the different composition orders). This comment is essentially the same as my May 01 2006 comment on A000110, please see there for more information. - Antti Karttunen, Feb 10 2014
Also, for n > 1, the whole symmetric group S_n can be generated with just two rows, row 2, which is transposition (1 2), and row n, which is the inverse of cycle (1 ... n). See Rotman, p. 24, Exercise 2.9 (iii).

Examples

			The top left 9 X 9 corner of this infinite square array:
  1 2 3 4 5 6 7 8 9
  2 1 3 4 5 6 7 8 9
  3 1 2 4 5 6 7 8 9
  4 1 2 3 5 6 7 8 9
  5 1 2 3 4 6 7 8 9
  6 1 2 3 4 5 7 8 9
  7 1 2 3 4 5 6 8 9
  8 1 2 3 4 5 6 7 9
  9 1 2 3 4 5 6 7 8
Note how this is also the 9th finite subsquare of the sequence A237265, which can be picked from its terms A237265(205) .. A237265(285), where 205 = 1+A000330(9-1), the starting offset for that 9th subsquare in A237265.
		

References

  • Joseph J. Rotman, An Introduction to the Theory of Groups, 4th ed., Springer-Verlag, New York, 1995. First chapter, pp. 1-19 [For a general introduction], and from chapter 2, problem 2.9, p. 24.

Crossrefs

Transpose: A237448.
Topmost row and the leftmost column: A000027. Second column: A054977. Central diagonal: A028310 (note the different starting offsets).
Antidiagonal sums: A074148.
This array is the infinite limit of the n X n square matrices in A237265.

Programs

  • Maple
    T:= proc(r,c) if c > r then c elif c=1 then r else c-1 fi end proc:
    seq(seq(T(r,n-r),r=1..n-1),n=1..20); # Robert Israel, May 09 2017
  • Mathematica
    Table[Function[n, If[k == 1, n, k - Boole[k <= n]]][m - k + 1], {m, 15}, {k, m, 1, -1}] // Flatten (* Michael De Vlieger, May 09 2017 *)
  • PARI
    A237447(n,k=0)=if(k, if(k>1, k-(k<=n), n), A237447(A002260(n), A004736(n))) \\ Yields the element [n,k] of the matrix, or the n-th term of the "linearized" sequence if no k is given. - M. F. Hasler, Mar 09 2014
  • Scheme
    (define (A237447 n) (+ (* (A010054 n) (A002024 n)) (* (- 1 (A010054 n)) (- (A004736 n) (if (>= (A002260 n) (A004736 n)) 1 0)))))
    ;; Another variant based on Cano's A237265.
    (define (A237447 n) (let* ((row (A002260 n)) (col (A004736 n)) (sss (max row col)) (sof (+ 1 (A000330 (- sss 1))))) (A237265 (+ sof (* sss (- row 1)) (- col 1)))))
    

Formula

When col > row, T(row,col) = col, when 1 < col <= row, T(row,col) = col-1, and when col=1, T(row,1) = row.
a(n) = A010054(n) * A002024(n) + (1-A010054(n)) * (A004736(n) - [A002260(n) >= A004736(n)]). [This gives the formula for this entry represented as a one-dimensional sequence. Here the expression inside Iverson brackets results 1 only when the row index (A002260) is greater than or equal to the column index (A004736), otherwise zero. A010054 is the characteristic function for the triangular numbers, A000217.]
T(row,col) = A237265((A000330(max(row,col)-1)+1) + (max(row,col)*(row-1)) + (col-1)). [Takes the infinite limit of n X n matrices of A237265.]
G.f. as array: g(x,y) = (1 - 4*x*y + 3*x*y^2 + x^2*y - x*y^3)*x*y/((1-x*y)*(1-x)^2*(1-y)^2). - Robert Israel, May 09 2017

A237448 Square array T(row >= 1, col >= 1): The first row, row=1, T(1,col) = col = A000027. When row > col, T(row,col) = row, otherwise (when 1 < row <= col), T(row,col) = row-1.

Original entry on oeis.org

1, 2, 2, 3, 1, 3, 4, 1, 3, 4, 5, 1, 2, 4, 5, 6, 1, 2, 4, 5, 6, 7, 1, 2, 3, 5, 6, 7, 8, 1, 2, 3, 5, 6, 7, 8, 9, 1, 2, 3, 4, 6, 7, 8, 9, 10, 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13
Offset: 1

Views

Author

Antti Karttunen, Feb 10 2014

Keywords

Comments

This is transpose of A237447, please see comments there.

Examples

			The top left 9 X 9 corner of this infinite square array:
  1 2 3 4 5 6 7 8 9
  2 1 1 1 1 1 1 1 1
  3 3 2 2 2 2 2 2 2
  4 4 4 3 3 3 3 3 3
  5 5 5 5 4 4 4 4 4
  6 6 6 6 6 5 5 5 5
  7 7 7 7 7 7 6 6 6
  8 8 8 8 8 8 8 7 7
  9 9 9 9 9 9 9 9 8
		

Crossrefs

Transpose: A237447.
The leftmost column and the topmost row: A000027. Second row: A054977. Central diagonal: A028310 (note the different starting offsets).
Antidiagonal sums: A074148.

Programs

Formula

As a one-dimensional sequence:
If A010054(n-1) = 1 [that is, if n is in A000124], then a(n) = A002024(n), otherwise, if A004736(n) < A002260(n), a(n) = A002260(n), and if A004736(n) >= A002260(n), a(n) = A002260(n)-1.
Equivalently, as a square array T:
When col < row, T(row,col) = row, for 1 < row <= col, T(row,col) = row-1, and for the first row T(1,col) = col = A000027(col).
Can be computed also as a transposed version of the infinite limit of the finite square arrays in sequence A237265: T(row,col) = A237265((A000330(max(row,col)-1)+1) + (max(row,col)*(col-1)) + (row-1)).

A237450 Triangle read by rows, T(n,k) = !n + (k-1)*(n-1)!, with n>=1, 1<=k<=n; Position of the first n-letter permutation beginning with number k in the list of lexicographically sorted permutations A030299.

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 10, 16, 22, 28, 34, 58, 82, 106, 130, 154, 274, 394, 514, 634, 754, 874, 1594, 2314, 3034, 3754, 4474, 5194, 5914, 10954, 15994, 21034, 26074, 31114, 36154, 41194, 46234, 86554, 126874, 167194, 207514, 247834, 288154, 328474, 368794, 409114, 771994, 1134874, 1497754, 1860634, 2223514, 2586394, 2949274, 3312154, 3675034
Offset: 1

Views

Author

Antti Karttunen, Feb 08 2014

Keywords

Comments

When organized as a triangular table
1;
2, 3;
4, 6, 8;
10, 16, 22, 28;
34, 58, 82, 106, 130;
...
the k-th term of row n gives the position of the first n-letter permutation beginning with number k among all the lexicographically ordered permutations A030299. Thus the terms give the positions of rows of irregular table A237265 among the rows of A030298.
Note: the notation !n stands for the left factorial, A003422(n).

Crossrefs

Programs

  • Mathematica
    lf[n_] := lf[n] = (-1)^n n! Subfactorial[-n - 1] - Subfactorial[-1] // FullSimplify;
    T[n_, k_] := lf[n] + (k - 1)(n - 1)!;
    Table[T[n, k], {n, 1, 10}, {k, 1, n}] // Flatten
  • Scheme
    (define (A237450 n) (+ (A003422 (A002024 n)) (* (A002262 (- n 1)) (A000142 (- (A002024 n) 1)))))

Formula

a(n) = A003422(A002024(n)) + (A002262(n-1)*A000142(A002024(n)-1)).
Showing 1-6 of 6 results.