login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A163578 If n is prime, a(n) is next composite greater than a(n-1), else if n is composite, a(n) is next prime greater than a(n-1) else 2. 1
2, 4, 6, 7, 8, 11, 12, 13, 17, 19, 20, 23, 24, 29, 31, 37, 38, 41, 42, 43 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

LINKS

Table of n, a(n) for n=1..20.

EXAMPLE

1 is not prime, a(1)=2, 2 is prime, a(2)=4, 3 is prime, a(3)=6, 4 is composite, a(4)=7.

CROSSREFS

Cf. A159559

Sequence in context: A165778 A286066 A139527 * A269389 A092054 A334573

Adjacent sequences:  A163575 A163576 A163577 * A163579 A163580 A163581

KEYWORD

nonn

AUTHOR

Gerald Hillier, Jul 31 2009

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified February 25 14:40 EST 2021. Contains 341609 sequences. (Running on oeis4.)