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-10 of 13 results. Next

A084555 Partial sums of A084556.

Original entry on oeis.org

0, 1, 3, 5, 8, 11, 14, 17, 20, 23, 27, 31, 35, 39, 43, 47, 51, 55, 59, 63, 67, 71, 75, 79, 83, 87, 91, 95, 99, 103, 107, 111, 115, 119, 124, 129, 134, 139, 144, 149, 154, 159, 164, 169, 174, 179, 184, 189, 194, 199, 204, 209, 214, 219, 224, 229, 234, 239, 244, 249
Offset: 0

Views

Author

Antti Karttunen, Jun 02 2003

Keywords

Comments

For n>=1, (A130664(n),a(n)) = (1,1),(2,3),(4,5),(6,8),(9,11),(12,14),... gives the starting and ending offsets of the n-th permutation in the sequences like A030298 & A030496.
Note: this sequence is related to (ordinary) permutations. For a similar sequence related to juggling with three objects, see A084505.

Crossrefs

Differs from A084505 first time at the 130th term, where A084505(130) = 605, while A084555(130) = 604.

Programs

  • Mathematica
    Accumulate@ Flatten[ Table[#, {#!}] & /@ Range[0, 5]]

Formula

a(0)=0; for n >= 1, a(n) = a(n-1) + A084556(n). Also a(n) = A130664(n+1) - 1. - Antti Karttunen, Dec 18 2012

Extensions

Moved the misplaced Mathematica code from A084505. - Antti Karttunen, Oct 24 2012

A084557 a(0)=0, after which each n occurs A084556(n) times.

Original entry on oeis.org

0, 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 23
Offset: 0

Views

Author

Antti Karttunen, Jun 02 2003

Keywords

Comments

Also minimum i such that A084555(i) >= n.
For n>=1, a(n) tells that the n-th term in A030298 belongs to the a(n):th lexicographically ordered permutation.

Crossrefs

Differs from A084500 first time at the 605th term, where A084500(605) = 130, while A084557(605) = 131.

A220663 Irregular table: row n (n>=1) consists of numbers 0..A084556(n)-1.

Original entry on oeis.org

0, 0, 1, 0, 1, 0, 1, 2, 0, 1, 2, 0, 1, 2, 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, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3
Offset: 1

Views

Author

Antti Karttunen, Dec 18 2012

Keywords

Comments

The term a(n) tells from which position (zero-based, starting from the left hand end of permutation) of the corresponding permutation in A030298 the term A030298(n) should be picked from.

Examples

			Rows of this irregular table begin as:
0;
0, 1;
0, 1;
0, 1, 2;
0, 1, 2;
...
		

Crossrefs

Programs

Formula

a(n) = n - A220662(n).
a(n) = A220694(n)-1.

A220662 Irregular table: row n (n>=1) consists of A084556(n) copies of A130664(n).

Original entry on oeis.org

1, 2, 2, 4, 4, 6, 6, 6, 9, 9, 9, 12, 12, 12, 15, 15, 15, 18, 18, 18, 21, 21, 21, 24, 24, 24, 24, 28, 28, 28, 28, 32, 32, 32, 32, 36, 36, 36, 36, 40, 40, 40, 40, 44, 44, 44, 44, 48, 48, 48, 48, 52, 52, 52, 52, 56, 56, 56, 56, 60, 60, 60, 60, 64, 64, 64, 64, 68
Offset: 1

Views

Author

Antti Karttunen, Dec 18 2012

Keywords

Comments

The term a(n) gives the position of the first term in A030298 which belongs to the same permutation as A030298(n) itself.

Examples

			Rows of this irregular table begin as:
1;
2, 2;
4, 4;
6, 6, 6;
9, 9, 9;
		

Crossrefs

Formula

a(n) = A130664(A084557(n)) = A084555(A084557(n)-1)+1.
a(A130664(n)) = A130664(n).

A220694 Irregular table: row n (n>=1) consists of numbers 1..A084556(n).

Original entry on oeis.org

1, 1, 2, 1, 2, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4
Offset: 1

Views

Author

Antti Karttunen, Dec 18 2012

Keywords

Comments

The term a(n) tells from which position (one-based, starting from the left hand end of permutation) of the corresponding permutation in A030298 the term A030298(n) should be picked from. Use this (instead of A220663) with programming languages like Maple, which use one-based indexing of arrays and vectors.

Examples

			Rows of this irregular table begin as:
  1;
  1, 2;
  1, 2;
  1, 2, 3;
  1, 2, 3;
  ...
		

Crossrefs

Programs

Formula

a(n) = A220663(n)+1.

A084558 a(0) = 0; for n >= 1: a(n) = largest m such that n >= m!.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jun 23 2003

Keywords

Comments

For n >= 1, a(n) = the number of significant digits in n's factorial base representation (A007623).
After zero, which occurs once, each n occurs A001563(n) times.
Number of iterations (...(f_4(f_3(f_2(n))))...) such that the result is < 1, where f_j(x):=x/j. - Hieronymus Fischer, Apr 30 2012
For n > 0: a(n) = length of row n in table A108731. - Reinhard Zumkeller, Jan 05 2014

Examples

			a(4) = 2 because 2! <= 4 < 3!.
		

References

  • F. Smarandache, "f-Inferior and f-Superior Functions - Generalization of Floor Functions", Arizona State University, Special Collections.

Crossrefs

Programs

  • Haskell
    a084558 n = a090529 (n + 1) - 1  -- Reinhard Zumkeller, Jan 05 2014
    
  • Maple
    0, seq(m$(m*m!),m=1..5); # Robert Israel, Apr 27 2015
  • Mathematica
    Table[m = 1; While[m! <= n, m++]; m - 1, {n, 0, 104}] (* Jayanta Basu, May 24 2013 *)
    Table[Floor[Last[Reduce[x! == n && x > 0, x]]], {n, 120}] (* Eric W. Weisstein, Sep 13 2024 *)
  • PARI
    a(n)={my(m=0);while(n\=m++,);m-1} \\ R. J. Cano, Apr 09 2018
    
  • Python
    def A084558(n):
      i=1
      while n: i+=1; n//=i
      return(i-1)
    print(list(map(A084558,range(101)))) # Natalia L. Skirrow, May 28 2023

Formula

From Hieronymus Fischer, Apr 30 2012: (Start)
a(n!) = a((n-1)!)+1, for n>1.
G.f.: 1/(1-x)*Sum_{k>=1} x^(k!).
The explicit first terms of the g.f. are: (x+x^2+x^6+x^24+x^120+x^720...)/(1-x).
(End)
Other identities:
For all n >= 0, a(n) = A090529(n+1) - 1. - Reinhard Zumkeller, Jan 05 2014
For all n >= 1, a(n) = A060130(n) + A257510(n). - Antti Karttunen, Apr 27 2015
a(n) ~ log(n^2/(2*Pi)) / (2*LambertW(log(n^2/(2*Pi))/(2*exp(1)))) - 1/2. - Vaclav Kotesovec, Aug 22 2025

Extensions

Name clarified by Antti Karttunen, Apr 27 2015

A030298 List of permutations of 1,2,3,...,n for n=1,2,3,..., in lexicographic order.

Original entry on oeis.org

1, 1, 2, 2, 1, 1, 2, 3, 1, 3, 2, 2, 1, 3, 2, 3, 1, 3, 1, 2, 3, 2, 1, 1, 2, 3, 4, 1, 2, 4, 3, 1, 3, 2, 4, 1, 3, 4, 2, 1, 4, 2, 3, 1, 4, 3, 2, 2, 1, 3, 4, 2, 1, 4, 3, 2, 3, 1, 4, 2, 3, 4, 1, 2, 4, 1, 3, 2, 4, 3, 1, 3, 1, 2, 4, 3, 1, 4, 2, 3, 2, 1, 4, 3, 2, 4, 1, 3, 4, 1, 2, 3, 4, 2, 1, 4, 1, 2, 3, 4, 1, 3, 2, 4, 2
Offset: 1

Views

Author

Keywords

Comments

Contains every finite sequence of distinct numbers, infinitely many times.

Examples

			The permutations can be written as
  1,
  12, 21,
  123, 132, 213, 231, 312, 321, etc.
Write them in order and insert commas.
		

Crossrefs

A030299 gives the initial portion of these same permutations as decimally encoded numbers.
Cf. A001563 (row lengths), A001286 (row sums).
Cf. A030496 for another ordering.
The same information is essentially given in A055089, but in more compact way, by skipping those permutations which start with a fixed element (cf. A220696).
A220660(n) tells the zero-based rank r of the n-th permutation in this sequence, among all finite permutations of the same size.
A220663(n) tells the zero-based position (from the left) of that a(n) in that permutation of rank r.
A084557(n) tells that the n-th term a(n) belongs to the a(n):th lexicographically ordered permutation from the start (its "global rank").
A220660(A084557(n)) tells the "local rank" of the permutation (amongst the permutations of the same size) to which the n-th term a(n) belongs.
(A130664(n),A084555(n)) = (1,1),(2,3),(4,5),(6,8),(9,11),(12,14),... gives the starting and ending offsets of the n-th permutation in this list.

Programs

  • Haskell
    import Data.List (permutations, sort)
    a030298 n k = a030298_tabf !! (n-1) (k-1)
    a030298_row = concat . sort . permutations . enumFromTo 1
    a030298_tabf = map a030298_row [1..]
    -- Reinhard Zumkeller, Mar 29 2012
    (MIT/GNU Scheme, with Antti Karttunen's intseq-library):
    ;; Note that in Scheme, vector indexing is zero-based.
    ;; Requires also A055089permvec from A055089.
    (define (A030298 n) (vector-ref (A030298permvec (A084556 (A084557 n)) (A220660 (A084557 n))) (A220663 n)))
    (define (A030298permvec size rank) (vector-reverse (vector1invert (A055089permvec size rank))))
    (define (vector1invert vec) (make-initialized-vector (vector-length vec) (lambda (i) (1+ (- (vector-length vec) (vector-ref vec i))))))
    (define (vector-reverse vec) (make-initialized-vector (vector-length vec) (lambda (i) (vector-ref vec (- (vector-length vec) i 1)))))
    
  • Mathematica
    f[n_] := Permutations[Range@ n, {n}]; Array[f, 4] // Flatten (* Robert G. Wilson v, Dec 18 2012 *)
  • Python
    from itertools import permutations, count, chain, islice
    def A030298_gen(): # generator of terms
        return chain.from_iterable(p for l in count(2) for p in permutations(range(1,l)))
    A030298_list = list(islice(A030298_gen(),30)) # Chai Wah Wu, Mar 21 2022

Formula

Start with 1, then 12 and 21, then the 6 permutations of 123 in lexical order: 123, 132, 213, 231, 312, 321 and so on.

Extensions

Entry revised by N. J. A. Sloane, Feb 02 2006
Keyword tabf added by Reinhard Zumkeller, Mar 29 2012

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

A084506 The length of each successively larger 3-ball ground-state site swap given in A084501, i.e., the number of digits in each term of A084502.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jun 02 2003

Keywords

Crossrefs

Partial sums: A084505.
Differs from A084556 first time at the 130th term, where A084506(130) = 6, while A084556(130) = 5.

A258198 a(n) = largest k for which A001563(k) = k*k! <= n.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, May 23 2015

Keywords

Comments

Number of nonzero terms of A001563 <= n.
Each n occurs A001564(n) times.

Crossrefs

Programs

  • Scheme
    (define (A258198 n) (let loop ((k 1) (f 1)) (if (> (* k f) n) (- k 1) (loop (+ k 1) (* (+ k 1) f)))))
Showing 1-10 of 13 results. Next