|
|
A073922
|
|
a(1) = 1, a(n) = smallest composite number greater than n and not occurring earlier if n is prime, or smallest prime number greater than n and not occurring earlier if n is composite.
|
|
1
|
|
|
1, 4, 6, 5, 8, 7, 9, 11, 13, 17, 12, 19, 14, 23, 29, 31, 18, 37, 20, 41, 43, 47, 24, 53, 59, 61, 67, 71, 30, 73, 32, 79, 83, 89, 97, 101, 38, 103, 107, 109, 42, 113, 44, 127, 131, 137, 48, 139, 149, 151, 157, 163, 54, 167, 173, 179, 181, 191, 60, 193, 62, 197, 199
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
MAPLE
|
p:= 1: c:= 1: R:= 1:
for n from 2 to 100 do
if isprime(n) then
c:= max(c, n)+1;
while isprime(c) do c:=c+1 od:
R:= R, c
else
p:= nextprime(max(p, n));
R:= R, p
fi
od:
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|