OFFSET
0,3
COMMENTS
It appears that A000040(a(n)) ~ 2*n as n tends to infinity. (See Mar 12 2012 note from Vladimir Shevelev in A060308.)
LINKS
Carlos Fernandez Rivero, Table of n, a(n) for n = 0..10000
Carlos Fernandez Rivero, Plots of a(n) for n = 0..200 and n = 0..10000
FORMULA
EXAMPLE
a(0) = 0 (by definition).
a(1) = 1 = a(0) + 1, because 2*1 + 3 is prime;
a(2) = 2 = a(1) + 1, because 2*2 + 3 is prime;
a(3) = 2 = a(2), because 2*3 + 3 is not prime;
a(4) = 3 = a(3) + 1, because 2*4 + 3 is prime.
MATHEMATICA
a[0] = 0; a[n_] := a[n] = a[n - 1] + Boole@PrimeQ[2 n + 3]; Array[a, 100, 0] (* Amiram Eldar, Jul 06 2019 *)
PROG
(BASIC)
' p(n) contains the prime sequence except for 2. p(0)=3
' output in the a(n) sequence for 0 <= n <= maxterm
ip = -1
For n = 0 To maxterm
If (2 * n + 3) = p(ip+1) Then
ip = ip + 1
End If
a(n) = ip
Next n
(Magma) [#PrimesUpTo(2*n + 4) - 2: n in [0..80] ]; // Vincenzo Librandi, Aug 01 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Carlos Fernandez Rivero, Jun 22 2019
STATUS
approved