login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A082500
a(n) = ceiling(n/2) if n is odd, or prime(n/2) otherwise.
3
1, 2, 2, 3, 3, 5, 4, 7, 5, 11, 6, 13, 7, 17, 8, 19, 9, 23, 10, 29, 11, 31, 12, 37, 13, 41, 14, 43, 15, 47, 16, 53, 17, 59, 18, 61, 19, 67, 20, 71, 21, 73, 22, 79, 23, 83, 24, 89, 25, 97, 26, 101, 27, 103, 28, 107, 29, 109, 30, 113, 31, 127, 32, 131, 33, 137, 34, 139, 35, 149, 36
OFFSET
1,2
COMMENTS
Alternatively, list of pairs n, prime(n). - Zak Seidov, Feb 18 2005
a(n) = (n mod 2)*(n+1)/2 + (1 - n mod 2)*A000040(n/2);
k>0: a(2*k-1)=k, a(2*k)=A000040(k), A049084(a(2*k))=k; a(2*k-1)+a(2*k)=A014688(k).
Each prime occurs at two positions, the distances between them are: 1, 1, 3, 5, 11, 13, 19, 21, 27, 37, 39, 49, 55, 57, 63, 73, 83, 85, ... - Zak Seidov, Mar 06 2011
See A239636. - Reinhard Zumkeller, Mar 22 2014
LINKS
MATHEMATICA
s=Range[500]; Do[s=Insert[s, Prime[n], 2n], {n, 100}]; s (* Zak Seidov Mar 05 2011 *)
PROG
(Haskell)
import Data.List (transpose)
a082500 n = a082500_list !! (n-1)
a082500_list = concat $ transpose [[1..], a000040_list]
-- Reinhard Zumkeller, Mar 22 2014, Mar 19 2011, Oct 14 2010
(Magma) [IsOdd(n) select Ceiling(n/2) else NthPrime(n div 2): n in[1..71]]; // Bruno Berselli, Mar 07 2011
CROSSREFS
A000027 and A000040 interleaved. - Omar E. Pol, Mar 13 2012
Sequence in context: A361178 A307993 A114092 * A194451 A059292 A115000
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, May 11 2003
STATUS
approved