For natural number n, define f_n(x) as the product cos(x) * cos(2x) * cos(3x) * .... * cos(nx).
What is the smallest n such that |f_n''(0)| > 2024?
The smallest n making |second derivative| greater than 2024 is 18
For this function the second derivative at zero is always negative and we want the absolute value, so just find -f"(x)
Method 1:
from Desmos; see https://www.desmos.com/calculator/l65vpj1t0g
n -fn''(0)
1 1
2 5
3 14
4 30
5 55
6 91
This is in oeis as A000330, and by counting terms, the 17th is 1785 and the 18th is 2109
f"_n(0) = n*(n+1)*(2*n+1)/6
Method 2:
Using Wolfram Alpha to take 2nd derivatives of the first several f_i(x) functions (multiplied by -1) shows
f''(x) = cos(x)
f''(x) = 5 cos(x) cos(2 x) - 4 sin(x) sin(2 x)
f''(x) = 2 (7 cos(x) cos(2 x) cos(3 x) - 2 sin(x) sin(2 x) cos(3 x) - 3 sin(x) sin(3 x) cos(2 x) - 6 sin(2 x) sin(3 x) cos(x))
f''(x) = 2 (15 cos(x) cos(2 x) cos(3 x) cos(4 x) - 2 sin(x) sin(2 x) cos(3 x) cos(4 x) - 3 sin(x) sin(3 x) cos(2 x) cos(4 x) - 6 sin(2 x) sin(3 x) cos(x) cos(4 x) - 4 sin(x) sin(4 x) cos(2 x) cos(3 x) - 8 sin(2 x) sin(4 x) cos(x) cos(3 x) - 12 sin(3 x) sin(4 x) cos(x) cos(2 x))
Replace all cos terms with 1, all sin terms with 0:
The sequence is: 1, 5, 14, 30
Method 3:
Numerically calculate second derivative.
f'(x) = (f(x+ε) - f(x))/ε
f"(x) = (f'x+ε) - f'x))/ε
= (f(x+2ε) - 2f(x+ε) + f(x))/ε^2
Program output:
1 1
2 5
3 14
4 30
5 55
6 91
7 140
8 204
9 285
10 385
11 506
12 650
13 819
14 1015
15 1240
16 1496
17 1785
18 2109
The smallest n making |second derivative| greater than 2024 is 18
------------------
import math
epsilon = .0000001
def f(x,n):
ans = 1
for i in range(1,n+1):
ans *= math.cos(i*x)
return ans
def d2(x,n):
""" Second derivative
f'(x) = (f(x+ε) - f(x))/ε
f"(x) = (f'x+ε) - f'x))/ε
= (f(x+2ε) - 2f(x+ε) + f(x))/ε^2 """
ans = (f(x+2*epsilon,n) - 2*f(x+epsilon,n) + f(x,n) ) / (epsilon**2)
return - ans
for i in range(1,100):
print(i, round(d2(0,i)))
if d2(0,i) > 2024:
print('The smallest n making |second derivative| greater than 2024 is', i)
break
|
Posted by Larry
on 2024-02-27 13:07:21 |