login

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 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A068519
If n is prime then a(n) = n, else a(n) = prime(n).
7
2, 2, 3, 7, 5, 13, 7, 19, 23, 29, 11, 37, 13, 43, 47, 53, 17, 61, 19, 71, 73, 79, 23, 89, 97, 101, 103, 107, 29, 113, 31, 131, 137, 139, 149, 151, 37, 163, 167, 173, 41, 181, 43, 193, 197, 199, 47, 223, 227, 229, 233, 239, 53, 251, 257, 263, 269, 271, 59, 281, 61, 293
OFFSET
1,1
EXAMPLE
a(1) = 2 because 1 is not prime, hence a(1) = prime(1) = 2.
a(2) = 2 because 2 is prime.
MAPLE
seq(`if`(isprime(i), i, ithprime(i)), i=1..100);
MATHEMATICA
Table[If[PrimeQ[n], n, Prime[n]], {n, 1, 200}] (* Zak Seidov, Nov 04 2009 *)
CROSSREFS
Sequence in context: A354377 A051301 A002583 * A342848 A339826 A108041
KEYWORD
nonn,easy
AUTHOR
Francois Jooste (phukraut(AT)hotmail.com), Mar 18 2002
EXTENSIONS
More terms, b-file and Mathematica code from Zak Seidov, Nov 04 2009
STATUS
approved