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!)
A014693 In sequence of prime numbers add 1 to first number, 2 to 3rd number, 3 to 5th number, ... then subtract 1 from 2nd number, 2 from 4th number, 3 from 6th number and so on. 1

%I #19 Sep 08 2022 08:44:39

%S 3,2,7,5,14,10,21,15,28,24,37,31,48,36,55,45,68,52,77,61,84,68,95,77,

%T 110,88,117,93,124,98,143,115,154,122,167,133,176,144,187,153,200,160,

%U 213,171,220,176,235,199,252,204,259,213,268,224,285,235,298,242,307

%N In sequence of prime numbers add 1 to first number, 2 to 3rd number, 3 to 5th number, ... then subtract 1 from 2nd number, 2 from 4th number, 3 from 6th number and so on.

%H Vincenzo Librandi, <a href="/A014693/b014693.txt">Table of n, a(n) for n = 1..10000</a>

%o (PARI) a(n) = if (n % 2, prime(n) + ceil(n/2), prime(n) - ceil(n/2)); \\ _Michel Marcus_, Nov 18 2018

%o (Magma) [IsOdd(n) select (NthPrime(n)+Ceiling(n/2)) else (NthPrime(n)- Ceiling(n/2)): n in [1..70]]; // _Vincenzo Librandi_, Nov 18 2018

%K nonn,easy

%O 1,1

%A _Mohammad K. Azarian_

%E More terms from _James A. Sellers_

%E Title corrected by _Sean A. Irvine_, Nov 17 2018

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 23 16:40 EDT 2024. Contains 371916 sequences. (Running on oeis4.)