OFFSET
1,2
COMMENTS
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..4370
EXAMPLE
The numbers of 3-smooth divisors of the first 6 positive integers are 1, 3, 4, 7, 1 and 12. The corresponding values of A072079(k)/k are 1, 3/2, 4/3, 7/4, 1/5 and 2. The record values, 1, 3/2, 7/4 and 2, occur at 1, 2, 4 and 6, the first 4 terms of this sequence.
MATHEMATICA
s[n_] := Module[{e = IntegerExponent[n, {2, 3}], p}, p = {2, 3}^e; If[Times @@ p == n, (2^(e[[1]] + 1) - 1)*(3^(e[[2]] + 1) - 1)/(2*n), 0]]; sm = 0; seq = {}; Do[sn = s[n]; If[sn > sm, sm = sn; AppendTo[seq, n]], {n, 1, 10^6}]; seq
PROG
(PARI) lista(nmax) = {my(list = List(), rmax = 0, e2, e3, r); for(n = 1, nmax, e2 = valuation(n, 2); e3 = valuation(n, 3); r = if(2^e2 * 3^e3 == n, (2^(e2 + 1) - 1)*(3^(e3 + 1) - 1)/(2*n), 0); if(r > rmax, rmax = r; listput(list, n))); Vec(list)};
(Python)
from fractions import Fraction
from sympy import multiplicity as v
from itertools import count, takewhile
def f(n): return Fraction((2**(v(2, n)+1)-1) * (3**(v(3, n)+1)-1)//2, n)
def smooth3(lim):
pows2 = list(takewhile(lambda x: x<lim, (2**i for i in count(0))))
pows3 = list(takewhile(lambda x: x<lim, (3**i for i in count(0))))
return sorted(c*d for c in pows2 for d in pows3 if c*d <= lim)
def aupto(lim):
data, records, record = smooth3(lim), [], -1
for argv, v in zip(data, map(f, data)):
if v > record: record = v; records.append(argv)
return records
print(aupto(10**9)) # Michael S. Branicky, Jul 08 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Amiram Eldar, Jul 08 2022
STATUS
approved