login
Lexicographically earliest sequence of positive integers such that for any n > 0, there is an even number of k's such that 1 <= k < n and a(n) divides a(k).
1

%I #8 Oct 01 2024 08:46:38

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

%T 1,5,1,11,1,12,1,2,1,3,1,4,1,2,1,6,1,2,1,3,1,13,1,14,1,2,1,7,1,15,1,3,

%U 1,5,1,16,1,2,1,4,1,2,1,8,1,2,1,4,1,2,1

%N Lexicographically earliest sequence of positive integers such that for any n > 0, there is an even number of k's such that 1 <= k < n and a(n) divides a(k).

%C The sequence is well defined as we can always extend it with a number greater than any prior term.

%H Rémy Sigrist, <a href="/A376566/b376566.txt">Table of n, a(n) for n = 1..10000</a>

%F a(2*k-1) = 1 for any k > 0.

%F a(2*A025523(n-1)) = n for any n > 1 (and this is the first occurrence of n in the sequence). - _Hugo Pfoertner_, Oct 01 2024

%e The first terms, alongside the corresponding k's, are:

%e n a(n) k's

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

%e 1 1 None

%e 2 2 None

%e 3 1 1, 2

%e 4 3 None

%e 5 1 1, 2, 3, 4

%e 6 4 None

%e 7 1 1, 2, 3, 4, 5, 6

%e 8 2 2, 6

%e 9 1 1, 2, 3, 4, 5, 6, 7, 8

%e 10 5 None

%e 11 1 1, 2, 3, 4, 5, 6, 7, 8, 9, 10

%e 12 6 None

%e 13 1 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12

%e 14 2 2, 6, 8, 12

%e 15 1 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14

%e 16 3 4, 12

%o (PARI) { nb = vector(16); for (n = 1, 86, for (v = 1, oo, if (nb[v]%2==0, print1 (v ", "); fordiv (v, d, nb[d]++;); break;););); }

%Y Cf. A025523.

%K nonn

%O 1,2

%A _Rémy Sigrist_, Sep 28 2024