T__en Odd Moment__s

D__isclaime__r

The opinions expressed byRudeJohndo not necessarily reflect those of theBasix Fanzineor its staff. In fact, they probably disagree with me entirely. Everyone else does. <bfg>

I__ntroductio__n

Below is a short list of exercises suitable for passing the odd moment or two when you're bored silly and can't think of anything better to do. Then again, if you'rethatbored maybe you should be looking for a job so that you can afford to move out of your parent's basement. Think about it.

One

An automorphic number is a natural number which appears at the end of its square, e.g.,

5 ^{ 2}= 2 525 ^{ 2}= 6 25625 ^{ 2}= 390 625

Write a program to find more automorphic numbers.

Two

The Goldbach conjecture states that every even number can be represented as the sum of two prime numbers. Show that this is true for the first 1000 even numbers.

Three

A Mersenne prime is a prime number of the form2where x is also prime, e.g., 2^{ x}- 1^{ 3}- 1 = 7.

Write a program to find several more Mersenne primes.

Four

A perfect number is a natural number equal to the sum of all of its exact divisors except itself, e.g.,28 = 1 + 2 + 4 + 7 + 14

Write a program to find at least 3 more perfect numbers.

Five

Extend the notion of automorphism to higher integral powers, e.g.,

5 ^{ 3}= 12 525 ^{ 3}= 156 25625 ^{ 3}= 244140 625

Write anefficientprogram to search for n-th power automorphic numbers.

Six

Let A and B be two unequal natural numbers. If A is the sum of all of the exact divisors of B (excluding B itself), and if B is the sum of all of the exact divisors of A (excluding A itself), then A and B areamicable. For example, the sum of the exact divisors of 220 (excluding 220 itself) is equal to 284, and the sum of the exact divisors of 284 (excluding 284 itself) is equal to 220. Thus, 220 and 284 are amicable. Isn't that nice?

Write a program to find more amicable numbers. Or else.

Seven

This exercise doesn't require a program, but you may want to write one anyway. In fact, you may want to write several! <g>

Let's say that we are looking for a simple test for a random integer generator. When do you think it would be reasonable to claim that eachdigitshould occur 10% of the time? Less than 10%? More than 10%?

If we are generating random integers in the range of say, 0 to 999, then shouldn't every number be considered as a string of digits of equal length? In other words, shouldn't the number 2 be interpreted as 002? This approach will certainly effect the frequency count for the digit zero. What do you think?

Eight

Write a program that will accept a simple arithmetical expression as a string and check it for unmatched parentheses. And send me a case of scotch.

Nine

Write a program to determine whether a simple algebraic expression is syntactically correct. This means that an expression such as X = 5 + Y / ( 3 - 3 ) is acceptable because it is syntactically correct even though it is mathematically invalid. Assume that variable names consist of a single letter, and allow + and - to be used as unary operators, e.g., X * - Y is syntactically correct but X - * Y is not. For now, restrict operations to +, -, *, and /.

Ten

Write a program that reads a simple arithmetical statement, checks it for syntactical correctness, and then evaluates that statement using the following rules of precedence:The overall evaluation of an expression procedes from left to right. Parts of an expression which are delimited by parentheses are evaluated before parts of the expression which are not. If parentheses are nested, then evaluation procedes from the innermost pair to the outermost pair. When confronted with two or more sub-expressions of equal precedence, evaluation procedes from left to right. [[[ Do

- both unary operators share equal precedence
- both unary operators precede *
- * precedes /
- / precedes binary +
- binary + precedes binary -
notdepend upon your programming language-of-choice to automatically enforce any of these rules. The point of the exercise is foryouto define the implementation of ( ), +, -, *, and /. ]]]

Accordingly, -5 + - -7 * - 4 / -2 + + 11 = 20.

C'ya**,**

RudeJohn

*"I'm rude . It's a job."*