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.

Previous Showing 11-20 of 33 results. Next

A215940 Difference between the n-th and the first (identity) permutation of (0,...,m-1), interpreted as a decimal number, divided by 9 (for any m for which 10! >= m! >= n).

Original entry on oeis.org

0, 1, 10, 12, 21, 22, 100, 101, 120, 123, 131, 133, 210, 212, 220, 223, 242, 243, 321, 322, 331, 333, 342, 343, 1000, 1001, 1010, 1012, 1021, 1022, 1200, 1201, 1230, 1234, 1241, 1244, 1310, 1312, 1330, 1334, 1352, 1354, 1421, 1422, 1441, 1444, 1452, 1454, 2100
Offset: 1

Views

Author

R. J. Cano, Sep 21 2012

Keywords

Comments

Original definition: "Quotients of the polynomial remainder theorem for Diophantine equations among permutations."
The set built from the first terms of this sequence {0, 1, 10, 12, 21, 22, ....} contains the general solutions for a class of Diophantine linear equations among permutations, if one takes into account the unlimited number of distinct bases where these may be read.
From M. F. Hasler, Jan 12 2013, edited by R. J. Cano, May 08 2017: (Start)
Let P be the sequence of permutations of (0,...,m-1) interpreted as decimal numbers, P(n) = Sum_{i=1..m} 10^(m-i)*s(i) where s=(s(1),...,s(m)) is the n-th permutation (in lexicographical order), n <= m!. Then the difference P(n)-P(1) is independent of the choice of m, and divisible by 9. (Since 10 == 1 (mod 9), the numbers P(n) are all congruent (mod 9) to the sum s(1)+...+s(m).) This yields well-defined terms a(n)=(P(n)-P(1))/9.
For n>10!, P(n) will no longer be the concatenation of the "digits" (some of which will exceed 9). The pattern present in the decimal representation of the first terms will also be lost since there will be digits as large as d+1.
Note that the same a(n) is obtained independently of the chosen base b, provided that (i) 10 and 9 in the above are replaced with b and b-1, (ii) the result is (and can be) written in base b. (This implies the restriction to terms which can be written using the digits 0-9 to which the OEIS is limited.) See EXAMPLES for an illustration. (End)
We have P(n)-P(1)=a(n)*g(n), with g(n) = 9 = 10-1. Considering this and P(n) as polynomials in x=10, one can see an analogy with the polynomial remainder theorem. [Given as "formula" by R. J. Cano, rephrased by M. F. Hasler, Jan 12 2013]
Contribution by R. J. Cano, Feb 09 2013, (Start)
The maximum of the first m! terms of this sequence is given in base R by the explicit formula (please see A211869): max(m,R)=Sum_{k=1..m} k*(m-k)*R^(m-k-1);
If the first m! terms of this sequence were computed reading the permutations in base A033638(m), dividing their differences by A033638(m)-1, the resulting quotients would be written in the same way (with the same digits) in every base > A033638(m).
(End)
From R. J. Cano, Apr 29 2016, (Start)
Although in the sequence name it reads: "permutation of (0,...,m-1)", the most general statement that could replace it is: "permutation of any m-tuple of integers all of them in arithmetic progression", obtaining a multiple of this sequence, lambda*a(n), where lambda is the common difference for the progression. It works in such way because only the differences is what matters here.
Given x>1 and k>=0, if a polynomial G(x) of degree k is divided by x-1 then the remainder will be the sum of all the coefficients in G. Let us consider the case in which those coefficients are the differences among the letters ("digits") of two permutations for the same set of letters (0..x-1): The sum of all those differences must vanish. This explains how the difference between two of such permutations expressed in base x is 0 mod x-1, particularly why differences for pairs of permutations are divisible by 9.
Another way of introducing this sequence takes advantage of the fact that for n>1, n! is even. Consider for n>1 to obtain only the first n! terms. This can be done by subtracting the last permutation from the first, the penultimate permutation from the second, and so on by following the pattern (P(k)-P(n!-k+1))/9 with 1<=k<=n!. Such procedure generates an antisymmetric sequence f(k) from which a(k)=(f(k)+f(n!))/2. This partially explains why A217626 is symmetric. Also a base-independent treatment is possible using linear algebra: Column vectors and the strictly lower triangular matrix instead of the division by (r-1) where r is the base (and r=10 here for this sequence). This approach leads one to conclude that terms in this sequence are the differences between pairs of vectors made from the first n-1 partial sums of letters ("digits") taken from permutations for n consecutive letters, when components in these vectors are viewed as coefficients for a power series in r=10.
(End)

Examples

			From _M. F. Hasler_, Jan 12 2013, edited by _R. J. Cano_, May 09 2017: (Start)
The permutations of {0,1,2}, read as numbers, are {12, 21, 102, 120, 201, 210}. Subtracting the first one (12) from each of these numbers yields the differences {0, 9, 90, 108, 189, 198}. These are all multiples of 9, see comment and links. Dividing the differences by 9 yields {0, 1, 10, 12, 21, 22}, which are by definition the first six terms of this sequence.
Using all permutations of 0123 would yield 4!=24 terms, where the first 6 would be identical to those above. For n>10! we must consider permutations of (0,...,m-1) with m>10. These are no longer valid digits in base 10, and the numbers P(n) as defined in the comment are no longer equal to the concatenation. However, the first 10! terms obtained as (P(n)-P(1))/9, are still the same as for m=10;
In order to illustrate that the result is independent of the base chosen to make the calculation, let us consider permutations of 012 in base 3. The 3rd resp. 5th term ((102-012)/9=10 resp. (201-012)/9=21) would be ((1-0)*3^2+(0-1)*3+(2-2)*1)/(3-1) = 3 = 10[3], resp. ((2-0)*3^2+(0-1)*3+(1-2)*1)/(3-1) = 7 = 21[3]. The same terms would also be "10" and "21" if the calculation were made in base b=11. In that base, with digit "A" having the value b-1, we have (1023456789A - 0123456789A)/A = 0A000000000[11], (2013456789A - 0123456789A)/A = 02100000000[11], and (0A123456789 - 0123456789A)/A = 0A987654321[11] (the analog of (40123[5]-01234[5])/4[5] = 04321[5]). (End)
		

Crossrefs

Programs

  • C
    // See links.
    
  • Maple
    N:= 100: # to get a(1)..a(N)
    for M from 3 while M! <= N do od:
    p0:= [$1..M]: p:= p0: A[1]:= 0:
    for n from 2 to N do
      p:= combinat:-nextperm(p);
      d:= p - p0;
      A[n]:= add(10^(i-1)*d[-i],i=1..M)/9;
    od:
    seq(A[i],i=1..N); # Robert Israel, Apr 19 2017
  • Mathematica
    maxm = 5; Table[dd = FromDigits /@ Permutations[Range[m]]; (Drop[dd, If[m == 1, 0, (m - 1)!]] - First[dd])/9, {m, 1, maxm}] // Flatten (* Jean-François Alcover, Apr 25 2013 *)
  • PARI
    A215940(n)=for(k=2, n+1, k!M. F. Hasler, Jan 12 2013
    
  • PARI
    first_n_factorial_terms(n)={my(u=n!);my(x=numtoperm(n,0),y,z=vector(u),i:small);i=0;for(j=0,u-1,y=numtoperm(n,j)-x;z[i++]=fromdigits(vector(#x-1,k,vecsum(y[1..k]))));z} \\ R. J. Cano, Apr 19 2017

Formula

a(n) = Sum_{k=1..n-1} A217626(k).
a(n) = (A050289(n)-A050289(1))/9, for n <= 9!. - M. F. Hasler, Jan 12 2013

Extensions

Edited by M. F. Hasler, Jan 12 2013
Minor edits by N. J. A. Sloane, Feb 19 2013

A107346 Differences between successive permutations of 1,2,3,4,5 regarded as decimal numbers arranged in increasing order.

Original entry on oeis.org

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, 261, 9
Offset: 1

Views

Author

Ivan Meyer (ivan.mey(AT)gmail.com), May 23 2005

Keywords

Comments

We can produce similar sequences of length n!-1 from all the n-set permutations (1,...,n), starting from n=2 up to n=9. The next larger sequence contains always the preceding sequence as its proper prefix. See A219664 for the largest such sequence. - Antti Karttunen, Dec 18 2012
See A209280 for the extension of this sequence to 9!-1 terms, and for comments and formulas which apply to this subsequence. - M. F. Hasler, Jan 15 2013

Examples

			Permutations are 12345, 12354, 12435, ...
a(3) = 18 because if we order these permutations (ascending), then P(4)-P(3) = 12453-12435 = 18
		

Crossrefs

Programs

Formula

a(n) = A209280(n) for n<5!. See there for more useful relations. - M. F. Hasler, Jan 15 2013

A178475 Permutations of 12345: Numbers having each of the decimal digits 1,...,5 exactly once, and no other digit.

Original entry on oeis.org

12345, 12354, 12435, 12453, 12534, 12543, 13245, 13254, 13425, 13452, 13524, 13542, 14235, 14253, 14325, 14352, 14523, 14532, 15234, 15243, 15324, 15342, 15423, 15432, 21345, 21354, 21435, 21453, 21534, 21543, 23145, 23154, 23415
Offset: 1

Views

Author

M. F. Hasler, May 28 2010

Keywords

Comments

There are 5! = 120 terms in this finite subsequence of A030299.
It would be interesting to conceive simple and/or efficient functions which yield (a) the n-th term of this sequence: f(n) = a(n), (b) for a given term, the subsequent one: f(a(n)) = a(1 + (n mod 5!)).
From Nathaniel Johnston, May 19 2011: (Start)
Individual terms a(n) can be computed efficiently via the following procedure: Define b(n,k) = 1 + floor(((n-1) mod (k+1)!)/k!) for k = 1, 2, 3, 4. The first digit of a(n) is b(n,4). The second digit of a(n) is the b(n,3)-th number not already used. The third digit of a(n) is the b(n,2)-th number not already used. The fourth digit of a(n) is the b(n,1)-th number not already used, and the final digit of a(n) is the only digit remaining. This procedure generalizes in the obvious way for related sequences such as A178476.
For example, if n = 38 then we compute b(38,1) = 2, b(38,2) = 1, b(38,3) = 3, b(38,4) = 2. Thus a(38) = 24153 (2, followed by the 3rd digit not yet used, followed by the 1st digit not yet used, followed by the 2nd digit not yet used, followed by the last remaining digit).
(End)

Crossrefs

Programs

  • Mathematica
    FromDigits/@Permutations[Range[5]] (* Harvey P. Dale, Jan 19 2019 *)
  • PARI
    A178475(n)={my(b=vector(4,k,1+(n-1)%(k+1)!\k!),t=b[4],d=vector(4,i,i+(i>=t)));for(i=1,3,t=10*t+d[b[4-i]];d=vecextract(d,Str("^"b[4-i])));t*10+d[1]} \\ - M. F. Hasler (following N. Johnston's comment), Jan 10 2012
    
  • PARI
    v=vector(5,i,10^(i-1))~; A178475=vecsort(vector(5!,i,numtoperm(5,i)*v))
    is_A178475(x)={ vecsort(Vecsmall(Str(x)))==Vecsmall("12345") }
    forstep( m=12345,54321,9, is_A178475(m) & print1(m","))

Formula

a(n) + a(5! + 1 - n) = 66666.
floor( a(n) / 10^4 ) = ceiling( n / 4! ).
a(n) = A030299(n+33).
a(n) == 6 (mod 9).
a(n) = 6 + 9*A178485(n).

A156071 Concatenation chain arising in A156069.

Original entry on oeis.org

3, 38, 381, 3816, 38165, 381654, 3816547, 38165472, 381654729
Offset: 1

Views

Author

Keywords

Comments

a(9) is a zeroless pandigital number in base 10, with 9 digits such that every k-digit substring ( 1 <= k <= 9 ) taken from the left, is divisible by k (see A163574). - Michel Marcus, Dec 01 2013

References

  • Matt Parker, Things to make and do in the fourth dimension, 2015, pages 7-9.

Crossrefs

A178476 Permutations of 123456: Numbers having each of the decimal digits 1,...,6 exactly once, and no other digit.

Original entry on oeis.org

123456, 123465, 123546, 123564, 123645, 123654, 124356, 124365, 124536, 124563, 124635, 124653, 125346, 125364, 125436, 125463, 125634, 125643, 126345, 126354, 126435, 126453, 126534, 126543, 132456, 132465, 132546, 132564, 132645, 132654
Offset: 1

Views

Author

M. F. Hasler, May 28 2010

Keywords

Comments

This finite sequence contains 6!=720 terms.
This is a subsequence of A030299, consisting of elements A030299(154)..A030299(873).
If individual digits are be split up into separate terms, we get a subsequence of A030298.
It would be interesting to conceive simple and/or efficient functions which yield (a) the n-th term of this sequence: f(n)=a(n), (b) for a given term, the subsequent one: f(a(n)) = a(1 + (n mod 6!)).
The expression a(n+6) - a(n) takes only 18 different values for n = 1..6!-6.
An efficient procedure for generating the n-th term of this sequence can be found at A178475. - Nathaniel Johnston, May 19 2011
From Hieronymus Fischer, Feb 13 2013: (Start)
The sum of all terms as decimal numbers is 279999720.
General formula for the sum of all terms (interpreted as decimal permutational numbers with exactly d different digits from the range 1..d < 10): sum = (d+1)!*(10^d-1)/18.
If the terms are interpreted as base-7 numbers the sum is 49412160.
General formula for the sum of all terms of the corresponding sequence of base-p permutational numbers (numbers with exactly p-1 different digits excluding the zero digit): sum = (p-2)!*(p^p-p)/2. (End)

Crossrefs

Programs

  • Mathematica
    Take[FromDigits/@Permutations[Range[6]],40] (* Harvey P. Dale, Jun 05 2012 *)
  • PARI
    v=vector(6,i,10^(i-1))~; A178476=vecsort(vector(6!,i,numtoperm(6,i)*v));
    is_A178476(x)= { vecsort(Vec(Str(x)))==Vec("123456") }
    forstep( m=123456,654321,9, is_A178476(m) & print1(m","))

Formula

a(n) + a(6! + 1 - n) = 777777.
floor( a(n) / 10^5 ) = ceiling( n / 5! ).
a(n) = A030299(n+153).
a(n) == 3 (mod 9).
a(n) = 3 + 9*A178486(n).

A178485 (A178475(n)-6)/9.

Original entry on oeis.org

1371, 1372, 1381, 1383, 1392, 1393, 1471, 1472, 1491, 1494, 1502, 1504, 1581, 1583, 1591, 1594, 1613, 1614, 1692, 1693, 1702, 1704, 1713, 1714, 2371, 2372, 2381, 2383, 2392, 2393, 2571, 2572, 2601, 2605, 2612, 2615, 2681, 2683, 2701, 2705, 2723, 2725
Offset: 1

Views

Author

M. F. Hasler, May 28 2010

Keywords

Comments

There are 5!=120 terms in this finite sequence. Its origin is the fact that numbers whose decimal expansion is a permutation of 12345 are all of the form 9k+6.

Crossrefs

Programs

  • PARI
    v=vector(5,i,10^(i-1))~; vecsort(vector(5!,i,numtoperm(5,i)*v))
    is_A178475(x)= { vecsort(Vec(Str(x)))==Vec("12345") }
    forstep( m=12345,54321,9, is_A178475(m) & print1(m","))

Formula

a(n) + a(5!+1-n) = 7406.
a(n) == 1, 2, 3, 4 or 5 (mod 10).
a(n+6)-a(n) is an element of { 100, 110, 111, 200, 220, 222, 679 }.
a(n+6)-a(n) = 679 iff (n-1)%24 > 17, where % denotes the remainder upon division.
a(n+6)-a(n) = 200, 220 or 222 iff (n-1)%30 > 23, i.e. n==25,...,30 (mod 30).

A178486 (A178476(n)-3)/9.

Original entry on oeis.org

13717, 13718, 13727, 13729, 13738, 13739, 13817, 13818, 13837, 13840, 13848, 13850, 13927, 13929, 13937, 13940, 13959, 13960, 14038, 14039, 14048, 14050, 14059, 14060, 14717, 14718, 14727, 14729, 14738, 14739, 14917, 14918, 14947, 14951, 14958, 14961
Offset: 1

Views

Author

M. F. Hasler, May 28 2010

Keywords

Comments

The sequence is motivated by the fact that numbers whose decimal expansion is a permutation of 123456, are all of the form 9k+3.
There are 6!=720 terms in this finite sequence.

Crossrefs

Programs

  • PARI
    forstep( m=123456,654321/*or less*/,9, is_A178476(m) & print1(m\9",")) /*cf. A178476*/

Formula

a(n) + a(6!+1-n) = 86419.
a(n) == 0, 1, 2, 7, 8 or 9 (mod 10).

A220656 The positions of those permutations in A030298 where the first element is not fixed.

Original entry on oeis.org

3, 6, 7, 8, 9, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100
Offset: 1

Views

Author

Antti Karttunen, Dec 17 2012

Keywords

Comments

Correspondingly, gives the positions of those terms in A030299 whose first digit is not 1, as long as the decimal encoding system employed is valid.

Crossrefs

Complement: A220696. Cf. A081291.

Programs

Formula

a(n) = A003422(1+A084558(n)) + A000142(A084558(n)) + A212598(n).
a(n) = A220655(n)+1.

A220660 Irregular table, where the n-th row consists of numbers 0..(n!-1).

Original entry on oeis.org

0, 0, 1, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39
Offset: 1

Views

Author

Antti Karttunen, Dec 18 2012

Keywords

Comments

Used for computing A030298: a(n) tells the zero-based ranking of the n-th permutation in A030298 (A030299(n)) in the lexicographical ordering of all finite permutations of the same size.

Examples

			Rows of this irregular table begin as:
0;
0, 1;
0, 1, 2, 3, 4, 5;
		

Crossrefs

Programs

Formula

a(n) = n - A007489(A084556(n)-1) - 1.
a(n) = A220661(n)-1.

A292523 Decimal encoding T(n,k) of the k-th non-averaging permutation of [n]; triangle T(n,k), n >= 0, k = 1..A003407(n), read by rows.

Original entry on oeis.org

0, 1, 12, 21, 132, 213, 231, 312, 1324, 1342, 2143, 2413, 2431, 3124, 3142, 3412, 4213, 4231, 15324, 15342, 21453, 24153, 24315, 24351, 24513, 31254, 31524, 31542, 35124, 35142, 35412, 42153, 42315, 42351, 42513, 45213, 51324, 51342, 153264, 153426, 153462
Offset: 0

Views

Author

Alois P. Heinz, Dec 08 2017

Keywords

Comments

A non-averaging permutation avoids any 3-term arithmetic progression.
The encoding of the empty permutation () is 0. For positive n each element in the permutation is encoded using 1+floor(log_10(n)) = A055642(n) digits with leading 0's if necessary. Then all elements are concatenated.
All terms are in increasing order.

Examples

			Triangle T(n,k) begins:
:            0;
:            1;
:           12, 21;
:          132, 213, 231, 312;
:         1324, 1342, 2143, 2413,  2431,    3124,  3142, 3412, 4213, 4231;
:        15324, 15342, 21453, 24153,    ...,    42513, 45213, 51324, 51342;
:       153264, 153426, 153462, 153624, ..., 624153, 624315, 624351, 624513;
:      1532764, 1537264, 1537426,       ...,       7351462, 7351624, 7356124;
:     15327648, 15327684, 15372648,     ...,     84627351, 84672315, 84672351;
:    195327648, 195327684, 195372648,   ...,   915738462, 915783426, 915783462;
:   1090503020710060408,                ...,               10020608090401050703;
:  109050302110710060408,               ...,              1103070910010502060804;
: 10905031107021006041208,              ...,             120408100206110307090105;
		

Crossrefs

Programs

  • Maple
    T:= proc(n) option remember; local b, l, c; b, l, c:=
          proc(s, p) local ok, i, j, k;
            if nops(s) = 0 then l:= [l[], parse(p)]
          else for j in s do ok, i, k:= true, j-1, j+1;
                 while ok and i>0 and k<=n do ok, i, k:=
                   not i in s xor k in s, i-1, k+1 od;
                 `if`(ok, b(s minus {j}, cat(p, 0$(c-length(j)), j)), 0)
               od
            fi
          end, [], length(n); b({$1..n}, "0"): sort(l)[]
        end:
    seq(T(n), n=0..6);
Previous Showing 11-20 of 33 results. Next