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);
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
R. Zumkeller, Table of n, a(n) for n = 1..10000
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
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, May 11 2003
STATUS
approved