OFFSET
1,2
COMMENTS
This sequence is closed under multiplication.
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
FORMULA
Sum_{n>=1} 1/a(n) = 7/4.
EXAMPLE
a(2) = 4 = 2^2.
a(3) = 8 = 2^3.
a(8)= 36 = 2^2 * 3^2.
MATHEMATICA
q[n_] := Module[{e = IntegerExponent[n, {2, 3}]}, e[[1]] != 1 && e[[2]] != 1 && Times@@({2, 3}^e) == n]; Select[Range[12000], q]
PROG
(PARI) is(n) = {my(f=factor(n)); n == 1 || (vecmax(f[, 1]) <= 3 && vecmin(f[, 2]) > 1)};
(Python)
from itertools import count, takewhile
def aupto(lim):
pows2 = list(takewhile(lambda x: x<lim, (2**i for i in count(2))))
pows3 = list(takewhile(lambda x: x<lim, (3**i for i in count(2))))
return sorted(c*d for c in [1]+pows2 for d in [1]+pows3 if c*d <= lim)
print(aupto(12000)) # Michael S. Branicky, Jul 08 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Amiram Eldar, Jul 08 2022
STATUS
approved