login
Number of primes p < 10^n such that c - p is prime, where c is the next cube greater than p.
3

%I #32 Jun 22 2019 10:46:29

%S 2,7,43,224,1355,9306,66200,500249,3883527,31081813,254358928

%N Number of primes p < 10^n such that c - p is prime, where c is the next cube greater than p.

%e a(2) = 7 because at 10^2 there are 7 primes that, subtracted from the next higher value cube, produce prime differences: {3, 5, 41, 47, 53, 59, 61}.

%t Table[Length[Select[Prime[Range[PrimePi[10^n]]], PrimeQ[Ceiling[#^(1/3)]^3 - #] &]], {n, 6}] (* _T. D. Noe_, Mar 31 2013 *)

%t cpQ[n_]:=PrimeQ[Ceiling[Surd[n,3]]^3-n]; nn=9; Module[{c=Table[If[ cpQ[n],1,0], {n, Prime[ Range[ PrimePi[ 10^nn]]]}]}, Table[ Total[ Take[c,PrimePi[10^p]]],{p,nn}]] (* _Harvey P. Dale_, Aug 13 2014 *)

%o (UBASIC)

%o 10 'cu less pr are prime

%o 20 N=1:O=1:C=1

%o 30 A=3:S=sqrt(N):if N>10^3 then print N,C-1:stop

%o 40 B=N\A

%o 50 if B*A=N then 100

%o 60 A=A+2

%o 70 if A<=S then 40

%o 80 R=O^3:Q=R-N

%o 90 if N<R and N=prmdiv(N) and Q=prmdiv(Q) then if Q>1 print R;N;Q;C:N=N+2:C=C+1:goto 30

%o 100 N=N+2:if N<R then 30:else O=O+1:goto 80

%o (PARI) a(n) = {my(nb = 0); forprime(p=2, 10^n, if (isprime((sqrtnint(p,3)+1)^3 - p), nb++);); nb;} \\ _Michel Marcus_, Jun 22 2019

%Y Cf. A006880, A146756, A146757, A146760.

%K nonn,more

%O 1,1

%A _Enoch Haga_, Nov 02 2008

%E Better name and more terms from _Sean A. Irvine_, Mar 27 2013

%E a(10)-a(11) from _Chai Wah Wu_, Jun 21 2019