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

%I #20 Aug 09 2016 15:25:25

%S 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,

%T 14,30,15,32,16,33,17,35,18,38,19,39,20,42,21,44,22,45,23,48,24,49,25,

%U 51,26,54,27,55,28,57,29,60,30,62,31,63,32,65,33,68,34,69,35,72,36,74,37

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

%H Harvey P. Dale, <a href="/A082928/b082928.txt">Table of n, a(n) for n = 1..1000</a>

%F a(n) = A026741(n) + A010051(n), for n>2; with a(1) = 1, a(2) = 3. - _Wesley Ivan Hurt_, Oct 04 2014

%t Join[{1, 3}, Table[Numerator[n/2] + Boole[PrimeQ[n]], {n, 3, 50}]] (* _Wesley Ivan Hurt_, Oct 04 2014 *)

%t Table[Which[PrimeQ[n],n+1,EvenQ[n],n/2,True,n],{n,80}] (* _Harvey P. Dale_, Aug 09 2016 *)

%o (PARI) a(n)={if(isprime(n),n+1,if(n%2,n,n/2))}

%Y Cf. A010051, A026741.

%K easy,nonn

%O 1,2

%A _Cino Hilliard_, May 26 2003

%E Edited by _Charles R Greathouse IV_, Oct 09 2009

%E Offset corrected by _Thomas Ordowski_, Oct 03 2014

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 24 20:08 EDT 2024. Contains 371963 sequences. (Running on oeis4.)