%I #11 Jan 22 2021 14:17:29
%S 1,2,2,3,2,3,4,2,3,5,4,2,3,5,6,4,2,7,3,5,6,4,8,2,7,9,3,5,6,4,10,8,2,7,
%T 9,3,5,11,6,4,12,10,8,2,7,9,3,13,5,11,6,4,14,12,10,15,8,2,7,9,16,3,13,
%U 5,11,6,4,17,14,12,10,15,8,2,18,7,9,19,16,3
%N Lexicographically earliest sequence of positive integers with as many distinct values as possible such that for any n > 0, a(n + pi(n)) = a(n) (where pi(n) = A000720(n) corresponds to the number of prime numbers <= n).
%C The condition "with as many distinct values as possible" means here that for any distinct m and n, provided the orbits of m and n under the map x -> x + pi(x) do not merge, then a(m) <> a(n).
%C This sequence has similarities with A003602 (A003602(2*n) = A003602(n)) and with A163491 (A163491(n+ceiling(n/2)) = A163491(n)).
%H Rémy Sigrist, <a href="/A340716/b340716.txt">Table of n, a(n) for n = 1..10000</a>
%F a(n) = 2 iff n belongs to A061535.
%F a(A095116(n)) = n + 1.
%e The first terms, alongside n + pi(n), are:
%e n a(n) n + pi(n)
%e -- ---- ---------
%e 1 1 1
%e 2 2 3
%e 3 2 5
%e 4 3 6
%e 5 2 8
%e 6 3 9
%e 7 4 11
%e 8 2 12
%e 9 3 13
%e 10 5 14
%e 11 4 16
%e 12 2 17
%o (PARI) u=0; for (n=1, #a=vector(80), if (a[n]==0, a[n]=u++); print1 (a[n]", "); m=n+primepi(n); if (m<=#a, a[m]=a[n]))
%Y See A003602, A163491 and A340717 for similar sequences.
%Y Cf. A000720, A095117.
%K nonn,look
%O 1,2
%A _Rémy Sigrist_, Jan 17 2021
|