login
A199323
Number of primes of the form n*(n+1)+2*k-3 with k from 1 to n+1.
2
1, 2, 3, 2, 3, 4, 3, 4, 5, 3, 5, 5, 5, 5, 6, 5, 6, 6, 6, 8, 8, 5, 7, 10, 7, 8, 7, 10, 7, 9, 11, 10, 8, 9, 13, 5, 11, 12, 14, 8, 12, 11, 8, 13, 14, 10, 13, 15, 9, 11, 19, 13, 12, 12, 12, 13, 16, 14, 16, 16, 13, 18, 15, 16, 12, 17, 16
OFFSET
1,2
COMMENTS
n/log(n) is a good approximation of a(n) as n increases.
FORMULA
a(n) = pi(n^2 + 3n - 1) - pi(n^2 + n - 2) for n > 1. [Charles R Greathouse IV, Nov 11 2011]
EXAMPLE
Write the odd numbers like this :
1 3
5 7 9
11 13 15 17
19 21 23 25 27
29 31 33 35 37 39
41 43 45 47 49 51 53
.......................
line n : n*(n+1)+2*k-3 , k from 1 to n+1
line 1 , n=1 1*(1+1)*2*k-3 k=1 & k=2 , 3 prime a(1)=1
line 2 , n=2 for k=1 to 3 , 5 & 7 prime so a(2)=2
n=3 11 13 & 17 prime a(3)=3
n=4 19 & 23 prime a(4)=2
a(5)=3 , a(6)=4
MATHEMATICA
npf[n_]:=Count[Table[n(n+1)+2k-3, {k, n+1}], _?PrimeQ]; Array[npf, 70] (* Harvey P. Dale, Jul 04 2013 *)
PROG
(PARI) a(n)=if(n<4, n, primepi(n^2+3*n-1)-primepi(n^2+n-2)) \\ Charles R Greathouse IV, Nov 11 2011
(PARI) a(n)=my(s); forstep(a=n^2+n-1, n^2+3*n-1, 2, s+=isprime(a)); s \\ Charles R Greathouse IV, Nov 11 2011
CROSSREFS
Sequence in context: A256993 A348192 A173523 * A156549 A275868 A100795
KEYWORD
nonn
AUTHOR
Pierre CAMI, Nov 06 2011
STATUS
approved