Homepage › Solution manuals › Ivan Niven › An Introduction to the Theory of Numbers › Exercise 3.6.2 (Maximum value of $R(n)$ for positive $n \leq 1000$)
Exercise 3.6.2 (Maximum value of $R(n)$ for positive $n \leq 1000$)
What is the maximum value of for positive ?
Answers
Proof. Note that . Here and are the smallest primes of the form . If we want to improve this score, we must increase the exponent of or , but and a fortiori .
Thus the maximum value of for positive if . □
Check:
def R(n): prod = 1 decomposition = True for p, alpha in factor(n): if (p % 4 == 3) and (alpha % 2 == 1): decomposition = False break if p % 4 == 1: prod = prod * (alpha + 1) if decomposition: return 4 * prod else: return 0 nrec, maxi = 0, 0 for n in range(1,1001): rec = R(n) if rec > maxi: nrec = n maxi = rec print(nrec, maxi) (325, 24)