i really need help! asap.. please solve this problem..



Reciprocals of positive integers yield decimal numbers which either terminate or repeat. For example, the reciprocal of 64 is 0.015625 and the reciprocal of 56 is 0.017857142857142… where the sequence “857142” repeats. The number of digits which may occur before the decimal terminates or begins to repeat can be quite large.

The reciprocals of some numbers contain interesting sequences of digits.

Write a program which will examine the reciprocals of numbers up to 1000 for sequences of 3 or more digits which begin with “9” and continue with the other digits in decreasing order. Examples are “9876”, “98765” and “98765432”. Note: “9753” is considered unacceptable.

Your program will need to be able to accommodate reciprocals of up to 1500 decimal places and some means of detecting termination of the decimal or the onset of repeating will substantially increase its efficiency.

For each such sequence it finds, your program should report the divisor of which the reciprocal is being calculated, the number of digits in the sequence and the decimal place at which the sequence starts. For example, if in calculating the reciprocal of 97 the sequence 987 begins at the 47th decimal place the program should report the divisor as 97, the length of the sequence as 3 and the starting position as 47.

In addition, at the end of its run the program should report the divisor which produced the longest sequence of digits, the length of that sequence and the position at which it started. If multiple sequences occur in a reciprocal they should be reported except where they occur as a result of the reciprocal beginning to repeat.

Your out put should be formatted as follows:

DECREASING DIGITS
=================

DIVISOR LENGTH START
xxx x xxx
… … …

xxx produced the longest sequence of x digits at position xxx.


just email me at jethabyss@yahoo.com

thanks..

How much are you willing to pay me for helping you cheat?

(My prices start at $30 an hour.)
Topic archived. No new replies allowed.