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!)
A199323 Number of primes of the form n*(n+1)+2*k-3 with k from 1 to n+1. 2

%I #18 Jul 04 2013 13:40:16

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

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

%U 14,16,16,13,18,15,16,12,17,16

%N Number of primes of the form n*(n+1)+2*k-3 with k from 1 to n+1.

%C n/log(n) is a good approximation of a(n) as n increases.

%H Pierre CAMI, <a href="/A199323/b199323.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = pi(n^2 + 3n - 1) - pi(n^2 + n - 2) for n > 1. [_Charles R Greathouse IV_, Nov 11 2011]

%e Write the odd numbers like this :

%e 1 3

%e 5 7 9

%e 11 13 15 17

%e 19 21 23 25 27

%e 29 31 33 35 37 39

%e 41 43 45 47 49 51 53

%e .......................

%e line n : n*(n+1)+2*k-3 , k from 1 to n+1

%e line 1 , n=1 1*(1+1)*2*k-3 k=1 & k=2 , 3 prime a(1)=1

%e line 2 , n=2 for k=1 to 3 , 5 & 7 prime so a(2)=2

%e n=3 11 13 & 17 prime a(3)=3

%e n=4 19 & 23 prime a(4)=2

%e a(5)=3 , a(6)=4

%t npf[n_]:=Count[Table[n(n+1)+2k-3,{k,n+1}],_?PrimeQ]; Array[npf,70] (* _Harvey P. Dale_, Jul 04 2013 *)

%o (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

%o (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

%K nonn

%O 1,2

%A _Pierre CAMI_, Nov 06 2011

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 March 28 16:58 EDT 2024. Contains 371254 sequences. (Running on oeis4.)