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.
%I A319293 #15 Feb 15 2025 02:14:33 %S A319293 1,8,10,17,19,26,27,28,35,37,44,46,53,55,62,64,71,73,80,82,89,91,98, %T A319293 100,107,109,116,118,125,127,134,136,143,145,152,154,161,163,170,172, %U A319293 179,181,188,190,197,199,206,208,215,216,217,224,226,233,235,242,244 %N A319293 Numbers of the form 27^i*(9*j +- 1). %C A319293 {+-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. %H A319293 Jianing Song, <a href="/A319293/b319293.txt">Table of n, a(n) for n = 1..9231</a> (all terms <= 40000) %F A319293 a(n) = 13*n/3 + O(log(n)). %o A319293 (PARI) isA319293(n)= n\27^valuation(n, 27)%9==1||n\27^valuation(n, 27)%9==8 %o A319293 (Python) %o A319293 from sympy import integer_log %o A319293 def A319293(n): %o A319293 def bisection(f,kmin=0,kmax=1): %o A319293 while f(kmax) > kmax: kmax <<= 1 %o A319293 kmin = kmax >> 1 %o A319293 while kmax-kmin > 1: %o A319293 kmid = kmax+kmin>>1 %o A319293 if f(kmid) <= kmid: %o A319293 kmax = kmid %o A319293 else: %o A319293 kmin = kmid %o A319293 return kmax %o A319293 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)) %o A319293 return bisection(f,n,n) # _Chai Wah Wu_, Feb 14 2025 %Y A319293 A056020 is a proper subsequence. %Y A319293 Perfect powers over 3-adic integers: %Y A319293 Squares: positive: A055047; negative: A055048 (negated); %Y A319293 Cubes: this sequence. %K A319293 nonn %O A319293 1,2 %A A319293 _Jianing Song_, Sep 16 2018