

A082928


If n is prime, a(n) = n+1; if n is even, a(n) = n/2; otherwise a(n) = n.


2



1, 3, 4, 2, 6, 3, 8, 4, 9, 5, 12, 6, 14, 7, 15, 8, 18, 9, 20, 10, 21, 11, 24, 12, 25, 13, 27, 14, 30, 15, 32, 16, 33, 17, 35, 18, 38, 19, 39, 20, 42, 21, 44, 22, 45, 23, 48, 24, 49, 25, 51, 26, 54, 27, 55, 28, 57, 29, 60, 30, 62, 31, 63, 32, 65, 33, 68, 34, 69, 35, 72, 36, 74, 37
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,2


LINKS

Harvey P. Dale, Table of n, a(n) for n = 1..1000


FORMULA

a(n) = A026741(n) + A010051(n), for n>2; with a(1) = 1, a(2) = 3.  Wesley Ivan Hurt, Oct 04 2014


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

Cf. A010051, A026741.
Sequence in context: A322965 A154570 A145961 * A139524 A247413 A108127
Adjacent sequences: A082925 A082926 A082927 * A082929 A082930 A082931


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



