OFFSET
1,2
COMMENTS
All the primes are terms.
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
EXAMPLE
1 * 2 = 2^1 and 1 = 2^0.
1 * 2 * 3 = 6 = 2^1 * 3^1 and 1 = 2^0.
1 * 2 * 3 * 5 * 6 = 180 = 2^2 * 3^2 * 5^1, 1 = 2^0 and 2 = 2^1.
MATHEMATICA
expPow2Q[n_] := AllTrue[FactorInteger[n][[;; , 2]], # == 2^IntegerExponent[#, 2] &]; a[1] = 1; a[n_] := a[n] = Module[{prod = Times @@ Array[a, n - 1], k = a[n - 1] + 1}, While[! expPow2Q[prod*k], k++]; k]; Array[a, 100]
PROG
(PARI) ispow2(n) = if(n == 0, 1, n >> valuation(n, 2) == 1);
lista(pindmax) = {my(pmax = prime(pindmax), v = vector(pindmax), f, pind, prd); print1(1, ", "); for(k = 2, pmax, f = factor(k); pind = apply(x -> primepi(x), f[, 1]); for(i = 1, #pind, v[pind[i]] += f[i, 2]); if(vecprod(apply(x -> ispow2(x), v)) > 0, print1(k, ", "), for(i = 1, #pind, v[pind[i]] -= f[i, 2]))); }
CROSSREFS
Similar sequences:
Sequence | Partial products are in | Exponents are in
--------------+-------------------------+------------------------
KEYWORD
nonn
AUTHOR
Amiram Eldar, Sep 24 2024
STATUS
approved