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.

A146317 Prime differences of primes subtracted from nearest cube.

This page as a plain text file.
%I A146317 #8 Jul 22 2025 06:14:43
%S A146317 5,3,23,17,11,5,3,89,79,67,59,53,43,37,23,19,17,5,163,139,103,79,73,
%T A146317 13,3,2,257,239,227,191,179,173,137,113,89,71,59,53,47,29,23,17,3,367,
%U A146317 347,281,277,269,257,241,239,229,197,179,157,149,131,127,109,107,101,71,61
%N A146317 Prime differences of primes subtracted from nearest cube.
%C A146317 Terms in A146317 + A146318 produce a cube
%H A146317 Robert Israel, <a href="/A146317/b146317.txt">Table of n, a(n) for n = 1..10000</a>
%e A146317 a(3)=23 because when the prime 23 is subtracted from the cube 64, the result is another prime, 41
%p A146317 R:= NULL: count:= 0: p:= 1:
%p A146317 while count < 100 do
%p A146317   p:= nextprime(p);
%p A146317   d:= ceil(p^(1/3))^3-p;
%p A146317   if isprime(d) then count:= count+1; R:= R, d fi;
%p A146317 od:
%p A146317 R; # _Robert Israel_, Aug 06 2019
%o A146317 (UBASIC) 10 'cu less pr are prime 20 N=1:O=1 30 A=3:S=sqrt(N) 40 B=N\A 50 if B*A=N then 120 60 A=A+2 70 if A<=S then 40 80 R=O^3:Q=R-N 90 if N<R and N=prmdiv(N) and Q=prmdiv(Q) then print R;N;Q:C=C+1:N=N+2:goto 30 100 if C=30 then stop 120 N=N+2:if N<R then 30:else O=O+1:goto 80
%Y A146317 A146315 A146316 A146318
%K A146317 easy,nonn,look
%O A146317 1,1
%A A146317 _Enoch Haga_, Oct 30 2008