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.

Showing 1-3 of 3 results.

A146758 Last prime subtrahend at 10^n in A146757.

Original entry on oeis.org

7, 97, 983, 9941, 99839, 999983, 9998239, 99999989, 999950881, 9999999929, 99999999833, 999999999989, 9999999999863, 99999999999971, 999999961946087, 9999999999999917, 99999999989350667, 999999999999999989
Offset: 1

Views

Author

Enoch Haga, Nov 02 2008

Keywords

Examples

			A(2)=97 because 97 is the 15th and last prime difference under 10^2.
		

Crossrefs

Programs

  • Maple
    A146758 := proc(n) local p: p:=10^n: do p:=prevprime(p): if(isprime(ceil(evalf(sqrt(p)))^2-p))then return p: fi: od: end: seq(A146758(n),n=1..14); # Nathaniel Johnston, Oct 01 2011
  • UBASIC
    10 'sq less pr are prime 20 N=1:O=1:C=1 30 A=3:S=sqrt(N):if N>10^3 then print N,C-1:stop 40 B=N\A 50 if B*A=N then 100 60 A=A+2 70 if A<=S then 40 80 R=O^2:Q=R-N 90 if N1 print R;N;Q;C:N=N+2:C=C+1:goto 30 100 N=N+2:if N
    				

Extensions

a(8)-a(18) from Nathaniel Johnston, Oct 01 2011

A146760 Last prime subtrahend at 10^n in A146759.

Original entry on oeis.org

5, 61, 997, 9929, 97283, 999983, 9999973, 99897341, 999999929, 9993948257, 99999999761, 999999999989, 9999516957181, 99999999999929, 999999999999989, 9999999999998857, 99999429057832259, 999999999999999989, 9999990391470218071
Offset: 1

Views

Author

Enoch Haga, Nov 02 2008

Keywords

Comments

It is not necessary to compute A146759 to compute this sequence. a(n) is the largest prime p<=10^n such that c(p)-p is also a prime, where c(p) is the smallest cube exceeding p. - Sean A. Irvine, Mar 27 2013

Examples

			A(2)=61 because 61 is the 7th and last prime subtrahend under 10^3.
		

Crossrefs

Programs

  • UBASIC
    10 'cu less pr are prime
    20 N=1:O=1:C=1
    30 A=3:S=sqrt(N):if N>10^3 then print N,C-1:stop
    40 B=N\A
    50 if B*A=N then 100
    60 A=A+2
    70 if A<=S then 40
    80 R=O^3:Q=R-N
    90 if N1 print R;N;Q;C:N=N+2:C=C+1:goto 30
    100 N=N+2:if N
    				

Extensions

More terms from Sean A. Irvine, Mar 27 2013

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

Original entry on oeis.org

2, 7, 43, 224, 1355, 9306, 66200, 500249, 3883527, 31081813, 254358928, 2120975833
Offset: 1

Views

Author

Enoch Haga, Nov 02 2008

Keywords

Examples

			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}.
		

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[Prime[Range[PrimePi[10^n]]], PrimeQ[Ceiling[#^(1/3)]^3 - #] &]], {n, 6}] (* T. D. Noe, Mar 31 2013 *)
    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 *)
  • 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
    
  • 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
  • UBASIC
    10 'cu less pr are prime
    20 N=1:O=1:C=1
    30 A=3:S=sqrt(N):if N>10^3 then print N,C-1:stop
    40 B=N\A
    50 if B*A=N then 100
    60 A=A+2
    70 if A<=S then 40
    80 R=O^3:Q=R-N
    90 if N1 print R;N;Q;C:N=N+2:C=C+1:goto 30
    100 N=N+2:if N
    				

Extensions

Better name and more terms from Sean A. Irvine, Mar 27 2013
a(10)-a(11) from Chai Wah Wu, Jun 21 2019
a(12) from Amiram Eldar, Jan 20 2025
Showing 1-3 of 3 results.