OFFSET
1,2
COMMENTS
The prime tower factorization of a number can be recursively defined as follows:
(0) The prime tower factorization of 1 is itself
(1) To find the prime tower factorization of an integer n>1, let n = p1^e1 * p2^e2 * ... * pk^ek be the usual prime factorization of n. Then the prime tower factorization is given by p1^(f1) * p2^(f2) * ... * pk^(fk), where fi is the prime tower factorization of ei.
As an alternative definition, let I(n) be the indicator function for the set of positive integers whose prime tower factorization does not contain a 3. Then I(n) is the multiplicative function satisfying I(p^k) = I(k) for p prime not equal to 3, and I(3^k) = 0.
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
Patrick Devlin and Edinah Gnang, Primes Appearing in Prime Tower Factorization, arXiv:1204.5251 [math.NT], 2012-2014.
MAPLE
# The integer n is in this sequence if and only if
# containsPrimeInTower(3, n) returns false
containsPrimeInTower:=proc(q, n) local i, L, currentExponent; option remember;
if n <= 1 then return false: end if;
if type(n/q, integer) then return true: end if;
L := ifactors(n)[2];
for i to nops(L) do currentExponent := L[i][2];
if containsPrimeInTower(q, currentExponent) then return true: end if
end do;
return false:
end proc:
select(x-> not containsPrimeInTower(3, x), [$1..120])[];
MATHEMATICA
indic[1] = 1; indic[n_] := indic[n] = Switch[f = FactorInteger[n], {{3, _}}, 0, {{_, _}}, indic[f[[1, 2]] ], _, Times @@ (indic /@ (Power @@@ f))]; Select[Range[120], indic[#] == 1&] (* Jean-François Alcover, Feb 25 2018 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Patrick Devlin, Apr 25 2012
STATUS
approved