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.

A055052 Numbers of the form 4^i*(8j+7) or 4^i*(8j+5).

Original entry on oeis.org

5, 7, 13, 15, 20, 21, 23, 28, 29, 31, 37, 39, 45, 47, 52, 53, 55, 60, 61, 63, 69, 71, 77, 79, 80, 84, 85, 87, 92, 93, 95, 101, 103, 109, 111, 112, 116, 117, 119, 124, 125, 127, 133, 135, 141, 143, 148, 149, 151, 156, 157, 159, 165, 167, 173, 175
Offset: 1

Views

Author

N. J. A. Sloane, Jun 02 2000

Keywords

Comments

Numbers not of the form x^2+2y^2+8z^2.
The integers that are ratios between the terms constitute the sequence's complement within A003159. - Peter Munn, Feb 07 2024
The asymptotic density of this sequence is 1/3. - Amiram Eldar, Feb 09 2024

Crossrefs

Disjoint union of A004215 and A055045.
Subsequence of A003159, A097700.

Programs

  • Mathematica
    Select[Range[200], MemberQ[{5, 7}, Mod[# / 4^IntegerExponent[#, 4], 8]] &] (* Amiram Eldar, Feb 09 2024 *)
  • Python
    def A055052(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            kmin = kmax >> 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x):
            c = n+x
            for i in range(x.bit_length()>>1):
                m = x>>(i<<1)
                c -= (m-5>>3)+(m-7>>3)+2
            return c
        return bisection(f,n,n) # Chai Wah Wu, Feb 14 2025