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 50g) WEIGH Transform
11-24-2019, 10:12 PM (This post was last modified: 01-21-2020 06:57 PM by John Keith.)
Post: #1
(49g 50g) WEIGH Transform
This program computes the WEIGH transform of a sequence of integers. Some information here.

The program requires the ListExt Library and must be run in exact mode.

Code:

\<< 1 OVER HEAD 2. \->LIST OVER SIZE R\->I \-> a n
  \<< DUP HEAD SWAP 2 n
    FOR k k DIVIS DUP2 LPICK OVER * SWAP REV 1.
      \<< I\->R 2. MOD { 1 } { -1 } IFTE
      \>> DOLIST * LSUM SWAP
    NEXT DROP n \->LIST a 2 n
    FOR j OVER 1 j SUB OVER REV * LSUM j / +
    NEXT NIP
  \>>
\>>
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(49g 50g) WEIGH Transform - John Keith - 11-24-2019 10:12 PM
RE: (49g 50g) WEIGH Transform - John Keith - 01-21-2020, 07:00 PM



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