|
|
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
|
|
|
3, 2, 7, 5, 14, 10, 21, 15, 28, 24, 37, 31, 48, 36, 55, 45, 68, 52, 77, 61, 84, 68, 95, 77, 110, 88, 117, 93, 124, 98, 143, 115, 154, 122, 167, 133, 176, 144, 187, 153, 200, 160, 213, 171, 220, 176, 235, 199, 252, 204, 259, 213, 268, 224, 285, 235, 298, 242, 307
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
PROG
|
(PARI) a(n) = if (n % 2, prime(n) + ceil(n/2), prime(n) - ceil(n/2)); \\ Michel Marcus, Nov 18 2018
(Magma) [IsOdd(n) select (NthPrime(n)+Ceiling(n/2)) else (NthPrime(n)- Ceiling(n/2)): n in [1..70]]; // Vincenzo Librandi, Nov 18 2018
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|