%I #42 Jan 04 2016 01:55:48
%S 0,1,3,5,4,5,10,5,10,16,12,17,18,16,19,27,23,22,34,27,34,39,39,45,51,
%T 41,50,51,44,57,68,71,63,74,63,76,87,84,89,104,94,108,111,99,117,116,
%U 120,104,126,114,133,146,149,146,166,148,190,178,182,170,179,173
%N Goldbach's problem extended to division: number of decompositions of 2n into the floor of unordered ratios of two primes, floor(q/p) = 2n, where p < 2n < q.
%H Charles R Greathouse IV, <a href="/A205601/b205601.txt">Table of n, a(n) for n = 1..10000</a>
%e 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
%t 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 *)
%o (C++) #include <iostream>
%o using namespace std;
%o int main() //C++ code for the first 20 even integers >= 2
%o //where floor(q/p) = 2n, p<2n<q, by _James D. Klein_
%o { bool a[2000]; //Initialize array p with primes
%o int p[304];
%o int n=2000, i=0;
%o a[0] = a[1] = false;
%o for(int j=2; j<n; j++) a[j] = true;
%o for(int j=2; j<=n/2; j++)
%o for(int k=2; k<=n/j; k++)
%o a[j*k] = false;
%o for(int j=2; j<n; j++)
%o if(a[j]) p[i++]=j;
%o int count, istart = 0; //Generate the decompositions
%o for(int n=1; n<=20; n++)
%o { while(2*n>p[istart]) istart++;
%o count = 0;
%o for(int j=0; p[j]<2*n; j++)
%o for(int i=istart; p[i]<(p[j]+1)*2*n; i++)
%o if(p[i]/p[j]==2*n)count++;
%o cout << n << ". " << count << endl;
%o }
%o return 0;
%o }
%o (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
%Y Cf. A002375, A202472.
%K nonn
%O 1,3
%A _James D. Klein_, Jan 29 2012
%E a(21)-a(62) from _Charles R Greathouse IV_, Jan 31 2012
|