%I #20 Sep 20 2024 06:06:09
%S 0,1,3,6,8,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60,63,64,
%T 66,69,72,75,78,81,84,87,90,93,96,99,102,105,108,111,114,117,120,123,
%U 125,126,129,132,135,138,141,144,147,150,153,156,159,162,165,168
%N Numbers k such that k^k is a cube.
%C Strict subsequence of A267415. For instance, 76, 112, 172, 364, 427, 532 are not terms of this sequence, but are terms of A267415.
%F k is a term if and only if k is a multiple of 3 or k is a cube.
%p q:= n-> andmap(i-> irem(n*i[2], 3)=0, ifactors(n)[2]):
%p select(q, [$0..200])[]; # _Alois P. Heinz_, Sep 19 2024
%t Join[{0},Select[Range[170], IntegerQ[#^(#/3)] &]] (* _Stefano Spezia_, Sep 18 2024 *)
%o (Python)
%o from sympy import integer_nthroot
%o def A376279(n):
%o def f(x): return n-1+x-x//3-integer_nthroot(x,3)[0]+integer_nthroot(x//27,3)[0]
%o m, k = n-1, f(n-1)
%o while m != k: m, k = k, f(k)
%o return m
%o (Python)
%o from itertools import count, islice
%o from sympy import integer_nthroot
%o def A376279_gen(startvalue=0): # generator of terms >= startvalue
%o return filter(lambda k:not k%3 or integer_nthroot(k,3)[1],count(max(startvalue,0)))
%o A376279_list = list(islice(A376279_gen(),30))
%o (PARI) isok(k) = ispower(k^k, 3); \\ _Michel Marcus_, Sep 18 2024
%Y Cf. A267415, A371587.
%Y Union of A000578 and A008585.
%K nonn
%O 1,3
%A _Chai Wah Wu_, Sep 18 2024