login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A146760 Last prime subtrahend at 10^n in A146759. 4

%I #12 Mar 29 2013 13:30:37

%S 5,61,997,9929,97283,999983,9999973,99897341,999999929,9993948257,

%T 99999999761,999999999989,9999516957181,99999999999929,

%U 999999999999989,9999999999998857,99999429057832259,999999999999999989,9999990391470218071

%N Last prime subtrahend at 10^n in A146759.

%C 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

%H Sean A. Irvine, <a href="/A146760/b146760.txt">Table of n, a(n) for n = 1..150</a>

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

%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

%Y Cf. A146756, A146757, A146759.

%K easy,nonn

%O 1,1

%A _Enoch Haga_, Nov 02 2008

%E More terms from _Sean A. Irvine_, Mar 27 2013

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 16:03 EDT 2024. Contains 371794 sequences. (Running on oeis4.)