cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

Programming in Prime

JB_10220769
7-Bedrock

Programming in Prime

I want to construct a program in such a manner that both the variables are unknown and whole number 

a+b=5

a is a whole number

b is a whole number

b>a

Could you please help?

3 REPLIES 3

Hi,

Capture.JPG

Werner_E
25-Diamond I
(To:JB_10220769)

"whole number" does not exclude negative numbers and so you would have an infinite number of solution pairs.
Is this the intention or was Terry right when he assume that 0 would be acceptable but negative numbers are not?

 

In case that negative numbers are OK, too, you would have to provide a limit  - either a lower limit for a (runs from 2 down) or, as in the screenshot below, an upper limit for b (runs from 3 upwards):

 

Werner_E_0-1677267702144.png

 

Or are you looking for some kind of brute force attack?

Werner_E_0-1677268596542.png

 

 

 

 

Just a different take on it.  Solutions for a and b must lie on a line for any value of 't'.  So we can use y=m*x+b.  b>a only for t<2.5.

 

  2023-02-24_15-07-17.png

Announcements

Top Tags