login
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