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

A223475 Least k such that the decimal representation of k*n has digits in nonincreasing order.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 4, 3, 2, 2, 3, 3, 4, 1, 1, 1, 4, 3, 2, 2, 2, 3, 3, 1, 1, 1, 1, 13, 2, 2, 2, 2, 17, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 15, 13, 9, 9, 1, 1, 1, 1, 1, 1, 1, 13, 8, 8, 1, 1, 1, 1, 1, 1, 1, 1, 84, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 86, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 11, 5, 7, 5, 2, 5, 3, 4, 6, 1, 1, 75, 47, 38, 8, 45, 56, 8, 7, 5, 55, 5, 7
Offset: 1

Views

Author

Paul Tek, Mar 20 2013

Keywords

Examples

			39*17 = 663 has digits in nonincreasing order, and no k < 17 has this property, hence a(39) = 17.
		

Crossrefs

a(n)*n yields sequence A223474.
Cf. A009996.

Programs

  • Mathematica
    a[n_] := a[nn_] := Block[{n = nn, f, w = Range@9, k = 1}, While[Mod[n, 10] == 0, n /= 10]; While[(f = Select[w, Max@ Differences@ IntegerDigits[n*#] <= 0 &, 1]) == {}, k++; w = Union@ Flatten@Table[ Select[d*10^(k-1) + w, Max@ Differences@ IntegerDigits[Mod[n*#, 10^k], 10, k] <= 0 &], {d, 0, 9}]]; f[[1]]]; Array[a, 123] (* faster than basic approach. Giovanni Resta, Mar 26 2013 *)

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