OFFSET
1,2
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
FORMULA
MATHEMATICA
Join[{1, 3}, Table[Numerator[n/2] + Boole[PrimeQ[n]], {n, 3, 50}]] (* Wesley Ivan Hurt, Oct 04 2014 *)
Table[Which[PrimeQ[n], n+1, EvenQ[n], n/2, True, n], {n, 80}] (* Harvey P. Dale, Aug 09 2016 *)
PROG
(PARI) a(n)={if(isprime(n), n+1, if(n%2, n, n/2))}
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Cino Hilliard, May 26 2003
EXTENSIONS
Edited by Charles R Greathouse IV, Oct 09 2009
Offset corrected by Thomas Ordowski, Oct 03 2014
STATUS
approved