login
A319293
Numbers of the form 27^i*(9*j +- 1).
1
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,2
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.
LINKS
Jianing Song, Table of n, a(n) for n = 1..9231 (all terms <= 40000)
FORMULA
a(n) = 13*n/3 + O(log(n)).
PROG
(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
CROSSREFS
A056020 is a proper subsequence.
Perfect powers over 3-adic integers:
Squares: positive: A055047; negative: A055048 (negated);
Cubes: this sequence.
Sequence in context: A228072 A379925 A038209 * A061908 A056020 A049510
KEYWORD
nonn,changed
AUTHOR
Jianing Song, Sep 16 2018
STATUS
approved