Post Reply 
HP 50g Programming Competition: How Many Partitions of an Integer in 4 Squares
04-15-2018, 04:38 PM
Post: #13
RE: HP 50g Programming Competition: How Many Partitions of an Integer in 4 Squares
Below my programme.

For 107 random 12 digit integers the ratio of

My Prog Time : Your Prog Time

is .84.

Your programme returns

?

for input

1.

Size: 190.

CKSUM: # 4015d

Code:
« DUP
  IF
  THEN DUP 2 MOD
    IF
    THEN 8
    ELSE
      DO 2 IDIV2
      UNTIL
      END 2 * 1 + 24
    END SWAP DUP 1 SAME
    IF
    THEN DROP
    ELSE FACTORS OBJ→ DUP 2. + ROLL 1. ROT 2. /
      START ROT 1 1 1. 6. ROLL
        START SWAP PICK3 * DUP UNROT +
        NEXT UNROT DROP2 *
      NEXT
    END
  ELSE NOT
  END
»
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HP 50g Programming Competition: How Many Partitions of an Integer in 4 Squares - Gerald H - 04-15-2018 04:38 PM



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