

A283312


a(n) = smallest missing positive number, unless a(n1) was a prime in which case a(n)=2*a(n1).


4



1, 2, 4, 3, 6, 5, 10, 7, 14, 8, 9, 11, 22, 12, 13, 26, 15, 16, 17, 34, 18, 19, 38, 20, 21, 23, 46, 24, 25, 27, 28, 29, 58, 30, 31, 62, 32, 33, 35, 36, 37, 74, 39, 40, 41, 82, 42, 43, 86, 44, 45, 47, 94, 48, 49, 50, 51, 52, 53, 106, 54, 55, 56, 57, 59, 118, 60, 61, 122, 63, 64, 65, 66, 67, 134, 68, 69
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,2


COMMENTS

A toy model of A280864, A280985, and A127202.


LINKS

N. J. A. Sloane, Table of n, a(n) for n = 1..75000


FORMULA

Suppose a(n)=x, where x is neither a prime nor twice a prime. Then if 2p, p prime, is in the range x/2 <= 2p <= x, 2p has appeared in the sequence instead of p, which is missing. Therefore we have the identity
n = x + pi(x)  pi(x/2). ... (1)
If a(n) = x = a prime, then (1) is replaced by
n = x + pi(x)  pi(x/2)  1. ... (2)
If a(n) = x = twice a prime then
n1 = x/2 + pi(x/2)  pi(x/4). ... (3)
These equations imply that the lower line in the graph of the sequence is
x approx= n(1  1/(2 log n)) ... (4)
while the upper line is
x approx= 2n(1  1/(2 log n)). ... (5)


MAPLE

a:=[1];
H:=Array(1..1000, 0); MMM:=1000;
H[1]:=1; smn:=2; t:=2;
for n from 2 to 100 do
if t=smn then a:=[op(a), t]; H[t]:=1;
if isprime(t) then a:=[op(a), 2*t]; H[2*t]:=1; fi;
t:=t+1;
# update smallest missing number smn
for i from smn+1 to MMM do if H[i]=0 then smn:=i; break; fi; od;
else t:=t+1;
fi;
od:
a;


CROSSREFS

Cf. A127202, A280864, A280985.
Sequence in context: A300002 A082560 A191598 * A280985 A127202 A179869
Adjacent sequences: A283309 A283310 A283311 * A283313 A283314 A283315


KEYWORD

nonn


AUTHOR

N. J. A. Sloane, Mar 08 2017


STATUS

approved



