OFFSET
0,4
COMMENTS
Normally these zeros would be omitted in an OEIS entry, but in view of its importance this is included as a pointer to the main entry A000182.
EXAMPLE
tan(x) = x + (1/3)*x^3 + (2/15)*x^5 + (17/315)*x^7 + (62/2835)*x^9 + (1382/155925)*x^11 + (21844/6081075)*x^13 + (929569/638512875)*x^15 + ... = x + 2*x^3/3! + 16*x^5/5! + 272*x^7/7! + ...
MAPLE
ptan := proc(n) option remember;
if irem(n, 2) = 0 then 0 else
-add(`if`(k=0, 1, binomial(n, k)*ptan(n - k)), k = 0..n, 2) fi end:
PROG
(Python)
from functools import cache
from math import comb as binomial
@cache
def ptan(n):
return (0 if n % 2 == 0 else
-sum(binomial(n, k)*ptan(n-k) if k > 0 else 1 for k in range(0, n+1, 2)))
def A350972(n):
t = ptan(n)
return -t if t < 0 else t
print([A350972(n) for n in range(99)]) # Peter Luschny, Jun 06 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Mar 05 2022
STATUS
approved