OFFSET
1,2
COMMENTS
Based on a similar recursion to that which produces the Doudna sequence, A005940. Conjectured to be permutation of the positive integers in which the primes appear in natural order.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..10000
Michael De Vlieger, Fan style binary tree showing a(n), n = 1..2^13, with a color function representing primes in red, proper prime powers in gold, squarefree composites in green, and numbers neither squarefree nor prime powers in blue and magenta, where the latter also represents powerful numbers that are not prime powers.
Michael De Vlieger, Log log scatterplot of a(n), n = 1..10000, using the same color function as immediately above.
Rémy Sigrist, PARI program
FORMULA
a(2^n + 1) = prime(n + 1); n >= 0
EXAMPLE
a(9)=7 because k=1, and a(1)=1, which has 1 divisor, so we are looking for the smallest number not yet seen which has 2 divisors. This must be 7 because 2,3,5 have occurred already.
MATHEMATICA
nn = 70; kk = 2^20; c[_] = False; to = Map[DivisorSigma[0, #] &, Range[kk]^2]; t = DivisorSigma[0, Range[kk]]; Do[Set[{m, k}, {1, n - 2^Floor[Log2[n]]}]; If[k == 0, Set[{a[n], c[n]}, {n, True}], d = 1 + DivisorSigma[0, a[k]]; If[OddQ[d], While[Nand[! c[m^2], to[[m]] == d], m++]; Set[{a[n], c[#]}, {#, True}] &[m^2], While[Nand[! c[m], t[[m]] == d], m++]; Set[{a[n], c[m]}, {m, True}]] ], {n, nn}]; Array[a, nn] (* Michael De Vlieger, Oct 05 2022 *)
PROG
(PARI) \\ See Links section.
CROSSREFS
KEYWORD
nonn
AUTHOR
David James Sycamore, Oct 05 2022
STATUS
approved
