cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A350972 E.g.f. = tan(x).

This page as a plain text file.
%I A350972 #19 Apr 16 2025 09:36:52
%S A350972 0,1,0,2,0,16,0,272,0,7936,0,353792,0,22368256,0,1903757312,0,
%T A350972 209865342976,0,29088885112832,0,4951498053124096,0,
%U A350972 1015423886506852352,0,246921480190207983616,0,70251601603943959887872,0,23119184187809597841473536,0,8713962757125169296170811392,0
%N A350972 E.g.f. = tan(x).
%C A350972 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.
%e A350972 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! + ...
%p A350972 ptan := proc(n) option remember;
%p A350972     if irem(n, 2) = 0 then 0 else
%p A350972     -add(`if`(k=0, 1, binomial(n, k)*ptan(n - k)), k = 0..n,2) fi end:
%p A350972 A350972 := n -> abs(ptan(n)): seq(A350972(n), n=0..29); # _Peter Luschny_, Jun 06 2022
%o A350972 (Python)
%o A350972 from functools import cache
%o A350972 from math import comb as binomial
%o A350972 @cache
%o A350972 def ptan(n):
%o A350972     return (0 if n % 2 == 0 else
%o A350972     -sum(binomial(n,k)*ptan(n-k) if k > 0 else 1 for k in range(0,n+1,2)))
%o A350972 def A350972(n):
%o A350972     t = ptan(n)
%o A350972     return -t if t < 0 else t
%o A350972 print([A350972(n) for n in range(99)]) # _Peter Luschny_, Jun 06 2022
%Y A350972 Cf. A000182, A000364, A122045.
%Y A350972 See also A009006, A009764, A155585.
%K A350972 nonn
%O A350972 0,4
%A A350972 _N. J. A. Sloane_, Mar 05 2022