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.

A055042 Numbers of the form 2^(2i+1)*(8*j+5).

Original entry on oeis.org

10, 26, 40, 42, 58, 74, 90, 104, 106, 122, 138, 154, 160, 168, 170, 186, 202, 218, 232, 234, 250, 266, 282, 296, 298, 314, 330, 346, 360, 362, 378, 394, 410, 416, 424, 426, 442, 458, 474, 488, 490, 506, 522, 538, 552, 554, 570, 586, 602, 616
Offset: 1

Views

Author

N. J. A. Sloane, Jun 01 2000

Keywords

Comments

These are also the numbers not of the form x^2+2y^2+3z^2.
The asymptotic density of this sequence is 1/12. - Amiram Eldar, Mar 29 2025

Examples

			42 = 21*2 = 2^(2*0 + 1)*(8*2 + 5) is in the sequence. - _David A. Corneth_, Apr 18 2021
		

References

  • Burton W. Jones, The Arithmetic of Quadratic Forms, Carus Monograph 10, Math. Assoc. America, 1967; Problem 60, p. 204.

Crossrefs

Cf. A055045.

Programs

  • Mathematica
    With[{max = 700}, Flatten[Table[2^(2*i + 1)*(8*j + 5), {i, 0, (Log2[max] - 1)/2}, {j, 0, Floor[(max/2^(2*i + 1) - 5)/8]}]] // Sort] (* Amiram Eldar, Mar 29 2025 *)
  • PARI
    upto(n) = { my(res = List()); for(i = 0, logint(n\2, 2), forstep(j = 5, n>>(2*i+1), 8, listput(res, 4^i*2*j) ) ); Set(res) } \\ David A. Corneth, Apr 18 2021
    
  • Python
    def A055042(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): return n+x-sum(((x>>(i<<1)+1)-5>>3)+1 for i in range(x.bit_length()-1>>1))
        return bisection(f,n,n) # Chai Wah Wu, Mar 19 2025

Formula

a(n) = 2*A055045(n). - Chai Wah Wu, Mar 19 2025