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

A060130 Number of nonzero digits in factorial base representation (A007623) of n; minimum number of transpositions needed to compose each permutation in the lists A060117 & A060118.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Mar 02 2001

Keywords

Examples

			19 = 3*(3!) + 0*(2!) + 1*(1!), thus it is written as "301" in factorial base (A007623). The count of nonzero digits in that representation is 2, so a(19) = 2.
		

Crossrefs

Cf. A227130 (positions of even terms), A227132 (of odd terms).
The topmost row and the leftmost column in array A230415, the left edge of triangle A230417.
Differs from similar A267263 for the first time at n=30.

Programs

  • Maple
    A060130(n) = count_nonfixed(convert(PermUnrank3R(n), 'disjcyc'))-nops(convert(PermUnrank3R(n), 'disjcyc')) or nops(fac_base(n))-nops(positions(0, fac_base(n)))
    fac_base := n -> fac_base_aux(n, 2); fac_base_aux := proc(n, i) if(0 = n) then RETURN([]); else RETURN([op(fac_base_aux(floor(n/i), i+1)), (n mod i)]); fi; end;
    count_nonfixed := l -> convert(map(nops, l), `+`);
    positions := proc(e, ll) local a, k, l, m; l := ll; m := 1; a := []; while(member(e, l[m..nops(l)], 'k')) do a := [op(a), (k+m-1)]; m := k+m; od; RETURN(a); end;
    # For procedure PermUnrank3R see A060117
  • Mathematica
    Block[{nn = 105, r}, r = MixedRadix[Reverse@ Range[2, -1 + SelectFirst[Range@ 12, #! > nn &]]]; Array[Count[IntegerDigits[#, r], k_ /; k > 0] &, nn, 0]] (* Michael De Vlieger, Dec 30 2017 *)
  • Scheme
    (define (A060130 n) (let loop ((n n) (i 2) (s 0)) (cond ((zero? n) s) (else (loop (quotient n i) (+ 1 i) (+ s (if (zero? (remainder n i)) 0 1)))))))
    ;; Two other implementations, that use memoization-macro definec:
    (definec (A060130 n) (if (zero? n) n (+ 1 (A060130 (A257687 n)))))
    (definec (A060130 n) (if (zero? n) n (+ (A257511 n) (A060130 (A257684 n)))))
    ;; Antti Karttunen, Dec 30 2017

Formula

a(0) = 0; for n > 0, a(n) = 1 + a(A257687(n)).
a(0) = 0; for n > 0, a(n) = A257511(n) + a(A257684(n)).
a(n) = A060129(n) - A060128(n).
a(n) = A084558(n) - A257510(n).
a(n) = A275946(n) + A275962(n).
a(n) = A275948(n) + A275964(n).
a(n) = A055091(A060119(n)).
a(n) = A069010(A277012(n)) = A000120(A275727(n)).
a(n) = A001221(A275733(n)) = A001222(A275733(n)).
a(n) = A001222(A275734(n)) = A001222(A275735(n)) = A001221(A276076(n)).
a(n) = A046660(A275725(n)).
a(A225901(n)) = a(n).
A257511(n) <= a(n) <= A034968(n).
A275806(n) <= a(n).
a(A275804(n)) = A060502(A275804(n)). [A275804 gives all the positions where this coincides with A060502.]
a(A276091(n)) = A260736(A276091(n)). [A276091 gives all the positions where this coincides with A260736.]

Extensions

Example-section added, name edited, the old Maple-code moved away from the formula-section, and replaced with all the new formulas by Antti Karttunen, Dec 30 2017

A055881 a(n) = largest m such that m! divides n.

Original entry on oeis.org

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

Views

Author

Leroy Quet and Labos Elemer, Jul 16 2000

Keywords

Comments

Number of factorial divisors of n. - Amarnath Murthy, Oct 19 2002
The sequence may be constructed as follows. Step 1: start with 1, concatenate and add +1 to last term gives: 1,2. Step 2: 2 is the last term so concatenate twice those terms and add +1 to last term gives: 1, 2, 1, 2, 1, 3 we get 6 terms. Step 3: 3 is the last term, concatenate 3 times those 6 terms and add +1 to last term gives: 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 4, iterates. At k-th step we obtain (k+1)! terms. - Benoit Cloitre, Mar 11 2003
From Benoit Cloitre, Aug 17 2007, edited by M. F. Hasler, Jun 28 2016: (Start)
Another way to construct the sequence: start from an infinite series of 1's:
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ... Replace every second 1 by a 2 giving:
1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, ... Replace every third 2 by a 3 giving:
1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, ... Replace every fourth 3 by a 4 etc. (End)
This sequence is the fixed point, starting with 1, of the morphism m, where m(1) = 1, 2, and for k > 1, m(k) is the concatenation of m(k - 1), the sequence up to the first k, and k + 1. Thus m(2) = 1, 2, 1, 3; m(3) = 1, 2, 1, 3, 1, 2, 1, 2, 1, 4; m(4) = 1, 2, 1, 3, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 5, etc. - Franklin T. Adams-Watters, Jun 10 2009
All permutations of n elements can be listed as follows: Start with the (arbitrary) permutation P(0), and to obtain P(n + 1), reverse the first a(n) + 1 elements in P(n). The last permutation is the reversal of the first, so the path is a cycle in the underlying graph. See example and fxtbook link. - Joerg Arndt, Jul 16 2011
Positions of rightmost change with incrementing rising factorial numbers, see example. - Joerg Arndt, Dec 15 2012
Records appear at factorials. - Robert G. Wilson v, Dec 21 2012
One more than the number of trailing zeros (A230403(n)) in the factorial base representation of n (A007623(n)). - Antti Karttunen, Nov 18 2013
A062356(n) and a(n) coincide quite often. - R. J. Cano, Aug 04 2014
For n>0 and 1<=j<=(n+1)!-1, (n+1)^2-1=A005563(n) is the number of times that a(j)=n-1. - R. J. Cano, Dec 23 2016

Examples

			a(12) = 3 because 3! is highest factorial to divide 12.
From _Joerg Arndt_, Jul 16 2011: (Start)
All permutations of 4 elements via prefix reversals:
   n:   permutation  a(n)+1
   0:   [ 0 1 2 3 ]  -
   1:   [ 1 0 2 3 ]  2
   2:   [ 2 0 1 3 ]  3
   3:   [ 0 2 1 3 ]  2
   4:   [ 1 2 0 3 ]  3
   5:   [ 2 1 0 3 ]  2
   6:   [ 3 0 1 2 ]  4
   7:   [ 0 3 1 2 ]  2
   8:   [ 1 3 0 2 ]  3
   9:   [ 3 1 0 2 ]  2
  10:   [ 0 1 3 2 ]  3
  11:   [ 1 0 3 2 ]  2
  12:   [ 2 3 0 1 ]  4
  13:   [ 3 2 0 1 ]  2
  14:   [ 0 2 3 1 ]  3
  15:   [ 2 0 3 1 ]  2
  16:   [ 3 0 2 1 ]  3
  17:   [ 0 3 2 1 ]  2
  18:   [ 1 2 3 0 ]  4
  19:   [ 2 1 3 0 ]  2
  20:   [ 3 1 2 0 ]  3
  21:   [ 1 3 2 0 ]  2
  22:   [ 2 3 1 0 ]  3
  23:   [ 3 2 1 0 ]  2
(End)
From _Joerg Arndt_, Dec 15 2012: (Start)
The first few rising factorial numbers (dots for zeros) with 4 digits and the positions of the rightmost change with incrementing are:
  [ 0]    [ . . . . ]   -
  [ 1]    [ 1 . . . ]   1
  [ 2]    [ . 1 . . ]   2
  [ 3]    [ 1 1 . . ]   1
  [ 4]    [ . 2 . . ]   2
  [ 5]    [ 1 2 . . ]   1
  [ 6]    [ . . 1 . ]   3
  [ 7]    [ 1 . 1 . ]   1
  [ 8]    [ . 1 1 . ]   2
  [ 9]    [ 1 1 1 . ]   1
  [10]    [ . 2 1 . ]   2
  [11]    [ 1 2 1 . ]   1
  [12]    [ . . 2 . ]   3
  [13]    [ 1 . 2 . ]   1
  [14]    [ . 1 2 . ]   2
  [15]    [ 1 1 2 . ]   1
  [16]    [ . 2 2 . ]   2
  [17]    [ 1 2 2 . ]   1
  [18]    [ . . 3 . ]   3
  [19]    [ 1 . 3 . ]   1
  [20]    [ . 1 3 . ]   2
  [21]    [ 1 1 3 . ]   1
  [22]    [ . 2 3 . ]   2
  [23]    [ 1 2 3 . ]   1
  [24]    [ . . . 1 ]   4
  [25]    [ 1 . . 1 ]   1
  [26]    [ . 1 . 1 ]   2
(End)
		

Crossrefs

This sequence occurs also in the next to middle diagonals of A230415 and as the second rightmost column of triangle A230417.
Other sequences related to factorial base representation (A007623): A034968, A084558, A099563, A060130, A227130, A227132, A227148, A227149, A153880.
Analogous sequence for binary (base-2) representation: A001511.

Programs

  • Mathematica
    Table[Length[Intersection[Divisors[n], Range[5]!]], {n, 125}] (* Alonso del Arte, Dec 10 2012 *)
    f[n_] := Block[{m = 1}, While[Mod[n, m!] == 0, m++]; m - 1]; Array[f, 105] (* Robert G. Wilson v, Dec 21 2012 *)
  • PARI
    See Cano link.
    
  • PARI
    n=5; f=n!; x='x+O('x^f); Vec(sum(k=1,n,x^(k!)/(1-x^(k!)))) \\ Joerg Arndt, Jan 28 2014
    
  • PARI
    a(n)=for(k=2,n+1,if(n%k, return(k-1),n/=k)) \\ Charles R Greathouse IV, May 28 2015
  • Scheme
    (define (A055881 n) (let loop ((n n) (i 2)) (cond ((not (zero? (modulo n i))) (- i 1)) (else (loop (/ n i) (+ 1 i))))))
    

Formula

G.f.: Sum_{k > 0} x^(k!)/(1 - x^(k!)). - Vladeta Jovovic, Dec 13 2002
a(n) = A230403(n)+1. - Antti Karttunen, Nov 18 2013
a(n) = A230415(n-1,n) = A230415(n,n-1) = A230417(n,n-1). - Antti Karttunen, Nov 19 2013
a(m!+n) = a(n) if 1 <= n <= m*m! - 1 = A001563(m) - 1. - R. J. Cano, Jun 27 2016
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = e - 1 (A091131). - Amiram Eldar, Jul 23 2022

A230415 Square array T(i,j) giving the number of differing digits in the factorial base representations of i and j, for i >= 0, j >= 0, read by antidiagonals.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Nov 10 2013

Keywords

Comments

This table relates to the factorial base representation (A007623) in a somewhat similar way as A101080 relates to the binary system. See A231713 for another analog.

Examples

			The top left corner of this square array begins as:
0, 1, 1, 2, 1, 2, 1, 2, 2, 3, 2, ...
1, 0, 2, 1, 2, 1, 2, 1, 3, 2, 3, ...
1, 2, 0, 1, 1, 2, 2, 3, 1, 2, 2, ...
2, 1, 1, 0, 2, 1, 3, 2, 2, 1, 3, ...
1, 2, 1, 2, 0, 1, 2, 3, 2, 3, 1, ...
2, 1, 2, 1, 1, 0, 3, 2, 3, 2, 2, ...
1, 2, 2, 3, 2, 3, 0, 1, 1, 2, 1, ...
2, 1, 3, 2, 3, 2, 1, 0, 2, 1, 2, ...
2, 3, 1, 2, 2, 3, 1, 2, 0, 1, 1, ...
3, 2, 2, 1, 3, 2, 2, 1, 1, 0, 2, ...
2, 3, 2, 3, 1, 2, 1, 2, 1, 2, 0, ...
...
For example, T(1,2) = T(2,1) = 2 as 1 has factorial base representation '...0001' and 2 has factorial base representation '...0010', and they differ by their two least significant digits.
On the other hand, T(3,5) = T(5,3) = 1, as 3 has factorial base representation '...0011' and 5 has factorial base representation '...0021', and they differ only by their second rightmost digit.
Note that as A007623(6)='100' and A007623(10)='120', we have T(6,10) = T(10,6) = 1 (instead of 2 as in A231713, cf. also its Example section), as here we count only the number of differing digit positions, but ignore the magnitudes of their differences.
		

Crossrefs

The topmost row and the leftmost column: A060130.
Only the lower triangular region: A230417. Related arrays: A230419, A231713. Cf. also A101080, A084558, A230410.

Programs

  • Mathematica
    nn = 14; m = 1; While[m! < nn, m++]; m; Table[Function[w, Count[Subtract @@ Map[PadLeft[#, Max@ Map[Length, w]] &, w], k_ /; k != 0]]@ Map[IntegerDigits[#, MixedRadix[Reverse@ Range[2, m]]] &, {i - j, j}], {i, 0, nn}, {j, 0, i}] // Flatten (* Michael De Vlieger, Jun 27 2016, Version 10.2 *)
  • Scheme
    (define (A230415 n) (A230415bi (A025581 n) (A002262 n)))
    (define (A230415bi x y) (let loop ((x x) (y y) (i 2) (d 0)) (cond ((and (zero? x) (zero? y)) d) (else (loop (floor->exact (/ x i)) (floor->exact (/ y i)) (+ i 1) (+ d (if (= (modulo x i) (modulo y i)) 0 1)))))))

Formula

T(n,0) = T(0,n) = A060130(n).
Each entry T(i,j) <= A231713(i,j).

A231714 Lower triangular region of A231713; A triangular table read by rows: T(n,k) = sum of absolute values of digit differences in the factorial base representations (A007623) of n and k, where (n, k) = (0,0), (1,0), (1,1), (2,0), (2,1), (2,2), ..., n >= 0 and (0 <= k <= n).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Nov 12 2013

Keywords

Examples

			This triangular table begins as:
  0;
  1, 0;
  1, 2, 0;
  2, 1, 1, 0;
  2, 3, 1, 2, 0;
  3, 2, 2, 1, 1, 0;
  1, 2, 2, 3, 3, 4, 0;
  2, 1, 3, 2, 4, 3, 1, 0;
  ...
Please see A231713 for examples how the terms are computed.
		

Crossrefs

The leftmost column: A034968.
This is a lower, or equivalently, an upper triangular subregion of symmetric square array A231713. Cf. A230417.

Programs

  • Scheme
    (define (A231714 n) (A231713bi (A003056 n) (A002262 n)))
    (define (A231713bi x y) (let loop ((x x) (y y) (i 2) (d 0)) (cond ((and (zero? x) (zero? y)) d) (else (loop (floor->exact (/ x i)) (floor->exact (/ y i)) (+ i 1) (+ d (abs (- (modulo x i) (modulo y i)))))))))

Formula

a(n) = A231713(A003056(n),A002262(n)). [As a sequence, this is obtained by taking a subsection from array A231713.]
T(n,0) = A034968(n). [The leftmost column]
Each entry T(n,k) >= A230417(n,k).
Showing 1-4 of 4 results.