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

A351988 In the factorial base expansion of n, arrange digits in decreasing order.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 8, 8, 9, 14, 15, 12, 14, 14, 15, 16, 17, 18, 20, 20, 21, 22, 23, 24, 30, 30, 32, 54, 56, 30, 32, 32, 33, 56, 57, 54, 56, 56, 57, 62, 63, 78, 80, 80, 81, 86, 87, 48, 54, 54, 56, 60, 62, 54, 56, 56, 57, 62, 63, 60, 62, 62, 63, 64, 65, 84, 86
Offset: 0

Views

Author

Rémy Sigrist, Feb 27 2022

Keywords

Comments

This sequence is to factorial base what A004186 is to decimal base.

Examples

			For n = 1664:
- the factorial base expansion of 1664 is "214110",
- arranging these digits in decreasing order gives "421110",
- so a(1664) = 4*6! + 2*5! + 1*4! + 1*3! + 1*2! + 0*1! = 3152.
		

Crossrefs

Cf. A004186 (decimal analog), A073138 (binary analog), A108731, A319651 (ternary analog), A351987.

Programs

  • Mathematica
    max = 5; b = MixedRadix[Range[max, 2, -1]]; a[n_] := FromDigits[Sort[IntegerDigits[n, b], Greater], b]; Array[a, max!, 0] (* Amiram Eldar, Feb 28 2022 *)
  • PARI
    a(n) = { my (dd=[]); for (r=2, oo, if (n==0, dd = vecsort(dd); return (sum(k=1, #dd, dd[k]*k!)), dd = concat(dd, n%r); n\=r)) }

Formula

a(a(n)) = a(n).
a(n) >= n with equality iff n belongs to A351987.

A381770 a(n) is the least k > 0 such that the factorial base expansion of k*n has digits in nonincreasing order.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 5, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 6, 3, 2, 2, 3, 1, 2, 1, 1, 3, 3, 2, 3, 3, 2, 2, 14, 2, 2, 2, 2, 2, 2, 1, 6, 3, 2, 2, 8, 1, 2, 1, 1, 2, 2, 1, 5, 1, 1, 1, 1, 4, 8, 4, 6, 6, 8, 1, 6, 4, 2, 2, 9, 1, 8, 1, 1, 7, 8, 1, 5, 1
Offset: 0

Views

Author

Rémy Sigrist, Mar 07 2025

Keywords

Comments

The sequence is well defined as for any n > 0, the factorial base expansion of n! has digits in nonincreasing order.

Examples

			The first terms, alongside the factorial base expansion of n*a(n), are:
  n   a(n)  fact(n*a(n))
  --  ----  ------------
   0     1  0
   1     1  1
   2     1  1,0
   3     1  1,1
   4     1  2,0
   5     1  2,1
   6     1  1,0,0
   7     2  2,1,0
   8     1  1,1,0
   9     1  1,1,1
  10     2  3,1,0
  11     2  3,2,0
  12     1  2,0,0
  13     5  2,2,2,1
  14     1  2,1,0
  15     1  2,1,1
		

Crossrefs

Programs

  • PARI
    is(n) = { my (p = -1); for (r = 2, oo, if (n==0, return (1), p > p = n%r, return
     (0)); n \= r;); }
    a(n) = { for (k = 1, oo, if (is(k*n), return (k););); }
    
  • Python
    from itertools import count
    def facbase(n, i=2): return [n] if n < i else [*facbase(n//i, i=i+1), n%i]
    def is_non_inc(n): return (fb:=facbase(n)) == sorted(fb, reverse=True)
    def a(n): return next(k for k in count(1) if is_non_inc(k*n))
    print([a(n) for n in range(87)]) # Michael S. Branicky, Mar 09 2025

Formula

a(n) <= (n-1)! for any n > 0.
a(n) = 1 iff n belongs to A351987.

A381771 For any n > 0, a(n) is the least positive multiple of n whose factorial base expansion has digits in nonincreasing order; a(0) = 0.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 14, 8, 9, 20, 22, 12, 65, 14, 15, 16, 17, 18, 57, 20, 21, 22, 23, 24, 150, 78, 54, 56, 87, 30, 62, 32, 33, 102, 105, 72, 111, 114, 78, 80, 574, 84, 86, 88, 90, 92, 94, 48, 294, 150, 102, 104, 424, 54, 110, 56, 57, 116, 118, 60, 305, 62, 63
Offset: 0

Views

Author

Rémy Sigrist, Mar 07 2025

Keywords

Comments

The sequence is well defined as for any n > 0, the factorial base expansion of n! has digits in nonincreasing order.

Examples

			The first terms, alongside their factorial base expansion, are:
  n   a(n)  fact(a(n))
  --  ----  ----------
   0     0  0
   1     1  1
   2     2  1,0
   3     3  1,1
   4     4  2,0
   5     5  2,1
   6     6  1,0,0
   7    14  2,1,0
   8     8  1,1,0
   9     9  1,1,1
  10    20  3,1,0
  11    22  3,2,0
  12    12  2,0,0
  13    65  2,2,2,1
  14    14  2,1,0
  15    15  2,1,1
		

Crossrefs

Programs

  • PARI
    is(n) = { my (p = -1); for (r = 2, oo, if (n==0, return (1), p > p = n%r, return (0)); n \= r;); }
    a(n) = { for (k = 1, oo, if (is(k*n), return (k*n););); }
    
  • Python
    from itertools import count
    def facbase(n, i=2): return [n] if n < i else [*facbase(n//i, i=i+1), n%i]
    def is_non_inc(n): return (fb:=facbase(n)) == sorted(fb, reverse=True)
    def a(n): return next(k*n for k in count(1) if is_non_inc(k*n))
    print([a(n) for n in range(64)]) # Michael S. Branicky, Mar 09 2025

Formula

a(n) = A381770(n) * n.
a(n) <= n!.
a(n) = n iff n belongs to A351987.
Showing 1-3 of 3 results.