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.
%I A282028 #24 Jan 20 2023 21:54:52 %S A282028 0,1,4,6,2,10,3,14,5,7,8,22,9,26,11,12,13,34,15,38,16,17,18,46,19,20, %T A282028 21,23,24,58,25,62,27,28,29,30,31,74,32,33,35,82,36,86,37,39,40,94,41, %U A282028 42,43,44,45,106,47,48,49,50,51,118,52,122,53,54,55,56,57,134,59,60,61,142,63,146,64,65 %N A282028 If n is prime then a(n) = 2n, otherwise a(n) is the smallest missing number. %H A282028 N. J. A. Sloane, <a href="/A282028/b282028.txt">Table of n, a(n) for n = 0..10000</a> %F A282028 If n is prime, a(n) = 2n, and these points line on the upper straight line in the graph. %F A282028 If n is not a prime, after n terms we have seen all the numbers from 0 through a(n) and also the doubles of all the primes p in the range a(n)/2 < p < n. %F A282028 So n = a(n) + pi(n) - pi(a(n)/2). In other words, if n is not a prime then a(n) is the unique solution to a(n) - pi(a(n)/2) = n - pi(n). %F A282028 This implies that if n is not a prime, a(n) = n*(1 - 1/(2*log(n)) + o(1/log(n))). %F A282028 These are the points on the lower line, which is not straight but has slope roughly equal to 1. %o A282028 (PARI) first(n) = { my(res = vector(n), i = 1); for(x=1, n-1, if(isprime(x), res[x+1] = 2*x, if(setsearch(Set(res), i), i++); res[x+1]=i; i++)); res; } \\ _Iain Fox_, Nov 18 2017 %Y A282028 Cf. A000720, A127202, A143545, A280985, A282029. %K A282028 nonn %O A282028 0,3 %A A282028 _N. J. A. Sloane_, Feb 16 2017