login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A121053 A sequence S describing the position of its prime terms. 6
2, 3, 5, 1, 7, 8, 11, 13, 10, 17, 19, 14, 23, 29, 16, 31, 37, 20, 41, 43, 22, 47, 53, 25, 59, 27, 61, 30, 67, 71, 73, 33, 79, 35, 83, 38, 89, 97, 40, 101 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

COMMENTS

S reads like this:

"At position 2, there is a prime in S" [indeed, this is 3]

"At position 3, there is a prime in S" [indeed, this is 5]

"At position 5, there is a prime in S" [indeed, this is 7]

"At position 1, there is a prime in S" [indeed, this is 2]

"At position 7, there is a prime in S" [indeed, this is 11]

"At position 8, there is a prime in S" [indeed, this is 13]

"At position 11, there is a prime in S" [indeed, this is 19]

"At position 13, there is a prime in S" [indeed, this is 23]

"At position 10, there is a prime in S" [indeed, this is 17], etc.

S is built with this rule: when you are about to write a term of S, always use the smallest integer not yet present in S and not leading to a contradiction.

Thus one cannot start with 1; this would read: "At position 1, there is a prime number in S" [no, 1 is not a prime]

So start S with 2 and the rest follows smoothly.

S contains all the primes and they appear in their natural order.

Does the ratio primes/composites in S tend to a limit? Answer (from Dean Hickerson): Yes, to 1/2.

Comments from Dean Hickerson, Aug 11 2006: (Start)

In the limit, exactly half of the terms are primes. Here's a formula, found empirically, for a(n) for n >= 5:

Let pi(n) be the number of primes <= n and p(n) be the n-th prime. Then:

- if n is prime or (n is composite and n+pi(n) is even) then a(n) = p(floor((n+pi(n))/2));

- if n is composite and n+pi(n) is odd and n+1 is composite then a(n) = n+1;

- if n is composite and n+pi(n) is odd and n+1 is prime then a(n) = n+2.

Also, for n >= 5, n is in the sequence iff either n is prime or n+pi(n) is even.

(This could all be proved by induction on n.)

It follows from this that, for n >= 4, the number of primes among a(1), ..., a(n) is exactly floor((n+pi(n))/2. Since pi(n)/n -> 0 as n -> infinity, this is asymptotic to n/2. (End)

LINKS

Kerry Mitchell, Table of n, a(n) for n = 1..1000

Eric Angelini, About this sequence

E. Angelini, A sequence describing the position of its prime terms [Cached, with permission]

MATHEMATICA

a[1]=2; a[2]=3; a[3]=5; a[4]=1; a[n_ /; PrimeQ[n] || !PrimeQ[n] && EvenQ[n+PrimePi[n]]] := Prime[Floor[(n+PrimePi[n])/2]]; a[n_ /; !PrimeQ[n] && OddQ[n+PrimePi[n]]] := If[!PrimeQ[n+1], n+1, n+2]; Table[a[n], {n, 1, 40}] (* Jean-Fran├žois Alcover, Mar 21 2011, after Dean Hickerson's empirical formula *)

CROSSREFS

Cf. A105753.

Sequence in context: A139047 A210945 A191795 * A203620 A249070 A249069

Adjacent sequences:  A121050 A121051 A121052 * A121054 A121055 A121056

KEYWORD

nonn,nice

AUTHOR

Eric Angelini, Aug 10 2006

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 17 15:00 EDT 2019. Contains 328115 sequences. (Running on oeis4.)