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.

A319293 Numbers of the form 27^i*(9*j +- 1).

Original entry on oeis.org

1, 8, 10, 17, 19, 26, 27, 28, 35, 37, 44, 46, 53, 55, 62, 64, 71, 73, 80, 82, 89, 91, 98, 100, 107, 109, 116, 118, 125, 127, 134, 136, 143, 145, 152, 154, 161, 163, 170, 172, 179, 181, 188, 190, 197, 199, 206, 208, 215, 216, 217, 224, 226, 233, 235, 242, 244
Offset: 1

Views

Author

Jianing Song, Sep 16 2018

Keywords

Comments

{+-a(n)} gives all nonzero cubes modulo all powers of 3, that is, cubes over 3-adic integers. So this sequence is closed under multiplication.

Crossrefs

A056020 is a proper subsequence.
Perfect powers over 3-adic integers:
Squares: positive: A055047; negative: A055048 (negated);
Cubes: this sequence.

Programs

  • PARI
    isA319293(n)= n\27^valuation(n, 27)%9==1||n\27^valuation(n, 27)%9==8
    
  • Python
    from sympy import integer_log
    def A319293(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(((m:=x//27**i)-1)//9+(m-8)//9+2 for i in range(integer_log(x,27)[0]+1))
        return bisection(f,n,n) # Chai Wah Wu, Feb 14 2025

Formula

a(n) = 13*n/3 + O(log(n)).