Post Reply 
Little explorations with HP calculators (no Prime)
09-11-2017, 09:21 PM (This post was last modified: 09-11-2017 10:25 PM by Gilles59.)
Post: #229
RE: Little explorations with the HP calculators
(09-10-2017 10:46 AM)AlexFekken Wrote:  Don't want to spoil too much of the fun but this is equivalent to a / b = c / d <> 1.

That's a lot !

HP50G

'(a+b) / (c+d) = (a-b) / (c-d)'
'a' ISOL
->
a=(c.b)/d

That means (if we dont care about 2 same values of a b c d), that the number of quadruplets is the sum of the divisors of c*b for c:1->999, b:1->999

Quick and dirty HP50G + GoferList:

Code:
«
 1 999 FOR c
  1 999 FOR b
   c b * 
   DIVIS  « 1000 < » Filter  @d   
   DUP REVLIST  @ a
   Zip 1. « b +  c +  » DOLIST 
   « Nub SIZE 4. == » Filter  @ a,b,c,d all different
   IF DUP Null THEN DROP ELSE 1. « { a d b c} SWAP = » DOSUBS HALT  END
  NEXT
 NEXT
»

Get ready for ~ 1000000 Shift CONT

ex : { { 'a=2' 'd=7' 'b=14' 'c=1' } { 'a=7' 'd=2' 'b=14' 'c=1' } }
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Little explorations with the HP calculators - Gilles59 - 09-11-2017 09:21 PM



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