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.

A371998 a(n) = A000166(floor(n/2)) if n is even otherwise A000240(floor((n + 1)/2)).

Original entry on oeis.org

1, 1, 0, 0, 1, 3, 2, 8, 9, 45, 44, 264, 265, 1855, 1854, 14832, 14833, 133497, 133496, 1334960, 1334961, 14684571, 14684570, 176214840, 176214841, 2290792933, 2290792932, 32071101048, 32071101049, 481066515735, 481066515734, 7697064251744, 7697064251745
Offset: 0

Views

Author

Peter Luschny, Apr 25 2024

Keywords

Crossrefs

Programs

  • Maple
    a := n -> if irem(n,2) = 0 then A000166(iquo(n,2)) else A000240(iquo(n+1,2)) fi:
    seq(a(n), n = 0..32);
  • Python
    from functools import cache
    @cache
    def sf(n):
        if n == 0: return 1
        return n * sf(n - 1) + (-1 if n % 2 else 1)
    def a(n):
        h, r = divmod(n, 2)
        return sf(h) * (h + 1) if r else sf(h)
    print([a(n) for n in range(33)])