HP Forums
(50g) OEIS A137580: Number of Different Digits in N! - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Software Libraries (/forum-10.html)
+--- Forum: General Software Library (/forum-13.html)
+--- Thread: (50g) OEIS A137580: Number of Different Digits in N! (/thread-9147.html)



(50g) OEIS A137580: Number of Different Digits in N! - Gerald H - 09-23-2017 12:16 PM

For natural number N input the programme returns the number of different digits in N!.

For info see

https://oeis.org/A137580

You may note that for N > 41 the programme returns 10 - this result is based on a heuristic proof of that fact. The proof is what I would call a 21st century proof &, while not satisfying those still entrenched in the 20th century, is more than adequate for moderns.

However, as moderns see everything open to revision, should a counter-proof appear I would amend the programme.

Code:
::
  CK1&Dispatch
  # FF
  ::
    DUP
    ZINT 41
    Z>
    casedrop
    %10
    PTR 2EF44
    ZEROSWAP
    FPTR2 ^Z>S
    BINT10
    ZERO_DO
    DUPINDEX@
    #>$
    BINT1
    POSCHR
    #0=?SKIP
    SWAP#1+SWAP
    LOOP
    DROP
    UNCOERCE
  ;
;