login
Lexicographically earliest sequence of positive integers such that the values a(floor(n/2)) * a(n) are all distinct.
2

%I #15 Sep 29 2022 03:25:47

%S 1,2,2,3,4,5,1,3,3,4,1,3,7,11,6,7,8,9,5,7,13,14,10,11,5,6,2,4,6,8,7,8,

%T 4,5,5,6,5,10,9,10,2,3,6,7,6,8,5,6,13,15,12,13,17,19,13,16,15,16,11,

%U 13,11,13,14,15,17,19,17,19,20,21,17,18,22,23,13

%N Lexicographically earliest sequence of positive integers such that the values a(floor(n/2)) * a(n) are all distinct.

%C See A357379 for the corresponding products.

%C The sequence is well defined; we can always extend it with a value strictly greater than the square of the greatest value so far.

%C The sequence is unbounded (otherwise we could only have a finite number of products a(floor(n/2)) * a(n), and therefore a finite number of terms).

%C For any prime number p: the first term >= p is p.

%C All prime numbers appear in the sequence.

%C If a(n) is the first occurrence of some prime number p, then a(m) = 1 for some m in the interval floor(n/2)..2*n.

%C There are infinitely many 1's in the sequence; as a consequence, every positive integer appears in A357379.

%H Rémy Sigrist, <a href="/A357378/b357378.txt">Table of n, a(n) for n = 0..10000</a>

%H Rémy Sigrist, <a href="/A357378/a357378.png">Density plot of the first 10000000 terms</a>

%H Rémy Sigrist, <a href="/A357378/a357378.txt">C program</a>

%F a(2*n + 1) > a(2*n).

%e The first terms are:

%e n a(n) a(floor(n/2)) a(floor(n/2))*a(n)

%e -- ---- ------------- ------------------

%e 0 1 1 1

%e 1 2 1 2

%e 2 2 2 4

%e 3 3 2 6

%e 4 4 2 8

%e 5 5 2 10

%e 6 1 3 3

%e 7 3 3 9

%e 8 3 4 12

%e 9 4 4 16

%e 10 1 5 5

%e 11 3 5 15

%e 12 7 1 7

%o (C) See Links section.

%o (Python)

%o from itertools import count, islice

%o def agen(): # generator of terms

%o alst, disallowed = [1], {1}; yield 1

%o for n in count(1):

%o ahalf, k = alst[n//2], 1

%o while ahalf*k in disallowed: k += 1

%o an = k; yield an; alst.append(an); disallowed.add(ahalf*an)

%o print(list(islice(agen(), 75))) # _Michael S. Branicky_, Sep 26 2022

%Y Cf. A050292 (additive variant), A357379.

%K nonn

%O 0,2

%A _Rémy Sigrist_, Sep 26 2022