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

A249070 a(n+1) gives the number of occurrences of the maximum digit of a(n) in factorial base (i.e., A246359(a(n))) so far amongst the factorial base representations of all the terms up to and including a(n), with a(0)=0.

Original entry on oeis.org

0, 1, 1, 2, 3, 5, 1, 7, 9, 12, 2, 13, 3, 16, 5, 6, 18, 1, 19, 2, 21, 3, 25, 27, 30, 32, 35, 7, 40, 9, 44, 4, 10, 11, 12, 13, 14, 15, 16, 18, 5, 19, 6, 56, 20, 7, 61, 22, 8, 64, 26, 66, 9, 69, 10, 29, 30, 76, 11, 32, 81, 12, 33, 88, 13, 36, 37, 38, 39, 40, 42, 14, 43, 15, 44, 16, 46, 17, 49, 50, 51, 52
Offset: 0

Views

Author

Antti Karttunen, Oct 20 2014

Keywords

Examples

			   a(0) =  0 (by definition)
   a(1) =  1 ('1' in factorial base), as 0 has occurred once in all the preceding terms.
   a(2) =  1 as 1 has occurred once in all the preceding terms.
   a(3) =  2 ('10' in factorial base), as digit '1' has occurred two times in total in all the preceding terms.
   a(4) =  3 ('11' in factorial base), as '1' occurs once in each a(1) and a(2) and a(3).
   a(5) =  5 ('21' in factorial base), as '1' occurs once in each of a(1), a(2) and a(3) and twice at a(4).
   a(6) =  1 ('1' in factorial base), as '2' so far occurs only once at a(5)
   a(7) =  7 = '101'
   a(8) =  9 = '111'
   a(9) = 12 = '200'
  a(10) =  2 = '2'
  a(11) = 13 = '201'
  a(12) =  3 = '11'
  a(12) =  3 = '11'
  a(13) = 16 = '220'
  a(14) =  5 = '21'
  a(15) =  6 = '100'
  a(16) = 18 = '300'
  a(17) =  1 = '1'
  a(18) = 19 = '301'
  a(19) =  2 = '10'
  a(20) = 21 = '311'
  a(21) =  3 = '11'
  a(22) = 25 = '1001'
  a(23) = 27 = '1011'
  a(24) = 30 = '1100'
  a(25) = 32 = '1110'
  a(26) = 35 = '1121'
  a(27) =  7 (= '101' in factorial base), as the maximum digit in the factorial base representation of a(26), namely '2', has occurred in total 7 times in terms a(0) - a(26): once in each of a(5), a(9), a(11), a(14) and a(26), and twice in a(13).
		

Crossrefs

Differs from A249069 for the first time at n=27, where a(27) = 7, while A249069(27) = 38.

A276076 Factorial base exp-function: digits in factorial base representation of n become the exponents of successive prime factors whose product a(n) is.

Original entry on oeis.org

1, 2, 3, 6, 9, 18, 5, 10, 15, 30, 45, 90, 25, 50, 75, 150, 225, 450, 125, 250, 375, 750, 1125, 2250, 7, 14, 21, 42, 63, 126, 35, 70, 105, 210, 315, 630, 175, 350, 525, 1050, 1575, 3150, 875, 1750, 2625, 5250, 7875, 15750, 49, 98, 147, 294, 441, 882, 245, 490, 735, 1470, 2205, 4410, 1225, 2450, 3675, 7350, 11025, 22050, 6125, 12250, 18375, 36750, 55125, 110250, 343
Offset: 0

Views

Author

Antti Karttunen, Aug 18 2016

Keywords

Comments

These are prime-factorization representations of single-variable polynomials where the coefficient of term x^(k-1) (encoded as the exponent of prime(k) in the factorization of n) is equal to the digit in one-based position k of the factorial base representation of n. See the examples.

Examples

			   n  A007623   polynomial     encoded as             a(n)
   -------------------------------------------------------
   0       0    0-polynomial   (empty product)        = 1
   1       1    1*x^0          prime(1)^1             = 2
   2      10    1*x^1          prime(2)^1             = 3
   3      11    1*x^1 + 1*x^0  prime(2) * prime(1)    = 6
   4      20    2*x^1          prime(2)^2             = 9
   5      21    2*x^1 + 1*x^0  prime(2)^2 * prime(1)  = 18
   6     100    1*x^2          prime(3)^1             = 5
   7     101    1*x^2 + 1*x^0  prime(3) * prime(1)    = 10
and:
  23     321  3*x^2 + 2*x + 1  prime(3)^3 * prime(2)^2 * prime(1)
                                      = 5^3 * 3^2 * 2 = 2250.
		

Crossrefs

Cf. A276075 (a left inverse).
Cf. A276078 (same terms in ascending order).
Cf. also A275733, A275734, A275735, A275725 for other such encodings of factorial base related polynomials, and A276086 for a primorial base analog.

Programs

  • Mathematica
    a[n_] := Module[{k = n, m = 2, r, p = 2, q = 1}, While[{k, r} = QuotientRemainder[k, m]; k != 0|| r != 0, q *= p^r; p = NextPrime[p]; m++]; q]; Array[a, 100, 0] (* Amiram Eldar, Feb 07 2024 *)

Formula

a(0) = 1, for n >= 1, a(n) = A275733(n) * a(A276009(n)).
Or: for n >= 1, a(n) = a(A257687(n)) * A000040(A084558(n))^A099563(n).
Other identities.
For all n >= 0:
A276075(a(n)) = n.
A001221(a(n)) = A060130(n).
A001222(a(n)) = A034968(n).
A051903(a(n)) = A246359(n).
A048675(a(n)) = A276073(n).
A248663(a(n)) = A276074(n).
a(A007489(n)) = A002110(n).
a(A059590(n)) = A019565(n).
For all n >= 1:
a(A000142(n)) = A000040(n).
a(A033312(n)) = A076954(n-1).
From Antti Karttunen, Apr 18 2022: (Start)
a(n) = A276086(A351576(n)).
A276085(a(n)) = A351576(n)
A003557(a(n)) = A351577(n).
A003415(a(n)) = A351950(n).
A069359(a(n)) = A351951(n).
A083345(a(n)) = A342001(a(n)) = A351952(n).
A351945(a(n)) = A351954(n).
A181819(a(n)) = A275735(n).
(End)
lambda(a(n)) = A262725(n+1), where lambda is Liouville's function, A008836. - Antti Karttunen and Peter Munn, Aug 09 2024

Extensions

Name changed by Antti Karttunen, Apr 18 2022

A257684 Discard the rightmost digit from the factorial base representation of n and subtract one from all remaining nonzero digits, then convert back to decimal.

Original entry on oeis.org

0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 4, 4, 4, 4, 5, 5, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 4, 4, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 6, 6, 6, 6, 7, 7, 8, 8, 8, 8, 9, 9, 10, 10, 10, 10, 11, 11, 12, 12, 12, 12, 13, 13, 12, 12, 12, 12, 13, 13, 14, 14, 14, 14, 15, 15, 16, 16, 16, 16, 17, 17
Offset: 0

Views

Author

Antti Karttunen, May 04 2015

Keywords

Comments

In other words, subtract one from all nonzero digits in the factorial base representation (A007623) of n and shift it one step right (i.e., delete the rightmost zero), then convert back to decimal.

Examples

			For 4, whose factorial base representation is "20" (as 4 = 2*2! + 0*1!), when we discard the rightmost zero, and subtract 1 from 2, we get "1", thus a(4) = 1.
For 18, whose factorial base representation is "300" (as 18 = 3*3! + 0*2! + 0*1!), when we discard the rightmost zero, and subtract 1 from 3, we get "20", thus a(18) = 4.
		

Crossrefs

Positions of zeros: A059590.
Can be used to define simple recurrences for sequences like A034968, A246359, A257679, A257694, A257695 and A257696.

Programs

  • Mathematica
    nn = 95; m = 1; While[Factorial@ m < nn, m++]; m; Map[FromDigits[#, MixedRadix[Reverse@ Range[2, m]]] &[If[# == 0, 0, # - 1] & /@ Most@ IntegerDigits[#, MixedRadix[Reverse@ Range[2, m]]]] &, Range[0, nn]] (* Michael De Vlieger, Aug 11 2016, Version 10.2 *)
  • Python
    from sympy import factorial as f
    def a007623(n, p=2):
        return n if n

    0 else '0' for i in x)[::-1] return 0 if n==1 else sum(int(y[i])*f(i + 1) for i in range(len(y))) print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 19 2017

  • Scheme
    (define (A257684 n) (let loop ((n n) (z 0) (i 2) (f 0)) (cond ((zero? n) z) (else (let ((d (remainder n i))) (loop (quotient n i) (+ z (* f (- d (if (zero? d) 0 1)))) (+ 1 i) (if (zero? f) 1 (* f (- i 1)))))))))
    

Formula

For all n >= 0, a(A255411(n)) = n. [This sequence works as a left inverse of A255411. See A257685 for a "cleaned up" version.]

A099563 a(0) = 0; for n > 0, a(n) = final nonzero number in the sequence n, f(n,2), f(f(n,2),3), f(f(f(n,2),3),4),..., where f(n,d) = floor(n/d); the most significant digit in the factorial base representation of n.

Original entry on oeis.org

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

Views

Author

John W. Layman, Oct 22 2004

Keywords

Comments

Records in {a(n)} occur at {1,4,18,96,600,4320,35280,322560,3265920,...}, which appears to be n*n! = A001563(n).
The most significant digit in the factorial expansion of n (A007623). Proof: The algorithm that computes the factorial expansion of n, generates the successive digits by repeatedly dividing the previous quotient with successively larger divisors (the remainders give the digits), starting from n itself and divisor 2. As a corollary we find that A001563 indeed gives the positions of the records. - Antti Karttunen, Jan 01 2007.

Examples

			For n=15, f(15,2) = floor(15/2)=7, f(7,3)=2, f(2,4)=0, so a(15)=2.
From _Antti Karttunen_, Dec 24 2015: (Start)
Example illustrating the role of this sequence in factorial base representation:
   n  A007623(n)       a(n) [= the most significant digit].
   0 =   0               0
   1 =   1               1
   2 =  10               1
   3 =  11               1
   4 =  20               2
   5 =  21               2
   6 = 100               1
   7 = 101               1
   8 = 110               1
   9 = 111               1
  10 = 120               1
  11 = 121               1
  12 = 200               2
  13 = 201               2
  14 = 210               2
  15 = 211               2
  16 = 220               2
  17 = 221               2
  18 = 300               3
  etc.
Note that there is no any upper bound for the size of digits in this representation.
(End)
		

Crossrefs

Programs

  • Mathematica
    Table[Floor[n/#] &@ (k = 1; While[(k + 1)! <= n, k++]; k!), {n, 0, 120}] (* Michael De Vlieger, Aug 30 2016 *)
  • PARI
    A099563(n) = { my(i=2,dig=0); until(0==n, dig = n % i; n = (n - dig)/i; i++); return(dig); }; \\ Antti Karttunen, Dec 24 2015
    
  • Python
    def a(n):
        i=2
        d=0
        while n:
            d=n%i
            n=(n - d)//i
            i+=1
        return d
    print([a(n) for n in range(201)]) # Indranil Ghosh, Jun 21 2017, after PARI code
  • Scheme
    (define (A099563 n) (let loop ((n n) (i 2)) (let* ((dig (modulo n i)) (next-n (/ (- n dig) i))) (if (zero? next-n) dig (loop next-n (+ 1 i))))))
    (definec (A099563 n) (cond ((zero? n) n) ((= 1 (A265333 n)) 1) (else (+ 1 (A099563 (A257684 n)))))) ;; Based on given recurrence, using the memoization-macro definec
    ;; Antti Karttunen, Dec 24-25 2015
    

Formula

From Antti Karttunen, Dec 25 2015: (Start)
a(0) = 0; for n >= 1, if A265333(n) = 1 [when n is one of the terms of A265334], a(n) = 1, otherwise 1 + a(A257684(n)).
Other identities. For all n >= 0:
a(A001563(n)) = n. [Sequence works as a left inverse for A001563.]
a(n) = A257686(n) / A048764(n).
(End)

Extensions

a(0) = 0 prepended and the alternative description added to the name-field by Antti Karttunen, Dec 24 2015

A257687 Discard the most significant digit from factorial base representation of n, then convert back to decimal: a(n) = n - A257686(n).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, May 04 2015

Keywords

Comments

A060130(n) gives the number of steps needed to reach zero, when starting iterating as a(k), a(a(k)), etc., from the starting value k = n.

Examples

			Factorial base representation (A007623) of 1 is "1", discarding the most significant digit leaves nothing, taken to be zero, thus a(1) = 0.
Factorial base representation of 2 is "10", discarding the most significant digit leaves "0", thus a(2) = 0.
Factorial base representation of 3 is "11", discarding the most significant digit leaves "1", thus a(3) = 1.
Factorial base representation of 4 is "20", discarding the most significant digit leaves "0", thus a(4) = 0.
		

Crossrefs

Can be used (together with A099563) to define simple recurrences for sequences like A034968, A060130, A227153, A246359, A257511, A257679, A257680.
Cf. also A257684.

Programs

  • Mathematica
    f[n_] := Block[{m = p = 1}, While[p*(m + 1) <= n, p = p*m; m++]; Mod[n, p]]; Array[f, 101, 0] (* Robert G. Wilson v, Jul 21 2015 *)
  • Python
    from sympy import factorial as f
    def a007623(n, p=2): return n if n
  • Scheme
    (define (A257687 n) (- n (A257686 n)))
    

Formula

a(n) = n - A257686(n).

A257679 The smallest nonzero digit present in the factorial base representation (A007623) of n, 0 if no nonzero digits present.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, May 04 2015

Keywords

Comments

a(0) = 0 by convention, because "0" has no nonzero digits present.
a(n) gives the row index of n in array A257503 (equally, the column index for array A257505).

Examples

			Factorial base representation (A007623) of 4 is "20", the smallest digit which is not zero is "2", thus a(4) = 2.
		

Crossrefs

Positions of records: A001563.
Cf. A256450, A257692, A257693 (positions of 1's, 2's and 3's in this sequence).
Cf. also A257079, A246359 and arrays A257503, A257505.

Programs

  • Mathematica
    a[n_] := Module[{k = n, m = 2, rmin = n, r}, While[{k, r} = QuotientRemainder[k, m]; k != 0 || r != 0, If[0 < r < rmin, rmin = r]; m++]; rmin]; Array[a, 100, 0] (* Amiram Eldar, Jan 23 2024 *)
  • Python
    def A(n, p=2):
        return n if n
  • Scheme
    (define (A257679 n) (let loop ((n n) (i 2) (mind 0)) (if (zero? n) mind (let ((d (modulo n i))) (loop (/ (- n d) i) (+ 1 i) (cond ((zero? mind) d) ((zero? d) mind) (else (min d mind))))))))
    ;; Alternative implementations based on given recurrences, using memoizing definec-macro:
    (definec (A257679 n) (if (zero? (A257687 n)) (A099563 n) (min (A099563 n) (A257679 (A257687 n)))))
    (definec (A257679 n) (cond ((zero? n) n) ((= 1 (A257680 n)) 1) (else (+ 1 (A257679 (A257684 n))))))
    

Formula

If A257687(n) = 0, then a(n) = A099563(n), otherwise a(n) = min(A099563(n), a(A257687(n))).
In other words, if n is either zero or one of the terms of A051683, then a(n) = A099563(n) [the most significant digit of its f.b.r.], otherwise take the minimum of the most significant digit and a(A257687(n)) [value computed by recursing with a smaller value obtained by discarding that most significant digit].
a(0) = 0, and for n >= 1: if A257680(n) = 1, then a(n) = 1, otherwise 1 + a(A257684(n)).
Other identities:
For all n >= 0, a(A001563(n)) = n. [n * n! gives the first position where n appears. Note also that the "digits" (placeholders) in factorial base representation may get arbitrarily large values.]
For all n >= 0, a(2n+1) = 1 [because all odd numbers end with digit 1 in factorial base].

A278236 Filter-sequence for factorial base (digit values): least number with the same prime signature as A276076(n).

Original entry on oeis.org

1, 2, 2, 6, 4, 12, 2, 6, 6, 30, 12, 60, 4, 12, 12, 60, 36, 180, 8, 24, 24, 120, 72, 360, 2, 6, 6, 30, 12, 60, 6, 30, 30, 210, 60, 420, 12, 60, 60, 420, 180, 1260, 24, 120, 120, 840, 360, 2520, 4, 12, 12, 60, 36, 180, 12, 60, 60, 420, 180, 1260, 36, 180, 180, 1260, 900, 6300, 72, 360, 360, 2520, 1800, 12600, 8, 24, 24, 120, 72, 360, 24, 120, 120, 840, 360, 2520
Offset: 0

Views

Author

Antti Karttunen, Nov 16 2016

Keywords

Comments

This sequence can be used for filtering certain factorial base related sequences, because it matches only with any such sequence b that can be computed as b(n) = f(A276076(n)), where f(n) is any function that depends only on the prime signature of n (some of these are listed under the index entry for "sequences computed from exponents in ...").
Matching in this context means that the sequence a matches with the sequence b iff for all i, j: a(i) = a(j) => b(i) = b(j). In other words, iff the sequence b partitions the natural numbers to the same or coarser equivalence classes (as/than the sequence a) by the distinct values it obtains.
Any such sequence should match where the result is computed from the nonzero digits (that may also be > 9) in the factorial base representation of n, but does not depend on their order. Some of these are listed on the last line of the Crossrefs section.
Note that as A275735 is present in that list it means that the sequences matching to its filter-sequence A278235 form a subset of the sequences matching to this sequence. Also, for A275735 there is a stronger condition that for any i, j: a(i) = a(j) <=> A275735(i) = A275735(j), which if true, would imply that there is an injective function f such that f(A275735(n)) = A278236(n), and indeed, this function seems to be A181821.

Crossrefs

Similar sequences: A278222 (base-2 related), A069877 (base-10), A278226 (primorial base), A278225, A278234, A278235 (other variants for factorial base),
Differs from A278226 for the first time at n=24, where a(24)=2, while A278226(24)=16.
Sequences that partition N into same or coarser equivalence classes: A275735 (<=>), A034968, A060130, A227153, A227154, A246359, A257079, A257511, A257679, A257694, A257695, A257696, A264990, A275729, A275806, A275948, A275964, A278235.

Programs

  • Mathematica
    a[n_] := Module[{k = n, m = 2, r, s = {}}, While[{k, r} = QuotientRemainder[k, m]; k != 0|| r != 0, AppendTo[s, r]; m++]; s = ReverseSort[s]; Times @@ (Prime[Range[Length[s]]] ^ s)]; Array[a, 100, 0] (* Amiram Eldar, Feb 07 2024 *)
  • Scheme
    (define (A278236 n) (A046523 (A276076 n)))

Formula

a(n) = A046523(A276076(n)).
a(n) = A181821(A275735(n)). [Empirical formula found with the help of equivalence class matching. Not yet proved.]

A249069 a(n+1) gives the number of occurrences of the first digit of a(n) in factorial base (i.e., A099563(a(n))) so far amongst the factorial base representations of all the terms up to and including a(n), with a(0)=0.

Original entry on oeis.org

0, 1, 1, 2, 3, 5, 1, 7, 9, 12, 2, 13, 3, 16, 5, 6, 18, 1, 19, 2, 21, 3, 25, 27, 30, 32, 35, 38, 40, 41, 43, 45, 48, 13, 14, 15, 16, 18, 6, 53, 20, 7, 57, 21, 8, 64, 24, 65, 27, 69, 28, 72, 10, 73, 11, 76, 12, 33, 80, 13, 34, 85, 14, 37, 89, 15, 41, 94, 17, 46, 96, 1, 97, 2, 99, 3, 103, 4, 48, 49, 50
Offset: 0

Views

Author

Antti Karttunen, Oct 20 2014

Keywords

Examples

			   a(0) =  0 (by definition)
   a(1) =  1 ('1' in factorial base), as 0 has occurred once in all the preceding terms.
   a(2) =  1 as 1 has occurred once in all the preceding terms.
   a(3) =  2 ('10' in factorial base), as digit '1' has occurred two times in total in all the preceding terms.
   a(4) =  3 ('11' in factorial base), as '1' occurs once in each a(1) and a(2) and a(3).
   a(5) =  5 ('21' in factorial base), as '1' occurs once in each of a(1), a(2) and a(3) and twice at a(4).
   a(6) =  1 as '2' so far occurs only once at a(5)
   a(7) =  7 = '101'
   a(8) =  9 = '111'
   a(9) = 12 = '200'
  a(10) =  2 = '2'
  a(11) = 13 = '201'
  a(12) =  3 = '11'
  a(12) =  3 = '11'
  a(13) = 16 = '220'
  a(14) =  5 = '21'
  a(15) =  6 = '100'
  a(16) = 18 = '300'
  a(17) =  1 = '1'
  a(18) = 19 = '301'
  a(19) =  2 = '10'
  a(20) = 21 = '311'
  a(21) =  3 = '11'
  a(22) = 25 = '1001'
  a(23) = 27 = '1011'
  a(24) = 30 = '1100'
  a(25) = 32 = '1110'
  a(26) = 35 = '1121'
  a(27) = 38 = '1210' as the leftmost digit '1' has occurred 38 times in total in the factorial base expansions of the preceding terms a(0) - a(26).
etc.
		

Crossrefs

Cf. A249009 (analogous sequence in base-10).
Differs from a variant A249070 for the first time at n=27, where a(27) = 38, while A249070(27) = 7.
Cf. also A007623, A099563, A246359.

A299020 a(n) is the maximum digit in the factorial base expansion of 1/n.

Original entry on oeis.org

1, 1, 2, 2, 4, 1, 6, 3, 3, 2, 10, 2, 12, 3, 3, 3, 16, 4, 18, 1, 4, 6, 22, 1, 7, 9, 5, 5, 28, 4, 30, 4, 7, 9, 4, 3, 36, 13, 8, 3, 40, 5, 42, 8, 4, 15, 46, 3, 11, 6, 12, 9, 52, 6, 8, 6, 15, 15, 58, 2, 60, 22, 5, 6, 7, 9, 66, 12, 17, 4, 70, 4, 72, 31, 5, 14, 7
Offset: 1

Views

Author

Rémy Sigrist, Jan 31 2018

Keywords

Comments

See the Wikipedia link for the construction method of 1/n in factorial base.

Examples

			The first terms, alongside 1/n in factorial base, are:
  n     a(n)      1/n in factorial base
  --    ----      ---------------------
   1       1      1
   2       1      0.1
   3       2      0.0 2
   4       2      0.0 1 2
   5       4      0.0 1 0 4
   6       1      0.0 1
   7       6      0.0 0 3 2 0 6
   8       3      0.0 0 3
   9       3      0.0 0 2 3 2
  10       2      0.0 0 2 2
  11      10      0.0 0 2 0 5 3 1 4 0 10
  12       2      0.0 0 2
  13      12      0.0 0 1 4 1 2 5 4 8 5 0 12
  14       3      0.0 0 1 3 3 3
  15       3      0.0 0 1 3
  16       3      0.0 0 1 2 3
  17      16      0.0 0 1 2 0 2 3 6 8 9 0 9 2 7 0 16
  18       4      0.0 0 1 1 4
  19      18      0.0 0 1 1 1 6 2 0 9 5 2 6 11 11 13 8 0 18
  20       1      0.0 0 1 1
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{m = 0, r = 1, f = 1/n}, While[f > 0, m = Max[m, Floor[f]]; r++; f = FractionalPart[f]*r]; m]; Array[a, 77] (* Jean-François Alcover, Feb 05 2018, translated from PARI *)
  • PARI
    a(n) = my (m=0, r=1, f=1/n); while (f>0, m = max(m, floor(f)); r++; f = frac(f)*r); return (m)

Formula

a(n!) = 1 for any n >= 0.
a(n! / k) = k for any n > 1 and k = 1..n-1.
a(p) = p - 1 for any prime p.

A368160 For any n > 0, a(n) is obtained by interpreting the factorial base expansion of n in base m + 1, where m is the maximum digit in the factorial base expansion of n; a(0) = 0.

Original entry on oeis.org

0, 1, 2, 3, 6, 7, 4, 5, 6, 7, 15, 16, 18, 19, 21, 22, 24, 25, 48, 49, 52, 53, 56, 57, 8, 9, 10, 11, 33, 34, 12, 13, 14, 15, 42, 43, 45, 46, 48, 49, 51, 52, 112, 113, 116, 117, 120, 121, 54, 55, 57, 58, 60, 61, 63, 64, 66, 67, 69, 70, 72, 73, 75, 76, 78, 79
Offset: 0

Views

Author

Rémy Sigrist, Dec 14 2023

Keywords

Comments

Every nonnegative integer appears finitely many times in this sequence.

Examples

			For n = 42: the factorial base expansion of 42 is "1300" and has maximum digit 3, so the base-4 expansion of a(42) is "1300", and a(42) = 112.
		

Crossrefs

Programs

  • PARI
    a(n) = { my (d = []); for (r = 2, oo, if (n==0, return (if (#d, fromdigits(d, vecmax(d)+1), 0)), d = concat(n%r, d); n \=r;);); }

Formula

a(A059590(n)) = n.
a(k!) = 2^(k-1) for any k > 0.
Showing 1-10 of 10 results.