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
CROSSREFS
KEYWORD
nonn
AUTHOR
Clark Kimberling, Oct 12 2024
STATUS
approved