Displaying 1-7 of 7 results found.
page
1
a(0) = 0; for n >= 1: a(n) = largest m such that n >= m!.
+10
60
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
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
REFERENCES
F. Smarandache, "f-Inferior and f-Superior Functions - Generalization of Floor Functions", Arizona State University, Special Collections.
FORMULA
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:
EXAMPLE
a(4) = 2 because 2! <= 4 < 3!.
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 *)
PROG
(Haskell)
(PARI) a(n)={my(m=0); while(n\=m++, ); m-1} \\ R. J. Cano, Apr 09 2018
(Python)
i=1
while n: i+=1; n//=i
return(i-1)
CROSSREFS
Cf. A000142, A001563, A055089, A060130, A111095, A211664, A211670, A108731, A212598, A220656, A220657, A220658, A220659, A231716, A235224, A257510.
Write n in factorial base, then replace each nonzero digit d of radix k with k-d.
+10
59
0, 1, 4, 5, 2, 3, 18, 19, 22, 23, 20, 21, 12, 13, 16, 17, 14, 15, 6, 7, 10, 11, 8, 9, 96, 97, 100, 101, 98, 99, 114, 115, 118, 119, 116, 117, 108, 109, 112, 113, 110, 111, 102, 103, 106, 107, 104, 105, 72, 73, 76, 77, 74, 75, 90, 91, 94, 95, 92, 93, 84, 85, 88, 89, 86, 87, 78, 79, 82, 83, 80, 81, 48, 49, 52, 53, 50, 51, 66, 67, 70, 71, 68
COMMENTS
A self-inverse permutation of the natural numbers.
Consider the following way to view a factorial base representation of nonnegative integer n. For each nonzero digit d_i present in the factorial base representation of n (where i is the radix = 2.. = one more than 1-based position from the right), we place a pebble to the level (height) d_i at the corresponding column i of the triangular diagram like below, while for any zeros the corresponding columns are left empty:
.
Level
6 o
─ ─
5 . .
─ ─ ─
4 . . .
─ ─ ─ ─
3 . . . .
─ ─ ─ ─ ─
2 . . o . .
─ ─ ─ ─ ─ ─
1 . o . . o o
─ ─ ─ ─ ─ ─ ─
Radix: 7 6 5 4 3 2
Digits: 6 1 2 0 1 1 = A007623(4491)
Instead of levels, we can observe on which "slope" each pebble (nonzero digit) is located at. Formally, the slope of nonzero digit d_i with radix i is (i - d_i). Thus in above example, both the most significant digit (6) and the least significant 1 are on slope 1 (called "maximal slope", because it contains digits that are maximal allowed in those positions), while the second 1 from the right is on slope 2 ("submaximal slope").
This involution ( A225901) sends each nonzero digit at level k to the slope k (and vice versa) by flipping such a diagram by the shallow diagonal axis that originates from the bottom right corner. Thus, from above diagram we obtain:
Slope (= digit's radix - digit's value)
1
2 .
3 . .╲
4 . .╲o╲
5 . .╲.╲.╲
6 . .╲.╲o╲.╲
. .╲.╲.╲.╲o╲
o╲.╲.╲.╲.╲o╲
-----------------
and indeed, a(4491) = 1397 and a(1397) = 4491.
Thus this permutation maps between polynomial encodings A275734 & A275735 and all the respective sequences obtained from them, where the former set of sequences are concerned with the "slopes" and the latter set with the "levels" of the factorial base representation. See the Crossrefs section.
(End)
FORMULA
(End)
Other identities. For n >= 0:
A060130(a(n)) = A060130(n). [The flip preserves the number of nonzero digits.]
A153880(n) = a( A255411(a(n))) and A255411(n) = a( A153880(a(n))). [This involution conjugates between the two fundamental factorial base shifts.]
(End)
EXAMPLE
a(1000) = a(1*6! + 2*5! + 1*4! + 2*3! + 2*2!) = (7-1)*6! + (6-2)*5! + (5-1)*4! + (4-2)*3! + (3-2)*2! = 4910.
a(1397) = a(1*6! + 5*5! + 3*4! + 0*3! + 2*2! + 1*1!) = (7-1)*6! + (6-5)*5! + (5-3)*4! + (3-2)*2! + (2-1)*1! = 4491.
MATHEMATICA
b = MixedRadix[Reverse@ Range[2, 12]]; Table[FromDigits[Map[Boole[# > 0] &, #] (Reverse@ Range[2, Length@ # + 1] - #), b] &@ IntegerDigits[n, b], {n, 0, 82}] (* Version 10.2, or *)
f[n_] := Block[{a = {{0, n}}}, Do[AppendTo[a, {First@ #, Last@ #} &@ QuotientRemainder[a[[-1, -1]], Times @@ Range[# - i]]], {i, 0, #}] &@ NestWhile[# + 1 &, 0, Times @@ Range[# + 1] <= n &]; Most@ Rest[a][[All, 1]] /. {} -> {0}]; g[w_List] := Total[Times @@@ Transpose@ {Map[Times @@ # &, Range@ Range[0, Length@ w]], Reverse@ Append[w, 0]}]; Table[g[Map[Boole[# > 0] &, #] (Reverse@ Range[2, Length@ # + 1] - #)] &@ f@ n, {n, 0, 82}] (* Michael De Vlieger, Aug 29 2016 *)
PROG
(PARI) a(n)=my(s=0, d, k=2); while(n, d=n%k; n=n\k; if(d, s=s+(k-d)*(k-1)!); k=k+1); return(s)
(Scheme)
(define ( A225901 n) (let loop ((n n) (z 0) (m 2) (f 1)) (cond ((zero? n) z) (else (loop (quotient n m) (if (zero? (modulo n m)) z (+ z (* f (- m (modulo n m))))) (+ 1 m) (* f m))))))
;; One implementing the first recurrence, with memoization-macro definec:
(Python)
from sympy import factorial as f
def a(n):
s=0
k=2
while(n):
d=n%k
n=(n//k)
if d: s=s+(k - d)*f(k - 1)
k+=1
return s
CROSSREFS
Cf. A000142, A007623, A004488, A048647, A001563, A007489, A257684, A257687, A276091, A275736, A276149.
Numbers k whose factorial base representation A007623(k) does not contain any nonleading zeros.
+10
15
1, 3, 5, 9, 11, 15, 17, 21, 23, 33, 35, 39, 41, 45, 47, 57, 59, 63, 65, 69, 71, 81, 83, 87, 89, 93, 95, 105, 107, 111, 113, 117, 119, 153, 155, 159, 161, 165, 167, 177, 179, 183, 185, 189, 191, 201, 203, 207, 209, 213, 215, 225, 227, 231, 233, 237, 239, 273
COMMENTS
a( A007489(n)) = (n+1)!-1 thus A007489(n) gives the number of terms less than (n+1)! in this sequence.
Equivalently, there are n! terms in the sequence with their magnitude in range n!..(n+1)!.
MATHEMATICA
q[n_] := Module[{k = n, m = 2, c = 0, r}, While[{k, r} = QuotientRemainder[k, m]; k != 0 || r != 0, If[r == 0, c++]; m++]; c == 0]; Select[Range[300], q] (* Amiram Eldar, Jan 23 2024 *)
In primorial base: a(n) is obtained by replacing each nonzero digit of n with its inverse (see Comments for precise definition).
+10
12
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 18, 19, 20, 21, 22, 23, 12, 13, 14, 15, 16, 17, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 48, 49, 50, 51, 52, 53, 42, 43, 44, 45, 46, 47, 54, 55, 56, 57, 58, 59, 120, 121, 122, 123, 124, 125
COMMENTS
For a number n >= 0, let d_k, ..., d_0 be the digits of n in primorial base (n = Sum_{i=0..k} d_i * A002110(i), and for i=0..k, 0 <= d_i < prime(i+1)); the digits of a(n) in primorial base, say e_k, ..., e_0, satisfy: for i=0..k:
- if d_i = 0, then e_i = 0,
- if d_i > 0, then e_i is the inverse of d_i mod prime(i+1) (in other words, 1 <= e_i < prime(i+1) and e_i * d_i = 1 mod prime(i+1)).
This sequence is a self-inverse permutation of the nonnegative numbers.
a(n) = n iff the digits of n in primorial base, say d_k, ..., d_0, satisfy: for i=0..k: d_i = 0, 1 or prime(i+1)-1.
For k > 0: the plotting of the first A002110(k) terms can be obtained by arranging prime(k) copies of the plotting of the first A002110(k-1) terms in a prime(k) X prime(k) grid:
- one copy in the cell at position (0,0),
- one copy in any cell at position (i,j) with i*j = 1 mod prime(k) (with 0 < i < prime(k) and 0 < j < prime(k)).
EXAMPLE
The digits of 7772 in primorial base are 3,4,0,0,1,0.
Also:
- 9 * 3 = 27 = 1 mod prime(6) = 13,
- 3 * 4 = 12 = 1 mod prime(5) = 11,
- 1 * 1 = 1 mod prime(2) = 3.
Hence, the digits of a(7772) in primorial base are 9,3,0,0,1,0,
and a(7772) = 9 * 11# + 3 * 7# + 1 * 2# = 21422.
PROG
(PARI) a(n) = my (pr=1, p=2, v=0); while (n>0, my (d=n%p); if (d>0, v += pr * lift(1/Mod(d, p))); pr *= p; n \= p; p = next prime(p+1)); return (v)
1, 2, 4, 8, 24, 56, 248, 1016, 5624, 24056, 208376, 945656, 9793016, 62877176, 487550456, 3884936696, 58243116536, 384392195576, 6255075618296, 53220543000056, 616806151581176, 6252662237392376, 130241496125238776, 1122152167228009976, 20960365589283433976
COMMENTS
a(n) gives the index to the first term in each subrange of A231716. Specifically, for all n>=1, A231716(a(n)) = A007489(n).
FORMULA
a(n) = 1 if n=1, otherwise A001088(n)+a(n-1).
a(n) = A231722(n)+1. [Follows from the definitions]
MATHEMATICA
Accumulate[FoldList[Times, EulerPhi[Range[30]]]] (* Harvey P. Dale, Apr 02 2018 *)
PROG
(Scheme, with memoizing macro definec from Antti Karttunen's IntSeq-library)
0, 1, 3, 7, 23, 55, 247, 1015, 5623, 24055, 208375, 945655, 9793015, 62877175, 487550455, 3884936695, 58243116535, 384392195575, 6255075618295, 53220543000055, 616806151581175, 6252662237392375, 130241496125238775, 1122152167228009975, 20960365589283433975
COMMENTS
a(n+1) gives the index to the last term in each row of A231716. Specifically, for all n>=1, A231716(a(n+1)) = A033312(n+1).
a(n) = natural number which is written as the n-th repunit in "totient phi number system": 0, 1, 10, 11, 100, 101, 110, 111, 200, 201, 210, 211, 300, 301, 310, 311, 1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111, 1200, ..., and so on. Note how the 1st, the 3rd, the 7th and 23rd terms of this list are 1, 11, 111, and 1111.
In this number system the i-th digit from right (the least significant digit = digit_0) may contain integers in range 0.. A000010(i+3)-1, and the value of the number is obtained as sum_{i=0..} digit_i * A001088(i+2).
FORMULA
a(n) = A231721(n)-1. [The terms are one less than the partial sums of "phitorials", A001088, cumulatively summed from their first term]
MATHEMATICA
Table[Sum[Product[EulerPhi[k], {k, i}], {i, 2, n}], {n, 20}] (* Wesley Ivan Hurt, Aug 09 2014 *)
PROG
(Scheme)
(PARI) a(n) = sum(i=2, n, prod(k=1, i, eulerphi(k))); \\ Michel Marcus, Aug 09 2014
For n with a unique factorial base representation n = du*u! + ... + d2*2! + d1*1! (each di in range 0..i, cf. A007623), a(n) = Product_{i=1..u} (gcd(d_i,i+1) mod i+1), where u is given by A084558(n).
+10
2
1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 2, 0, 2, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 2, 0, 2, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 2, 0, 2, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 2
EXAMPLE
For n=13, with factorial base representation '201' (= A007623(13), 2*3! + 0*2! + 1*1! = 13) we have, starting from the least significant digit, (gcd(1,2) mod 2)*(gcd(0,3) mod 3)*(gcd(2,4) mod 4) = (1 mod 2)*(3 mod 3)*(2 mod 4) = 1*0*2 = 0, thus a(13)=0.
For n=17, with factorial base representation '221' (= A007623(17), 2*3! + 2*2! + 1*1! = 17) we have, starting from the least significant digit, (gcd(1,2) mod 2)*(gcd(2,3) mod 3)*(gcd(2,4) mod 4) = (1 mod 2)*(1 mod 3)*(2 mod 4) = 1*1*2 = 2, thus a(17)=2.
PROG
(Scheme)
(define ( A231715 n) (let loop ((n n) (i 2) (p 1)) (cond ((zero? n) p) (else (loop (floor->exact (/ n i)) (+ i 1) (* p (modulo (gcd (modulo n i) i) i)))))))
Search completed in 0.011 seconds
|