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 
(50G) Counting without Zeros, OEIS A52382
09-27-2015, 09:49 AM (This post was last modified: 06-15-2017 01:41 PM by Gene.)
Post: #1
(50G) Counting without Zeros, OEIS A52382
The programme NZCNT reproduces the OEIS sequence

http://oeis.org/A052382

of zeroless numbers.

eg For input

98765432167

the programme returns

312833523494.

ZNCNT performs the inverse transformation.

NZCNT

Code:

::
  CK1&Dispatch
  # FF
  ::
    FPTR2 ^DupQIsZero?
    caseSIZEERR
    NULL$SWAP
    BEGIN
    Z9_
    FPTR2 ^ZDIVext
    FPTR2 ^DupQIsZero?
    IT
    ::
      FPTR2 ^DROPZ1
      FPTR2 ^RSUBext
      Z9_
    ;
    FPTR2 ^Z>S
    ROT
    &$SWAP
    FPTR2 ^DupQIsZero?
    UNTIL
    DROP
    FPTR2 ^S>Z
  ;
;

ZNCNT

Code:

::
  CK1&Dispatch
  # FF
  ::
    DUP
    FPTR2 ^Z>S
    CHR_0
    BINT1
    POSCHR
    #0<>
    caseSIZEERR
    Z0Z1_
    ROTDUP
    CODE 00025 143174E78FB9760131174143818F858DC7530
    ZERO_DO
    Z10_
    FPTR2 ^ZDIVext
    ROTDUP
    Z9_
    FPTR2 ^RMULText
    4UNROLL
    FPTR2 ^RMULText
    4ROLL
    FPTR2 ^RADDext
    3UNROLL
    LOOP
    2DROP
  ;
;
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(50G) Counting without Zeros, OEIS A52382 - Gerald H - 09-27-2015 09:49 AM



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