Brain Teasers
After Square, But Before Cube
What is the smallest integer where the integer before it is a perfect square and the integer after it is a perfect cube?
Answer
26. The integer before 26 is 25 or 5 squared, and the next number is 27 or 3 cubed.Hide Answer Show Answer
What Next?
View a Similar Brain Teaser...
If you become a registered user you can vote on this brain teaser, keep track of which ones you have seen, and even make your own.
Solve a Puzzle
Comments
X^2 + 2 = Y^3 being the formula, for every integer X there is a real number solution Y = (X^2 + 2) ^ 1/3. Without proof that there is one and only one Y which is an integer, there must be some assumption this is stuff that is generally known. Then, oh sour paradox, the answer must also be a matter of common knowledge and there is no teaser.
If this is true for every integer, then there must be a proof that it is so. Without the proof, this isn't very interesting.
I suspect the proof is related to the fact that the difference between two adjacent squares is a multiple of two plus one and the difference between two consecutive cubes is a multiple of six plus one.
I suspect the proof is related to the fact that the difference between two adjacent squares is a multiple of two plus one and the difference between two consecutive cubes is a multiple of six plus one.
I think asking for the smallest such number would've been a better idea.
*sighs* Another good teaser with a bad rating.
*sighs* Another good teaser with a bad rating.
Yes I agree, give a proof or reword the teaser. Either make it "the smallest number", or make it "the only number less than 1000", or something similarly provable. Even still, any proof that I can think of for either of these is going to be a brute-force approach. Not very mathematical...
This checks every value between 1 and 9223372036854775807.
#!/usr/bin/python
import sys, time
start = time.time()
i = 1
print
print 'Checking values 1 to %d' % (sys.maxint)
print
print ' i (i-1)^1/2 (i+1)^1/3'
while (i < sys.maxint):
sys.stdout.write("\033[0G")
sys.stdout.write("Checking %d" % i)
sqrt = pow(float(i-1), float(1)/float(2))
curt = pow(float(i+1), float(1)/float(3))
if ((sqrt == round(sqrt)) and (curt == round(curt))):
sys.stdout.write("\033[0G")
print ' ' * 30
print '%4d %4.2f %4.2f' % (i, sqrt, curt)
print
i = i+1
end = time.time()
diff = end - start
print
print 'Done in %f seconds' % (diff)
print
This checks every value between 1 and 9223372036854775807.
#!/usr/bin/python
import sys, time
start = time.time()
i = 1
print 'Checking values 1 to %d' % (sys.maxint)
print ' i (i-1)^1/2 (i+1)^1/3'
while (i < sys.maxint):
sys.stdout.write("\033[0G")
sys.stdout.write("Checking %d" % i)
sqrt = pow(float(i-1), float(1)/float(2))
curt = pow(float(i+1), float(1)/float(3))
if ((sqrt == round(sqrt)) and (curt == round(curt))):
sys.stdout.write("\033[0G")
print ' ' * 30
print '%4d %4.2f %4.2f' % (i, sqrt, curt)
i = i+1
end = time.time()
diff = end - start
print 'Done in %f seconds' % (diff)
Argh, that code had its indentation removed... Which matters in python :/ and I forgot to mention that of course this still doesn't prove the original question because there are plenty of numbers larger than 64 bits worth... (I'll post results when it finishes )
Poor Shady.. you don't like to see innocent teasers go down the drain. TOOOO MANY WORDS!!!
Yes, awesome teaser... just word it to "smallest integer" instead of "only integer".
with new outspell,, this one's nce (though I didn't originally know what integer or whatever was before reading the answer. I'm not originally english speaking - integer=step in natural numers)
WoW! Class or Braingle? I wished one of the eight members explained the formula so it was understandable to some small or even degree.
Pretty good teaser. I would call it 'great' if it had a better explanation, but it's still pretty good.
To post a comment, please create an account and sign in.
Follow Braingle!