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.

A286366 Compound filter: a(n) = 2*A286365(n) + floor(A072400(n)/4).

Original entry on oeis.org

4, 6, 8, 4, 13, 11, 9, 6, 28, 14, 8, 8, 13, 11, 21, 4, 12, 30, 8, 13, 65, 11, 9, 11, 40, 14, 116, 9, 13, 23, 9, 6, 64, 14, 20, 28, 13, 11, 21, 14, 12, 66, 8, 8, 49, 11, 9, 8, 28, 42, 20, 13, 13, 119, 21, 11, 64, 14, 8, 21, 13, 11, 269, 4, 84, 66, 8, 12, 65, 23, 9, 30, 12, 14, 56, 8, 65, 23, 9, 13, 484, 14, 8, 65, 85, 11, 21, 11, 12, 50, 20, 9, 65, 11, 21, 11
Offset: 1

Views

Author

Antti Karttunen, May 08 2017

Keywords

Comments

Each term of this sequence contains, in addition to the information contained in A286365 (which packs the values of A286361(n) and A286363(n) and parity of the exponent of the highest power of 2 dividing n) also the bit-2 of A072400(n) (its third least significant bit), which is here stored as the least significant bit of a(n). Note that the whole A072400(n) can be recovered based on the other information contained in a(n). Together all this information is enough - by Lagrange's "Four Squares theorem" - to determine what is the least number of squares that add up to n. Thus it follows that for all i, j: a(i) = a(j) => A002828(i) = A002828(j).
A286369 is similar, but without the parity of the 2-adic value present.

Crossrefs

Programs

  • Python
    from sympy import factorint
    from operator import mul
    def P(n):
        f = factorint(n)
        return sorted([f[i] for i in f])
    def a046523(n):
        x=1
        while True:
            if P(n) == P(x): return x
            else: x+=1
    def A(n, k):
        f = factorint(n)
        return 1 if n == 1 else reduce(mul, [1 if i%4==k else i**f[i] for i in f])
    def T(n, m): return ((n + m)**2 - n - 3*m + 2)/2
    def a286364(n): return T(a046523(n/A(n, 1)), a046523(n/A(n, 3)))
    def a007814(n): return 1 + bin(n - 1)[2:].count("1") - bin(n)[2:].count("1")
    def a286365(n): return 2*a286364(n) + a007814(n)%2
    def a072400(n): return int(str(int(''.join(map(str, digits(n, 4)[1:]))[::-1]))[::-1], 4)%8
    def a(n): return 2*a286365(n) + int(a072400(n)/4) # Indranil Ghosh, May 09 2017
  • Scheme
    (define (A286366 n) (+ (* 2 (A286365 n)) (floor->exact (/ (A072400 n) 4))))
    

Formula

a(n) = 2*A286365(n) + floor(A072400(n)/4).