login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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
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
Sequence in context: A154570 A145961 A369557 * A139524 A247413 A108127
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

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 17:51 EDT 2024. Contains 371797 sequences. (Running on oeis4.)