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

 

Logo

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 56th year, we are closing in on 350,000 sequences, and we’ve crossed 9,700 citations (which often say “discovered thanks to the OEIS”).

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A236675 If n is prime, then a(n) is the least composite number not occurring earlier, else a(n) is the least prime not occurring earlier. 3
2, 4, 6, 3, 8, 5, 9, 7, 11, 13, 10, 17, 12, 19, 23, 29, 14, 31, 15, 37, 41, 43, 16, 47, 53, 59, 61, 67, 18, 71, 20, 73, 79, 83, 89, 97, 21, 101, 103, 107, 22, 109, 24, 113, 127, 131, 25, 137, 139, 149, 151, 157, 26, 163, 167, 173, 179, 181, 27, 191, 28, 193 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

COMMENTS

If "composite" is replaced by "nonprime", one gets A026234, a permutation of the integers.

LINKS

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

FORMULA

a(n) = A002808(A000720(n)) if n is prime, a(n) = A000040(n-A000720(n)) else.

PROG

(PARI) A236675=n->if(isprime(n), A002808(primepi(n)), prime(n-primepi(n)))

(PARI) c=p=1; vector(99, n, if(isprime(n), while(isprime(c++), ); c, p=nextprime(p+1)))

CROSSREFS

Cf. A026234, A002808, A018252, A097457, A236675.

Sequence in context: A278376 A057336 A340646 * A210771 A115316 A089088

Adjacent sequences:  A236672 A236673 A236674 * A236676 A236677 A236678

KEYWORD

nonn

AUTHOR

M. F. Hasler, Jan 29 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 | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified December 2 13:15 EST 2021. Contains 349444 sequences. (Running on oeis4.)