Hi all,

Just back from Xmas holidays, let's begin the year with a brand new S&SMC, this time lucky number #13, which though not particularly difficult, it's slightly 'busier' than usual so, to compensate for this, it comes with

a 'prize' attached for all of you who can deliver, details at the end of this post.

Caveat emptor: since this is S&SMC #**13** you're hereby warned that failure to *at least try* will be considered disrespect to the number 13 and thus you'll suffer *a whole year of pretty bad luck*. You've been warned. :-)

## The Challenge

You must write a program for your favorite HP (preferably) calc, which shall do the

following:

- For each one of the 8 infinite sums given below, it must compute
*a numerical value S for the sum*. A correct value will be

rewarded with 1 point. - Then, it must convert this value S to
*rational form*and output the

numerator N and denominator D of the resulting fraction, N/D, such that this

fraction is in lowest terms, and is as simple as possible while correctly evaluating

to S, allowing for slight rounding inaccuracies in the computed value S. For instance, if you obtain S = .666666666668, you're expected to produce**2/3**,*not*

166666666667/250000000000. A correct value will be rewarded with another point. - You must then state whether your resulting fraction is indeed the

*exact* value of the infinite sum, in your opinion, or just an approximation, and

in this last case, to how many digits do you think it is correct. If you're right, you'll be rewarded with yet another point.

**Example:**Suppose you're asked to compute

SUM( N = 1, N -> Inf, f(N)/2

^{N})

where f(N) = N/3.

First, your program finds that S = .666666666668, approximately.

Then, your program converts this value to a fraction as stated, giving S = 2/3

And finally you confirm that, in your opinion, the exact value of S is indeed 2/3. All are correct, so you would get 3 points for this sample case.

Notice that despite there being eight different sums to compute, *they are similar enough that
your program will be nearly the same in all cases*, you just need to

additionally code the particular function being summed up. Of course, the

code to convert to fractional form is the exact very same for all eight cases, and last but not least,

your expert judgment about what the exact result should be requires no coding at all, just smarts and/or intuition on your part.

To give an idea of the magnitude of the task ahead, all in all, and supposing you were using an HP-71B for example, you should be able to code the infinite sum calculation in a couple of lines, the particular function being summed up in another two lines at most, and the real-to-fraction routine in some five lines, for

a total of 9-10 lines of code for the very first sum, and 2-3 additional lines for each remaining case. Not much, if you know how to do it.

The particular infinite sums to compute for this challenge are the following:

S = SUM( N=1, N -> Inf, f(2^{N})/2^{N})

where f(N) counts the number of

odd digits(i.e.: 1,3,5,7,9) in Nfor example: f(2048) = 0, f(2

718281828) = 3, f(3141592654) = 6

Same as above but f(N) counts instead the number ofevendigits

(i.e.: 0,2,4,6,8) in N

for example: f(

2048) = 4, f(2718281828) = 7, f(3141592654) = 4

Same as above, but f(N) = 1 if N has anevennumber of digits and

0 otherwise.

for example: f(2048) = 1, because 2048 has 4 digits and 4 is

even

f(777) = 0, because 777 has 3 digits and 3 isodd

Same as above, but f(N) counts the number ofodddigits inoddplaces in

the decimal expansion of N

**(the 1**

1

^{st}digit is the1

^{st}digit to the left of the decimal point).- For example: f(

__9__0

__1__) = 2,

f(210) = 0, (the only odd digit, 1, is at an even place (2

^{nd}) )

f(81

__1__) = 1

**S = SUM( N=1, N-> Inf, f(N)/10**

^{N})-
where f(N) is the same as in the previous sum above.

**S = SUM( N=1, N-> Inf, f(N)/2**

^{N})-
where f(N) = Integer part of (Pi/2 * N)

**S = (SUM( N=1, N-> Inf, f(N) )/5+1/10)**

^{2}-
where f(N) = e^(-N*N/100)

*not*output a fraction but simply the decimal value of S,

and must try and guess what the exact value of S is)

**S = SUM( N=1, N -> Inf, f(N)/ 5**

^{N})-
where f(N) = Integer part of ( N*e^(Pi/3*Sqrt(163)) )

That makes a maximum of **23 points** if you correctly compute, convert to fractional

form, and guess the exact value of the sum for all 8 cases.

## The prize

Everyone whose solutions get

**15 points**or more will be entitled to receive

by e-mail the following, still

*unavailable on-line*Datafile articles of mine,

in PDF format, namely:

**HP-71B Math ROM Baker's Dozen Vol. 2***Multidimensional integrals, solving systems of non-linear equations,*

computing all eigenvalues real and complex of arbitrary square matrices,

and more**HP-71B Fantastic FOUR***Multiplying very large numbers fast by means of Fast Fourier Transforms***HP-71B Short & Sweet Sudoku Solver***Automatically solves any sudoku puzzle without user's intervention,*

by using advanced techniques such as recursion, bitboards, and boolean operations.**HP-71B Sudoku Solver Sublime Sequel***Improved version of my Sudoku Solver, incorporating new criteria for*

much faster results. Includes Test Suite of 15 choice Sudoku puzzles, from the simplest to the most difficult.**Mean Matrices***Introducing a series of simple and small integer-valued randomly-generated*

matrices that nevertheless are nearly intractable by conventional means

due to their extreme ill-conditioning. Several cases are discussed at

length, with (discouraging) results for the 71B and exact results with Mathematica.

**HP-71B Minimax Polynomial Fit***Computes the minimax polynomial fit to a given set of datapoints, a*

given function in an interval, or a dataset read from a file. The user

can specify either the degree of the desired polynomial or else the maximum

absolute error over the given dataset or interval and let the program

compute the lowest-degree polynomial that meets the requirement.*The resulting polynomial can be evaluated at any point, scanned for its*

maximum error over a given interval, and is guaranteed to have an

absolute maximum error lower than any other polynomial fit, least-squares included.

The usual caveats apply, namely: (1) Do not post just solutions, actual

code is mandatory and (2) Code must be for an HP (preferably) calculator;

posting code written in

Visual Basic, Java, FORTRAN, or any other PC language will be considered

unpolite and disrespectful.

That's all. Hoping you'll like this challenge and waiting for your inputs,

Best regards from V.