login
A113637
In the sequence of positive integers subtract 1 from each nonprime number.
0
0, 2, 3, 3, 5, 5, 7, 7, 8, 9, 11, 11, 13, 13, 14, 15, 17, 17, 19, 19, 20, 21, 23, 23, 24, 25, 26, 27, 29, 29, 31, 31, 32, 33, 34, 35, 37, 37, 38, 39, 41, 41, 43, 43, 44, 45, 47, 47, 48, 49, 50, 51, 53, 53, 54, 55, 56, 57, 59, 59, 61, 61, 62, 63, 64, 65, 67, 67, 68, 69, 71, 71, 73
OFFSET
1,2
MATHEMATICA
Table[If[PrimeQ[n], n, n-1], {n, 73}] (* James C. McMahon, Jul 07 2024 *)
PROG
(PARI) a(n) = if (isprime(n), n, n-1); \\ Michel Marcus, Jul 08 2024
CROSSREFS
Sequence in context: A091937 A239906 A239907 * A257539 A159050 A363433
KEYWORD
easy,nonn
AUTHOR
Cino Hilliard, Jan 15 2006
STATUS
approved