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.

A166407 a(n) = floor(3*(A166406(n)/A005408(n))).

Original entry on oeis.org

-3, 1, 0, 3, -9, 3, 0, 6, 0, 3, 0, 9, -30, 1, 0, 9, 0, 6, 0, 12, 0, 3, 0, 15, -63, 6, 0, 12, 0, 9, 0, 6, 0, 3, 0, 21, 0, 2, 0, 15, -81, 9, 0, 18, 0, 6, 0, 24, 0, 0, 0, 15, 0, 9, 0, 24, 0, 6, 0, 30, -165, 6, 0, 15, 0, 15, 0, 6, 0, 9, 0, 30, 0, 0, 0, 21, 0, 12, 0, 30, 0, 3, 0, 33, -234, 6, 0, 6
Offset: 0

Views

Author

Antti Karttunen, Oct 21 2009

Keywords

Comments

Conjecture: the quotient A166406(i)/A005408(i) has denominator 3 when i is one of the terms of A166101, and it is integral in other cases. If true, then floor in the formula is unnecessary.

Crossrefs

Cf. A166408.

Programs

  • Python
    from sympy import floor, jacobi_symbol as J
    def a(n):
        l=0
        m=0
        for i in range(1, 2*n + 2):
            if J(i, 2*n + 1)==-1: l+=i
            elif J(i, 2*n + 1)==1: m+=i
        return floor(3*((l - m)/(2*n + 1)))
    print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 12 2017