cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

This page as a plain text file.
%I A146759 #37 Jan 20 2025 03:50:17
%S A146759 2,7,43,224,1355,9306,66200,500249,3883527,31081813,254358928,
%T A146759 2120975833
%N A146759 Number of primes p < 10^n such that c - p is prime, where c is the next cube greater than p.
%e A146759 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 A146759 Table[Length[Select[Prime[Range[PrimePi[10^n]]], PrimeQ[Ceiling[#^(1/3)]^3 - #] &]], {n, 6}] (* _T. D. Noe_, Mar 31 2013 *)
%t A146759 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 A146759 (UBASIC)
%o A146759 10 'cu less pr are prime
%o A146759 20 N=1:O=1:C=1
%o A146759 30 A=3:S=sqrt(N):if N>10^3 then print N,C-1:stop
%o A146759 40 B=N\A
%o A146759 50 if B*A=N then 100
%o A146759 60 A=A+2
%o A146759 70 if A<=S then 40
%o A146759 80 R=O^3:Q=R-N
%o A146759 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 A146759 100 N=N+2:if N<R then 30:else O=O+1:goto 80
%o A146759 (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
%o A146759 (PARI) list(nmax) = {my(m = 0, c = 2, cc = c^3, n = 0, pow = 10); forprime(p = 1, , if(p > pow, print1(m, ", "); n++; if(n == nmax, break); pow *= 10); if(p > cc, c++; cc = c^3); if(isprime(cc - p), m++));} \\ _Amiram Eldar_, Jan 20 2025
%Y A146759 Cf. A006880, A146756, A146757, A146760.
%K A146759 nonn,more
%O A146759 1,1
%A A146759 _Enoch Haga_, Nov 02 2008
%E A146759 Better name and more terms from _Sean A. Irvine_, Mar 27 2013
%E A146759 a(10)-a(11) from _Chai Wah Wu_, Jun 21 2019
%E A146759 a(12) from _Amiram Eldar_, Jan 20 2025