The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
(49G) OEIS A000966: n! never ends in this many 0's
09-29-2017, 07:23 AM
Post: #1
(49G) OEIS A000966: n! never ends in this many 0's
For natural number input N the programme returns the Nth element of the sequence

https://oeis.org/A000966

SIZE 356.5

CKSUM # D0A0h

Code:
«
  « DUPDUP 5 IQUOT
-
    WHILE DUPDUP 0
SWAP
      DO 5 IQUOT
DUP ROT + SWAP DUP
NOT
      UNTIL
      END DROP +
PICK3 <
    REPEAT 1 +
    END NIP
  »
  « DUP 1 <
    IF
    THEN DROP 0
    ELSE 0 SWAP
      WHILE 5 IDIV2
NOT
      REPEAT SWAP 1
+ SWAP
      END DROP
    END
  » → A B
  « DUP A EVAL DUP
B EVAL SWAP DUP 6 *
1 -
    DO SWAP 5 IQUOT
DUP UNROT + OVER
NOT
    UNTIL
    END NIP OVER
    IF
    THEN ROT -1
      DO 1 + SWAP 1
- SWAP OVER A EVAL
B EVAL NOT
      UNTIL
      END NIP +
SWAP -
    ELSE UNROT
DROP2
    END
  »
»
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(49G) OEIS A000966: n! never ends in this many 0's - Gerald H - 09-29-2017 07:23 AM



User(s) browsing this thread: 1 Guest(s)