All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers
A prime and a cube (Posted on 2020-07-13) Difficulty: 2 of 5
What prime numbers p exist such that 16p+1 is a perfect cube?

See The Solution Submitted by Brian Smith    
Rating: 4.0000 (3 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
re(2): Just an observation (on an interesting program line) | Comment 6 of 11 |
(In reply to re: Just an observation by Charlie)

The line

if P=int(P) then P=int(P)

looks rather unusual. P is verified to be an integer because it equals its integer part--the two are equal. Now we assign the integral part to P.

In UBASIC, P was originally a floating point number (because it was the result of a division), which happened, in the true case, to have an integral value. But the prmdiv function requires an argument of type integer, not just an integral value. The assignmen of P=int(P) not only changes P's value, but its type as well. From a mathematical point of view the line looks redundant.

  Posted by Charlie on 2020-07-14 07:35:28
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (8)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information