Original entry on oeis.org
0, 1, 2, 2, 2, 2, 2, 2, 1, 3, 2, 2, 2, 2, 1, 3, 1, 3, 1, 3, 3, 3, 1, 3, 4, 2, 2, 2, 4, 2, 2, 2, 2, 1, 3, 1, 3, 1, 3, 3, 3, 1, 3, 4, 2, 1, 3, 3, 3, 2, 4, 1, 3, 1, 3, 3, 3, 1, 3, 4, 2, 1, 2, 2, 2, 2, 3, 2, 2, 4, 3, 1, 3, 4, 2, 1, 2, 2, 2, 2, 3, 2, 1, 3, 2, 5, 2
Offset: 0
a(8) = 1, because A219666(8)=23, whose factorial base representation (A007623(23)) is '321', and A219666(7)=17, whose factorial base representation (A007623(17)) is '221', and they differ just in one digit position.
a(9) = 3, because A219666(9)=25, '...01001' in factorial base, which differs from '...0321' in three digit positions.
Note that A226061(4)=8 (A226061(n) tells the position of (n!)-1 in A219666), and 1+2+3 = 6 happens to be both a triangular number (A000217) and a factorial number (A000142).
The next time 1 occurs in this sequence because of this coincidence is at x=A226061(16) (whose value is currently not known), as at that point A219666(x) = 16!-1 = 20922789887999, whose factorial base representation is (15,14,13,12,11,10,9,8,7,6,5,4,3,2,1), and A000217(15) = 120 = A000142(5), which means that A219666(x-1) = A219651(20922789887999) = 20922789887879, whose factorial base representation is (15,14,13,12,11,10,9,8,7,6,4,4,3,2,1), which differs only in one position from the previous.
Of course 1's occur in this sequence for other reasons as well.
-
nn = 1200; m = 1; While[m! < nn, m++]; m; f[n_] := IntegerDigits[n, MixedRadix[Reverse@ Range[2, m]]]; Join[{0}, Function[w, Count[Subtract @@ Map[PadLeft[#, Max@ Map[Length, w]] &, w], k_ /; k != 0]]@ Map[f@ # &, {#1, #2}] & @@@ Partition[#, 2, 1] &@ TakeWhile[Reverse@ NestWhileList[# - Total@ f@ # &, nn, # > 0 &], # <= 500 &]] (* Michael De Vlieger, Jun 27 2016, Version 10 *)
-
(define (A230410 n) (if (zero? n) n (A230415bi (A219666 n) (A219666 (- n 1))))) ;; Where bi-variate function A230415bi has been given in A230415.
A230417
Lower triangular region of A230415, a triangular table read by rows: T(n, k) tells in how many digit positions the factorial base representations (A007623) of n and k differ, 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, 1, 2, 1, 2, 0, 2, 1, 2, 1, 1, 0, 1, 2, 2, 3, 2, 3, 0, 2, 1, 3, 2, 3, 2, 1, 0, 2, 3, 1, 2, 2, 3, 1, 2, 0, 3, 2, 2, 1, 3, 2, 2, 1, 1, 0, 2, 3, 2, 3, 1, 2, 1, 2, 1, 2, 0, 3, 2, 3, 2, 2, 1, 2, 1, 2, 1, 1, 0, 1, 2, 2, 3, 2, 3, 1, 2, 2, 3, 2, 3, 0, 2, 1, 3, 2, 3, 2, 2, 1, 3, 2, 3, 2, 1, 0, 2, 3, 1, 2, 2, 3, 2, 3, 1, 2, 2, 3, 1, 2, 0
Offset: 0
This triangular table begins:
0;
1, 0;
1, 2, 0;
2, 1, 1, 0;
1, 2, 1, 2, 0;
2, 1, 2, 1, 1, 0;
1, 2, 2, 3, 2, 3, 0;
...
Please see A230415 for examples showing how the terms are computed.
This is a lower, or equivalently, an upper triangular subregion of symmetric square array
A230415.
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
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.
Cf.
A007623,
A034968,
A055091,
A060117,
A060118,
A060128,
A060129,
A060131,
A060502,
A257687,
A275734,
A275735,
A276076.
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.
-
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
-
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 *)
-
(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
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
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)
Cf.
A055874,
A055926,
A055770,
A062356,
A073575,
A091131,
A230403,
A230404,
A230405,
A076733,
A232096,
A232098,
A233285,
A233267,
A233269,
A231719,
A232741,
A232742,
A232743,
A232744,
A232745,
A060832 (partial sums).
This sequence occurs also in the next to middle diagonals of
A230415 and as the second rightmost column of triangle
A230417.
Analogous sequence for binary (base-2) representation:
A001511.
-
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 *)
-
See Cano link.
-
n=5; f=n!; x='x+O('x^f); Vec(sum(k=1,n,x^(k!)/(1-x^(k!)))) \\ Joerg Arndt, Jan 28 2014
-
a(n)=for(k=2,n+1,if(n%k, return(k-1),n/=k)) \\ Charles R Greathouse IV, May 28 2015
-
(define (A055881 n) (let loop ((n n) (i 2)) (cond ((not (zero? (modulo n i))) (- i 1)) (else (loop (/ n i) (+ 1 i))))))
A231713
Square array A(i,j) = the sum of absolute values of digit differences in the matching positions of 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, 2, 1, 0, 1, 2, 3, 3, 1, 1, 3, 3, 1, 2, 1, 0, 1, 2, 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, 3, 2, 1, 2, 3, 0, 3, 2, 1, 2, 3, 4, 4, 2, 2, 4, 4, 4, 4, 2, 2, 4, 4, 2, 3, 2, 1, 2, 3, 0, 3, 2, 1, 2, 3, 2, 3, 3, 3, 3, 3, 3, 1, 1, 3, 3, 3, 3, 3, 3, 3, 2, 3, 2, 1, 2, 1, 0, 1, 2, 1, 2, 3, 2, 3
Offset: 0
The top left corner of this square array begins as:
0, 1, 1, 2, 2, 3, 1, 2, 2, 3, 3, ...
1, 0, 2, 1, 3, 2, 2, 1, 3, 2, 4, ...
1, 2, 0, 1, 1, 2, 2, 3, 1, 2, 2, ...
2, 1, 1, 0, 2, 1, 3, 2, 2, 1, 3, ...
2, 3, 1, 2, 0, 1, 3, 4, 2, 3, 1, ...
3, 2, 2, 1, 1, 0, 4, 3, 3, 2, 2, ...
1, 2, 2, 3, 3, 4, 0, 1, 1, 2, 2, ...
2, 1, 3, 2, 4, 3, 1, 0, 2, 1, 3, ...
2, 3, 1, 2, 2, 3, 1, 2, 0, 1, 1, ...
3, 2, 2, 1, 3, 2, 2, 1, 1, 0, 2, ...
3, 4, 2, 3, 1, 2, 2, 3, 1, 2, 0, ...
...
For example, A(1,2) = A(2,1) = 2 as 1 has factorial base representation '...0001' and 2 has factorial base representation '...0010', and adding the absolute values of the digit differences, we get 1+1 = 2.
On the other hand, A(3,5) = A(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, the absolute value of difference being 1.
Note that as A007623(6)='100' and A007623(10)='120', we have A(6,10) = A(10,6) = 2.
The topmost row and the leftmost column:
A034968.
A230419
Square array A(n,k) = difference of digit sums in factorial base representations (A007623) of n and k, n>=0, k>=0, read by antidiagonals; A(n,k) = A034968(n)-A034968(k).
Original entry on oeis.org
0, 1, -1, 1, 0, -1, 2, 0, 0, -2, 2, 1, 0, -1, -2, 3, 1, 1, -1, -1, -3, 1, 2, 1, 0, -1, -2, -1, 2, 0, 2, 0, 0, -2, 0, -2, 2, 1, 0, 1, 0, -1, 0, -1, -2, 3, 1, 1, -1, 1, -1, 1, -1, -1, -3, 3, 2, 1, 0, -1, 0, 1, 0, -1, -2, -3, 4, 2, 2, 0, 0, -2, 2, 0, 0, -2, -2, -4
Offset: 0
The top left corner array is:
0, 1, 1, 2, 2, 3, 1, 2, 2, 3, 3, ...
-1, 0, 0, 1, 1, 2, 0, 1, 1, 2, 2, ...
-1, 0, 0, 1, 1, 2, 0, 1, 1, 2, 2, ...
-2, -1, -1, 0, 0, 1, -1, 0, 0, 1, 1, ...
-2, -1, -1, 0, 0, 1, -1, 0, 0, 1, 1, ...
-3, -2, -2, -1, -1, 0, -2, -1, -1, 0, 0, ...
-1, 0, 0, 1, 1, 2, 0, 1, 1, 2, 2, ...
-2, -1, -1, 0, 0, 1, -1, 0, 0, 1, 1, ...
-2, -1, -1, 0, 0, 1, -1, 0, 0, 1, 1, ...
-3, -2, -2, -1, -1, 0, -2, -1, -1, 0, 0, ...
-3, -2, -2, -1, -1, 0, -2, -1, -1, 0, 0, ...
...
The topmost row:
A034968 (and also the leftmost column negated).
Cf.
A230415 (similar array which gives the number of differing digits).
Cf.
A231713 (similar array which gives the sum of absolute differences).
Showing 1-6 of 6 results.
Comments