cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A340716 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).

This page as a plain text file.
%I A340716 #11 Jan 22 2021 14:17:29
%S A340716 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 A340716 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 A340716 5,11,6,4,17,14,12,10,15,8,2,18,7,9,19,16,3
%N A340716 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 A340716 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 A340716 This sequence has similarities with A003602 (A003602(2*n) = A003602(n)) and with A163491 (A163491(n+ceiling(n/2)) = A163491(n)).
%H A340716 Rémy Sigrist, <a href="/A340716/b340716.txt">Table of n, a(n) for n = 1..10000</a>
%F A340716 a(n) = 2 iff n belongs to A061535.
%F A340716 a(A095116(n)) = n + 1.
%e A340716 The first terms, alongside n + pi(n), are:
%e A340716   n   a(n)  n + pi(n)
%e A340716   --  ----  ---------
%e A340716    1     1          1
%e A340716    2     2          3
%e A340716    3     2          5
%e A340716    4     3          6
%e A340716    5     2          8
%e A340716    6     3          9
%e A340716    7     4         11
%e A340716    8     2         12
%e A340716    9     3         13
%e A340716   10     5         14
%e A340716   11     4         16
%e A340716   12     2         17
%o A340716 (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 A340716 See A003602, A163491 and A340717 for similar sequences.
%Y A340716 Cf. A000720, A095117.
%K A340716 nonn,look
%O A340716 1,2
%A A340716 _Rémy Sigrist_, Jan 17 2021