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”).

A259182
a(n) = prime(n) if n prime otherwise 1.
0
1, 3, 5, 1, 11, 1, 17, 1, 1, 1, 31, 1, 41, 1, 1, 1, 59, 1, 67, 1, 1, 1, 83, 1, 1, 1, 1, 1, 109, 1, 127, 1, 1, 1, 1, 1, 157, 1, 1, 1, 179, 1, 191, 1, 1, 1, 211, 1, 1, 1, 1, 1, 241, 1, 1, 1, 1, 1, 277, 1, 283, 1, 1, 1, 1, 1, 331, 1, 1, 1, 353, 1, 367, 1, 1, 1, 1
OFFSET
1,2
COMMENTS
The subsequence of prime terms is A006450.
EXAMPLE
a(7) = 17 because prime(7) = 17 is prime.
a(8) = 1 because 8 is not prime.
MATHEMATICA
Table[If[! PrimeQ[n], 1, Prime[n]], {n, 100}]
PROG
(Magma) [IsPrime(n) select NthPrime(n) else 1: n in [1..100]];
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vincenzo Librandi, Jun 20 2015
STATUS
approved