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.

A351987 Numbers with factorial base expansion digits in nonincreasing order.

This page as a plain text file.
%I A351987 #22 Mar 09 2025 17:03:21
%S A351987 0,1,2,3,4,5,6,8,9,12,14,15,16,17,18,20,21,22,23,24,30,32,33,48,54,56,
%T A351987 57,60,62,63,64,65,72,78,80,81,84,86,87,88,89,90,92,93,94,95,96,102,
%U A351987 104,105,108,110,111,112,113,114,116,117,118,119,120,144,150
%N A351987 Numbers with factorial base expansion digits in nonincreasing order.
%C A351987 This sequence is to factorial base what A009996 is to decimal base.
%H A351987 Rémy Sigrist, <a href="/A351987/b351987.txt">Table of n, a(n) for n = 1..6910</a> (terms <= 9!)
%H A351987 <a href="/index/Fa#facbase">Index entries for sequences related to factorial base representation</a>
%e A351987 The factorial base expansion of 102 is "4100", so 102 belongs to this sequence.
%e A351987 The factorial base expansion of 103 is "4101", so 103 does not belong to this sequence.
%t A351987 max = 6; q[n_] := AllTrue[Differences @ IntegerDigits[n, MixedRadix[Range[max, 2, -1]]], # <= 0 &]; Select[Range[0, max!], q] (* _Amiram Eldar_, Feb 28 2022 *)
%o A351987 (PARI) is(n) = { my (p=0); for (r=2, oo, if (n==0, return (1)); my (d=n%r); if (d<p, return (0), p=d; n\=r)) }
%o A351987 (Python)
%o A351987 def facbase(n, i=2): return [n] if n < i else [*facbase(n//i, i=i+1), n%i]
%o A351987 def ok(n): return (fb:=facbase(n)) == sorted(fb, reverse=True)
%o A351987 print([k for k in range(151) if ok(k)]) # _Michael S. Branicky_, Mar 09 2025
%o A351987 (Python) # faster for initial segment of sequence
%o A351987 from math import factorial
%o A351987 from itertools import count, islice, product
%o A351987 def bgen(d, first, last): # generator of non-increasing factorial base tuples
%o A351987     yield from ((i,) + t for i in range(first, last+1) for t in bgen(d-1, first=0, last=min(i, d-1))) if d else (tuple(),)
%o A351987 def A351987_gen(): # generator of terms
%o A351987     yield from (sum(dj*factorial(j) for j, dj in enumerate(t[::-1], 1)) for d in count(0) for t in bgen(d, 1, d))
%o A351987 print(list(islice(A351987_gen(), 63))) # _Michael S. Branicky_, Mar 09 2025
%Y A351987 Cf. A009996, A108731, A351988.
%K A351987 nonn,base
%O A351987 1,3
%A A351987 _Rémy Sigrist_, Feb 27 2022