Hi all,

Here you are, the next outing in the S&SMC series, rounding out the first dozen with a simple but quirky math challenge

to help you flex your HP-programming muscles. So, enter

## The Challenge

**Find the**

*smallest*number N whose square is the sum of more than three*consecutive*cubes, all greater than 1.- All numbers in your solution must be integer, positive,

and greater than 1.

- Your program must find and display the solution

as: smallest number (N), first cube (C), last cube (L).

For example, these are **not** solutions:

N C L Sum of cubes Comments

------------------------------------------------------------------------------------------------

10 1 4 ->1^{3}+ 2^{3}+ 3^{3}+4^{3}= 100 =10^{2}1^{3}is not greater than 1204 23 25 ->

23^{3}+ 24^{3}+25^{3}= 41616 =204^{2}there are only three consecutive cubes

**Ye Olde Deadline**:

Next Monday I'll post my original solutions (plus comments), namely:

- A reference HP-71B solution, which is a
__3-line program__(129 bytes)

which finds the solution in a few minutes (less than 9 seconds running under Emu71 @ 2.4 Ghz).

It's written using just standard BASIC, no ROM extensions, so it can be easily converted

to any other programming languages, as demonstrated by - A
__54-step RPN program__for the HP-15C, which is a direct,

optimized conversion of the 71B reference solution. It finds the correct smallest value in

under 1 hour 45 min when running on a physical HP-15C.

As a bonus, the almost-automatic conversion process from HP-71B's BASIC to HP-15C's RPN will be discussed

in detail as well, statement for statement. Kinda "compiling source code BASIC to RPN", sort of ...

Before I do it, you might want to try your hand at it this next weekend. Solutions for any and all HP calcs are welcome, but you should first read

**The Usual Caveat Computat:**

- Try to achieve a proper balance between what
*you*do and what*your program*does, i.e., the program should work for*you*, not the other way around; remember these challenges are intended for you to try and demonstrate your HP-calc programming abilities.In one extreme, you give no thought to the problem at all and simply code a pure brute-force search that takes

*ages*to run; in the other extreme, you think long and hard about it and come to an analytical solution of your own, then have your program simply print the answer. The ideal is to think*just enough*to help the program*a little*, then concoct a clever program using those simple shortcuts and let it do the hard work for you, as it was meant to be. - Absolutely refrain from using a PC, laptop, or PDA (unless running some HP calc emulator/simulator) to solve the challenge. A Mathematica, Visual Basic, C++, or Java solution, say, is useless to the intended purposes of this challenge, in fact actually defeats them,
*and submitting one is to be considered unpolite behavior*.