login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

a(n) = least prime q such that q + prime(n) is a cube.
1

%I #18 Oct 17 2023 19:31:17

%S 727,5,3,1721,53,499,47,197,41,971,1697,179,23,173,17,11,5,3,149,929,

%T 439,137,4013,127,2647,1627,113,109,107,103,89,1597,79,373,67,2593,59,

%U 53,3929,43,37,331,809,23,19,17,5,2521,773,283,3863,761,271,5581,743,3833

%N a(n) = least prime q such that q + prime(n) is a cube.

%C Corresponding values of (a(n)+prime(n))^(1/3): 9,2,2,12,4,8,4,6,4,10,12,6,4,6,4,4,4,4,6,10,8,6,16,6,14,12,6,6,6,6,6.

%H Robert Israel, <a href="/A259237/b259237.txt">Table of n, a(n) for n = 1..10000</a>

%p f:= proc(n) local p,k;

%p p:= ithprime(n);

%p for k from ceil(p^(1/3)) do

%p if isprime(k^3 - p) then return k^3 - p fi

%p od

%p end proc:

%p map(f, [$1..100]); # _Robert Israel_, Oct 17 2023

%t Table[p=Prime[n];x=Ceiling[p^(1/3)];While[!PrimeQ[q=x^3-p],x++];q,{n,100}]

%o (PARI) a(n) = {p = prime(n); k=2; while(!ispower(p+k,3), k = nextprime(k+1)); k;} \\ _Michel Marcus_, Jun 22 2015

%Y Cf. A157480, A259232.

%K nonn,look

%O 1,1

%A _Zak Seidov_, Jun 22 2015