OFFSET
1,3
COMMENTS
FORMULA
k is a term if and only if k is a multiple of 3 or k is a cube.
MAPLE
q:= n-> andmap(i-> irem(n*i[2], 3)=0, ifactors(n)[2]):
select(q, [$0..200])[]; # Alois P. Heinz, Sep 19 2024
MATHEMATICA
Join[{0}, Select[Range[170], IntegerQ[#^(#/3)] &]] (* Stefano Spezia, Sep 18 2024 *)
PROG
(Python)
from sympy import integer_nthroot
def A376279(n):
def f(x): return n-1+x-x//3-integer_nthroot(x, 3)[0]+integer_nthroot(x//27, 3)[0]
m, k = n-1, f(n-1)
while m != k: m, k = k, f(k)
return m
(Python)
from itertools import count, islice
from sympy import integer_nthroot
def A376279_gen(startvalue=0): # generator of terms >= startvalue
return filter(lambda k:not k%3 or integer_nthroot(k, 3)[1], count(max(startvalue, 0)))
(PARI) isok(k) = ispower(k^k, 3); \\ Michel Marcus, Sep 18 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Chai Wah Wu, Sep 18 2024
STATUS
approved