palindrome with numbers
#1
Here's a neat little math factoid a coworker shared with us, 
if you multiply 111,111,111 times 111,111,111 
the answer is 12345678987654321 (reads the same backwards as forwards). 
I got it working in QB64 with _INTEGER64, but a plain Excel formula does not yield the right answer! 

Code: (Select All)
Dim n1&&, n2&&, n3&&, n4&&

n1&& = 111111111
n2&& = n1&& * n1&&

Print "            " + _Trim$(Str$(n1&&))
Print "  x         " + _Trim$(Str$(n1&&))
Print "    -----------------"
Print "  = " + _Trim$(Str$(n2&&))
Print

n3&& = 12345678987654321
n4&& = Sqr(n3&&)
Print "Sqr(" + _Trim$(Str$(n3&&)) + ")"
Print "  =         " + _Trim$(Str$(n4&&))


[Image: math-tidbit-1.png]
Reply


Messages In This Thread
palindrome with numbers - by madscijr - 08-19-2022, 03:51 PM
RE: palindrome with numbers - by SMcNeill - 08-19-2022, 03:57 PM
RE: palindrome with numbers - by madscijr - 08-19-2022, 04:11 PM
RE: palindrome with numbers - by Kernelpanic - 08-19-2022, 08:46 PM
RE: palindrome with numbers - by SMcNeill - 08-19-2022, 09:02 PM
RE: palindrome with numbers - by Kernelpanic - 08-19-2022, 09:27 PM
RE: palindrome with numbers - by SMcNeill - 08-19-2022, 09:29 PM
RE: palindrome with numbers - by Kernelpanic - 08-19-2022, 09:39 PM



Users browsing this thread: 1 Guest(s)