login
A376956
a(n) = least k such that n^(2k)/(2 k)! < 1.
11
1, 1, 2, 4, 5, 6, 7, 9, 10, 11, 13, 14, 15, 17, 18, 19, 21, 22, 24, 25, 26, 28, 29, 30, 32, 33, 34, 36, 37, 38, 40, 41, 42, 44, 45, 46, 48, 49, 51, 52, 53, 55, 56, 57, 59, 60, 61, 63, 64, 65, 67, 68, 69, 71, 72, 74, 75, 76, 78, 79, 80, 82, 83, 84, 86, 87, 88
OFFSET
0,3
COMMENTS
The numbers n^(2k)/(2 k)! are the coefficients in the Maclaurin series for cos x when x = 1. If m>a(n), then n^(2k)/(2 k)! < 1.
FORMULA
a(n) ~ exp(1)*n/2 - log(n)/4. - Vaclav Kotesovec, Oct 13 2024
MATHEMATICA
a[n_] := Select[Range[200], n^(2 #)/(2 #)! < 1 &, 1];
Flatten[Table[a[n], {n, 0, 200}]]
PROG
(Python)
from itertools import count
from math import gcd
def A376956(n):
a, b = 1, 1
for k in count(1):
a *= n**2
b *= (m:=k<<1)*(m-1)
if a < b: return k
c = gcd(a, b)
a, b = a//c, b//c # Chai Wah Wu, Oct 16 2024
KEYWORD
nonn
AUTHOR
Clark Kimberling, Oct 12 2024
STATUS
approved