login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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:
R; # Robert Israel, Apr 10 2024
CROSSREFS
Cf. A026239.
Sequence in context: A368358 A114602 A110000 * A201945 A362974 A258827
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Aug 19 2002
EXTENSIONS
Extended by Ray Chandler, Apr 09 2014
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 4 13:55 EDT 2024. Contains 372243 sequences. (Running on oeis4.)