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!)
A082500 a(n) = ceiling(n/2) if n is odd, or prime(n/2) otherwise. 3

%I #26 Sep 08 2022 08:45:10

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

%T 43,15,47,16,53,17,59,18,61,19,67,20,71,21,73,22,79,23,83,24,89,25,97,

%U 26,101,27,103,28,107,29,109,30,113,31,127,32,131,33,137,34,139,35,149,36

%N a(n) = ceiling(n/2) if n is odd, or prime(n/2) otherwise.

%C Alternatively, list of pairs n, prime(n). - _Zak Seidov_, Feb 18 2005

%C a(n) = (n mod 2)*(n+1)/2 + (1 - n mod 2)*A000040(n/2);

%C 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).

%C 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

%C See A239636. - _Reinhard Zumkeller_, Mar 22 2014

%H R. Zumkeller, <a href="/A082500/b082500.txt">Table of n, a(n) for n = 1..10000</a>

%t s=Range[500];Do[s=Insert[s,Prime[n],2n],{n,100}];s (* Zak Seidov Mar 05 2011 *)

%o (Haskell)

%o import Data.List (transpose)

%o a082500 n = a082500_list !! (n-1)

%o a082500_list = concat $ transpose [[1..], a000040_list]

%o -- _Reinhard Zumkeller_, Mar 22 2014, Mar 19 2011, Oct 14 2010

%o (Magma) [IsOdd(n) select Ceiling(n/2) else NthPrime(n div 2): n in[1..71]]; // _Bruno Berselli_, Mar 07 2011

%Y A000027 and A000040 interleaved. - _Omar E. Pol_, Mar 13 2012

%K nonn

%O 1,2

%A _Reinhard Zumkeller_, May 11 2003

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 25 06:35 EDT 2024. Contains 371964 sequences. (Running on oeis4.)