OFFSET
1,2
COMMENTS
Conjectured to be a permutation of the positive integers in which the primes appear in order. The even bisection, when divided by 2 reproduces the sequence. Has similar properties to the Doudna sequence, A005940.
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..16384
Michael De Vlieger, Annotated fan-style binary tree of a(n), n = 1..2^14, with row m = 2^m..2^(m+1)-1 with a heat map color function showing row minima in blue, larger terms in greens, and row maxima in red.
FORMULA
a(2^m - 1) = prime(m) for m >= 2.
a(2*n)/2 = a(n) for n >= 1.
EXAMPLE
5 = 2^3 - 3 so a(5)=a(3)*3=9.
13 = 2^4 - 3 and a(3)=3 so a(13)=3*7=21 since 9 and 15 have appeared already.
17 = 2^5 - 15 and a(15)=7 so a(17)=5*7=35 (since 21=3*7 has appeared already).
MATHEMATICA
nn = 65; c[_] = False; Do[Set[{m, k}, {2, 2^(Ceiling[Log2[n]]) - n}]; If[k == 0, Set[{a[n], c[n]}, {n, True}], While[Set[t, Prime[m] a[k]]; c[t], m++]; Set[{a[n], c[t]}, {t, True}]], {n, nn}]; Array[a, nn] (* Michael De Vlieger, Sep 02 2022 *)
PROG
(PARI) first(n) = { my(res = vector(n), m = Map()); for(i = 1, n, qd = ceil(log(i)/log(2)); nextp = 1<<qd; if(nextp == i, res[i] = i , k = res[nextp - i]; forprime(p = 3, oo, if(!mapisdefined(m, k*p), res[i] = k*p; mapput(m, k*p, 1); next(2) ) ) ) ); res } \\ David A. Corneth and Michel Marcus, Sep 13 2022
(Python)
from itertools import count, islice
from sympy import nextprime
def A356886_gen(): # generator of terms
aset, alist = {1}, [1]
yield 1
for n in count(2):
if k:=(0 if (i:=1<<n.bit_length())==n<<1 else i-n):
p, m = 3, alist[k-1]
while p*m in aset:
p = nextprime(p)
r = p*m
else:
r = n
alist.append(r)
aset.add(r)
yield r
CROSSREFS
KEYWORD
nonn
AUTHOR
David James Sycamore, Sep 02 2022
EXTENSIONS
More terms from David A. Corneth, Sep 02 2022
STATUS
approved