OFFSET
1,3
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
EXAMPLE
For n = 3, a(n) = 3 because 6 is the floor of 13/2, 19/3, and 31/5. - T. D. Noe, Jan 31 2012
MATHEMATICA
Table[Length[Flatten[Table[Select[2*n*p + Range[p - 1], PrimeQ], {p, Prime[Range[PrimePi[2*n - 1]]]}]]], {n, 62}] (* T. D. Noe, Jan 31 2012 *)
PROG
(C++) #include <iostream>
using namespace std;
int main() //C++ code for the first 20 even integers >= 2
//where floor(q/p) = 2n, p<2n<q, by James D. Klein
{ bool a[2000]; //Initialize array p with primes
int p[304];
int n=2000, i=0;
a[0] = a[1] = false;
for(int j=2; j<n; j++) a[j] = true;
for(int j=2; j<=n/2; j++)
for(int k=2; k<=n/j; k++)
a[j*k] = false;
for(int j=2; j<n; j++)
if(a[j]) p[i++]=j;
int count, istart = 0; //Generate the decompositions
for(int n=1; n<=20; n++)
{ while(2*n>p[istart]) istart++;
count = 0;
for(int j=0; p[j]<2*n; j++)
for(int i=istart; p[i]<(p[j]+1)*2*n; i++)
if(p[i]/p[j]==2*n)count++;
cout << n << ". " << count << endl;
}
return 0;
}
(PARI) a(n)=n*=2; my(s, t); forprime(p=2, n-1, t=n*p; while(n==(t=nextprime(t+1))\p, s++)); s \\ Charles R Greathouse IV, Jan 30 2012
CROSSREFS
KEYWORD
nonn
AUTHOR
James D. Klein, Jan 29 2012
EXTENSIONS
a(21)-a(62) from Charles R Greathouse IV, Jan 31 2012
STATUS
approved