OFFSET
1,2
COMMENTS
This sequence is a permutation of the positive integers.
a(2^(p+1)) = p, where p is prime. - Michael De Vlieger, Dec 07 2022
LINKS
Ivan Neretin, Table of n, a(n) for n = 1..10000
Michael De Vlieger, Log log scatterplot of a(n), n = 1..2^14, showing primes in red, composite prime powers (in A246547) in gold, squarefree composites (A120944) in green, numbers neither prime power nor squarefree (A126706) in blue, with numbers in A286708 in large light blue. Highlighted in light green are squarefree composites divisible by 6.
EXAMPLE
8 has 4 positive divisors. So a(8) is the smallest positive multiple of 4 that has yet to appear in the sequence. 4 and 8 occur among the first 7 terms of the sequence, but 12 does not. So a(8) = 12.
MAPLE
A128555 := proc(nmin) local a, n, d, k ; a := [1, 2] ; while nops(a) < nmin do n := nops(a)+1 ; d := numtheory[tau](n) ; k := 1; while k*d in a do k := k+1 ; od; a := [op(a), k*d] ; od: RETURN(a) ; end: A128555(80) ; # R. J. Mathar, Oct 09 2007
MATHEMATICA
a = {1}; Do[AppendTo[a, Min[Complement[Range[Max[a] + 1]*DivisorSigma[0, n], a]]], {n, 2, 68}]; a (* Ivan Neretin, May 03 2015 *)
nn = 120; c[_] = False; q[_] = 1; Do[d = DivisorSigma[0, n]; m = q[d]; While[c[m d], m++]; If[m == q[d], While[c[m d], m++]; q[d] = m]; Set[{a[n], c[m d]}, {m d, True}], {n, nn}]; Array[a, nn] (* Michael De Vlieger, Dec 07 2022 *)
PROG
(Python)
from itertools import count, islice
from sympy import divisor_count as d
def agen():
seen = set()
for n in count(1):
dn = d(n)
m = dn
while m in seen: m += dn
yield m
seen.add(m)
print(list(islice(agen(), 68))) # Michael S. Branicky, Dec 08 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Mar 10 2007
EXTENSIONS
More terms from R. J. Mathar, Oct 09 2007
STATUS
approved