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.

A055041 Numbers of the form 3^(2i+1)*(3*j+1).

Original entry on oeis.org

3, 12, 21, 27, 30, 39, 48, 57, 66, 75, 84, 93, 102, 108, 111, 120, 129, 138, 147, 156, 165, 174, 183, 189, 192, 201, 210, 219, 228, 237, 243, 246, 255, 264, 270, 273, 282, 291, 300, 309, 318, 327, 336, 345, 351, 354, 363, 372, 381, 390, 399
Offset: 1

Views

Author

N. J. A. Sloane, Jun 01 2000

Keywords

Comments

The numbers not of the form x^2+y^2+6z^2.
Numbers whose squarefree part is congruent to 3 modulo 9. Compare with A329575. - Peter Munn, May 17 2020
The asymptotic density of this sequence is 1/8. - Amiram Eldar, Mar 08 2021

Crossrefs

Intersection of A145204 and A189716.
Complement of A055040 with respect to A145204\{0}.
Complement of A055048 with respect to A189716.

Programs

  • Mathematica
    f[p_, e_] := (p^Mod[e, 2]); sqfpart[n_] := Times @@ f @@@ FactorInteger[n]; Select[Range[400], Mod[sqfpart[#], 9] == 3 &] (* Amiram Eldar, Mar 08 2021 *)
  • Python
    from sympy import integer_log
    def A055041(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//9**i-1)//3+1 for i in range(integer_log(x,9)[0]+1))
        return bisection(f,n,n)*3 # Chai Wah Wu, Feb 14 2025

Formula

a(n) = A055047(n) * 3. - Peter Munn, May 17 2020