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-7 of 7 results.

A358314 Triangle T(n,k) read by rows where T(2m - 1,k) = (A051845(2m - 1,k))/(2m - 1) and T(2m,k) = A051845(2m,k)/m for m > 0, k > 0.

Original entry on oeis.org

1, 5, 7, 9, 10, 13, 15, 18, 19, 97, 99, 107, 111, 119, 121, 147, 149, 167, 173, 179, 183, 207, 211, 217, 223, 241, 243, 269, 271, 279, 283, 373, 374, 379, 381, 386, 387, 409, 410, 421, 424, 428, 430, 451, 453, 457, 460, 471
Offset: 1

Views

Author

Keywords

Comments

The n-th row has n! elements.

Examples

			Triangle begins:
       k=1  k=2  k=3 ...
  n=1:   1;
  n=2:   5,   7;
  n=3:   9,  10, ...,  19;
  n=4:  97,  99, 107, ..., 283;
  n=5: 373, 374, 379, 381, ..., 471;
  ...
		

Crossrefs

Cf. A051845, left edge = A221741, right edge = A221740.

Formula

T(n,1) = 4*(((n+1)^(n+1)-(n+1))/((n+1)-1)^2-1)/((3-(-1)^n)*n) = A221741(n).
T(n,n!) = 4*((n-1)*(n+1)^(n+1)+1)/((3-(-1)^n)*n^3) = A221740(n).

A030299 Decimal representation of permutations of lengths 1, 2, 3, ... arranged lexicographically.

Original entry on oeis.org

1, 12, 21, 123, 132, 213, 231, 312, 321, 1234, 1243, 1324, 1342, 1423, 1432, 2134, 2143, 2314, 2341, 2413, 2431, 3124, 3142, 3214, 3241, 3412, 3421, 4123, 4132, 4213, 4231, 4312, 4321, 12345, 12354, 12435, 12453, 12534, 12543, 13245, 13254, 13425
Offset: 1

Views

Author

Keywords

Comments

This is a list of the permutations in "one-line" notation (cf. Dixon and Mortimer, p. 2). The i-th element of the string is the image of i under the permutation. For example 231 is the permutation that sends 1 to 2, 2 to 3, and 3 to 1. - N. J. A. Sloane, Apr 12 2014
Precise definition of the term "Decimal representation" (required for indices n>409113): Numbers N(s) = Sum_{i=1..m} s(i)*10^(m-i), where s runs over the permutations of (1,...,m), and m=1,2,3,.... This also defines the "lexicographical" order: Obviously 21 comes before 123, etc. The lexicographical order of the permutations, for given m, is the same as the natural order of the numbers N(s). - M. F. Hasler, Jan 28 2013
An alternate variant, using concatenation of the permutations, is very clumsy once the length exceeds 9. For example, after 987654321 (= A030299(409113), where 409113 = A007489(9)) we would get 12345678910, 12345678109, ... In A030298 this problem has been avoided by listing the elements of permutations as separate terms. [Edited by M. F. Hasler, Jan 28 2013]
Sequence A051845 is a base-independent version of this sequence: Permutations of 1...m are considered as numbers written in base m+1. - M. F. Hasler, Jan 28 2013

References

  • John D. Dixon and Brian Mortimer, Permutation groups. Graduate Texts in Mathematics, 163. Springer-Verlag, New York, 1996. xii+346 pp. ISBN: 0-387-94599-7 MR1409812 (98m:20003).

Crossrefs

A007489(n) gives the position (index) of the term corresponding to last permutation of n elements: (n,n-1,...,1).
The first differences A220664 has interesting fractal structure, see A219664 and A217626.
Cf. also A030298, A055089, A060117, A181073, A352991 (by concatenation).
See A240763 for preferential arrangements.

Programs

  • Maple
    seq(seq(add(s[i]*10^(m-i),i=1..m),s=combinat:-permute([$1..m])),m=1..5); # Robert Israel, Oct 14 2015
  • Mathematica
    Flatten @ Table[FromDigits /@ Permutations[Table[i,{i,n}]],{n,9}] (* For first 409113 terms; Zak Seidov, Oct 03 2015 *)
  • PARI
    is_A030299(n)={ (n>1234567890 & print("maybe")) || vecsort(digits(n))==vector(#Str(n),i,i) } \\ /* use digits(n)=eval(Vec(Str(n))) in older versions lacking this function */ \\ M. F. Hasler, Dec 12 2012
    (MIT/GNU Scheme)
    ;; Antti Karttunen, Dec 18 2012
    ;; Requires also code from A030298 and A055089:
    (define (A030299 n) (vector->base-k (A030298permvec (A084556 n) (A220660 n)) 10))
    (define (vector->base-k vec k) (let loop ((i 0) (s 0)) (cond ((= (vector-length vec) i) s) ((>= (vector-ref vec i) k) (error (format #f "Cannot interpret vector ~a in base ~a!" vec k))) (else (loop (+ i 1) (+ (* k s) (vector-ref vec i)))))))
    
  • Python
    from itertools import permutations
    def pmap(s, m): return sum(s[i-1]*10**(m-i) for i in range(1, len(s)+1))
    def agen():
      m = 1
      while True:
        for s in permutations(range(1, m+1)): yield pmap(s, m)
        m += 1
    def aupton(terms):
      alst, g = [], agen()
      while len(alst) < terms: alst += [next(g)]
      return alst
    print(aupton(42)) # Michael S. Branicky, Jan 12 2021

Extensions

Edited by N. J. A. Sloane, Feb 23 2010

A051846 Digits 1..n in strict descending order n..1 interpreted in base n+1.

Original entry on oeis.org

1, 7, 57, 586, 7465, 114381, 2054353, 42374116, 987654321, 25678050355, 736867805641, 23136292864686, 789018236134297, 29043982525261081, 1147797409030816545, 48471109094902544776, 2178347851919531492065, 103805969587115219182431
Offset: 1

Views

Author

Antti Karttunen, Dec 13 1999

Keywords

Comments

All odd-indexed (2n+1) terms are divisible by (2n+1). See A051847.
All even-indexed (2n) terms are divisible by n. - Alexander R. Povolotsky, Oct 20 2022

Examples

			a(1) = 1,
a(2) = 2*3 + 1 = 7,
a(3) = 3*(4^2) + 2*4 + 1 = 57,
a(4) = 4*(5^3) + 3*(5^2) + 2*5 + 1 = 586.
		

Crossrefs

The right edge of A051845.

Programs

  • Maple
    a(n) := proc(n) local i; add(i*((n+1)^(i-1)),i=1..n); end;
  • Mathematica
    Array[Sum[i*(# + 1)^(i - 1), {i, #}] &, 18] (* Michael De Vlieger, Apr 04 2024 *)
  • Maxima
    makelist(((n+1)^(n+1)*(n-1) + 1)/n^2,n,1,20); /* Martin Ettl, Jan 25 2013 */
    
  • PARI
    a(n)=((n+1)^(n+1)*(n-1)+1)/n^2
    
  • Python
    def a(n): return sum((i+1)*(n+1)**i for i in range(n))
    print([a(n) for n in range(1, 20)]) # Michael S. Branicky, Apr 10 2022

Formula

a(n) = Sum_{i=1..n} i*(n+1)^(i-1).
a(n) = ((n+1)^(n+1)*(n-1) + 1)/n^2 = A062806(n+1)/(n+1) - (n+1)^(n+1). - Benoit Cloitre, Sep 28 2002
a(n) = A028310(n-1) * A023811(n+1) + A199969(n+1). - M. F. Hasler, Jan 22 2013
a(n) = (n-1) * A058128(n+1) + 1. - Seiichi Manyama, Apr 10 2022

Extensions

Minor edits in formulas by M. F. Hasler, Oct 11 2019

A134750 Variant of permutational numbers with shifted digits 0->1->2->...->k+1 in k+1 positional system.

Original entry on oeis.org

1, 4, 5, 18, 20, 24, 28, 32, 34, 112, 115, 124, 130, 139, 142, 160, 163, 184, 193, 199, 205, 220, 226, 232, 241, 262, 265, 283, 286, 295, 301, 310, 313, 975, 979, 995, 1003, 1019, 1023, 1075, 1079, 1115, 1127, 1139, 1147, 1195, 1203, 1215, 1227, 1263, 1267
Offset: 1

Views

Author

Artur Jasinski, Nov 08 2007

Keywords

Comments

Variant of permutational numbers with shifted digits 0->1->2->...->k+1 in k+2 positional system see A051845

Crossrefs

Programs

  • Mathematica
    a = {}; b = {}; Do[AppendTo[b, n]; w = Permutations[b]; Do[j = FromDigits[1 + w[[m]], n + 1]; AppendTo[a, j], {m, 1, Length[w]}], {n, 0, 5}]; a (*Artur Jasinski*)

A158930 a(n) is the smallest integer not yet in the sequence with no common base-5 digit with a(n-1).

Original entry on oeis.org

1, 2, 3, 4, 5, 12, 6, 10, 8, 14, 15, 7, 18, 9, 13, 20, 11, 19, 25, 17, 21, 50, 16, 22, 26, 23, 27, 24, 28, 62, 29, 63, 30, 64, 31, 52, 33, 54, 41, 60, 34, 53, 46, 65, 49, 67, 45, 68, 100, 32, 75, 36, 78, 37, 79, 56, 90, 39, 93, 35, 94, 51, 98, 55, 99, 57, 95, 61, 103, 156, 69
Offset: 1

Views

Author

R. J. Mathar, Mar 31 2009

Keywords

Comments

Numbers of A031946 or of the 4th row of A051845 do not appear in this sequence. In base-5 notation the sequence reads 1,2,3,4,10,22,11,20,13,24,30,12,33,14,...

Examples

			The terms a(1) to a(4) are the first integers in order because they have only a single, non-common digit. a(5)=5(base10)=10(base5) does not share a digit with a(4)=4(base10)=4(base5). The numbers 6(base10)=11(base5) to 9(base10)=14(base5) are ruled out for a(6) because they share a 1 with 10(base5). The numbers 10(base10)=20(base5) and 11(base10)=21(base5) are also ruled out for a(6) because they either have a 0 or a 1 in common with a(5)=10(base5). So a(6)=12(base10)=22(base5) with no 0 or 1 is selected.
		

Crossrefs

Cf. A067581 (base-10), A158928 (base-3), A158929 (base-4).

Programs

  • Maple
    for S in combinat:-powerset({$0..4}) minus {{},{$0..4}} do
      if member(0,S) then Last[S]:= 0 else Last[S]:= 1 fi od:
    Next:= proc(S)
      global Last; local L, nL;
      if nops(S) = 1 then Last[S]:= Last[S]*5+S[1]; return Last[S] fi;
      Last[S]:= 1+Last[S];
      L:= convert(Last[S],base,nops(S));
      nL:= nops(L);
      if (not member(0,S)) then
       if L[-1] > 1 then
        Last[S]:= (nops(S))^nL;
        L:= [0$nL,1];
       else nL:= nL-1
       fi
      fi;
      L:= subs({seq(i-1=S[i],i=1..nops(S))},L);
      add(L[i]*5^(i-1),i=1..nL)
    end proc:
    Done:= {1}:
    A[1]:= 1:
    for n from 2 to 100 do
      S:= {$0..4} minus convert(convert(A[n-1],base,5),set);
      do
        x:= Next(S);
        if not member(x,Done) then break fi
      od;
      A[n]:= x;
      Done:= Done union {x};
    od:
    seq(A[i],i=1..100); # Robert Israel, Jun 25 2018

A051849 Table in which n-th row gives all compositions of n interpreted as digits in base n+1.

Original entry on oeis.org

1, 2, 4, 3, 6, 9, 21, 4, 8, 12, 16, 32, 36, 56, 156, 5, 10, 15, 20, 25, 45, 50, 55, 80, 85, 115, 260, 265, 295, 475, 1555, 6, 12, 18, 24, 30, 36, 60, 66, 72, 78, 108, 114, 120, 156, 162, 204, 402, 408, 414, 450, 456, 498, 744, 750, 792, 1086, 2802, 2808, 2850, 3144
Offset: 1

Views

Author

Antti Karttunen, Dec 13 1999

Keywords

Comments

All terms on row n are divisible by n. See A051850.

Examples

			n-th row has length 2^(n-1) (A000079[n-1]) 1; 2, 4; 3, 6, 9, 21; 4, 8, 12, 16, 32, 36, 56, 156; 3 can be written as sum like 3, or 1+2 or 2+1 or 1+1+1. Numbers 3, 12, 21 and 111 interpreted in base 4 give the third row of table: 3,6,9,21
		

Crossrefs

Cf. A051850, A051851, ...
Cf. A124734.

Programs

  • Maple
    with(combinat); rows_upto_u := proc(u) local a,n; a := []; for n from 1 to u do a := [op(a),op(sort(map(list_in_base_b,map(op,map(permute,partition(n))),(n+1))))]; od; RETURN(a); end; # list_in_base_b given in A051845.

Extensions

Definition corrected by Franklin T. Adams-Watters, Nov 20 2006

A051851 Table in which n-th row gives all partitions of n interpreted in base n+1. (A subset of A051849 with each term having a non-descending digit-sequence in base n+1).

Original entry on oeis.org

1, 2, 4, 3, 6, 21, 4, 8, 12, 32, 156, 5, 10, 15, 45, 50, 260, 1555, 6, 12, 18, 24, 60, 66, 114, 402, 408, 2802, 19608, 7, 14, 21, 28, 77, 84, 91, 147, 588, 595, 658, 4683, 4690, 37450, 299593, 8, 16, 24, 32, 40, 96, 104, 112, 184, 192, 824, 832, 840, 912, 1640
Offset: 1

Views

Author

Antti Karttunen, Dec 13 1999

Keywords

Comments

All terms on row n are divisible by n (see A051852).

Examples

			Rows have lengths 1,2,3,5,7,11,15, etc. (A000041(n)). Terms: 1; 2, 4; 3, 6, 21; 4, 8, 12, 32, 156; 5, 10, 15, 45, 50, 260, 1555;
		

Crossrefs

A subset of A051849.

Programs

  • Maple
    with(combinat); rows_upto_u := proc(u) local a,n; a := []; for n from 1 to u do a := [op(a),op(sort(map(list_in_base_b,partition(n),(n+1))))]; od; RETURN(a); end; # list_in_base given in A051845.
Showing 1-7 of 7 results.