%I #14 Sep 11 2021 10:47:29
%S 2,3,2,2,5,2,3,0,2,2,59,3,2,3,11,2,3,19,2,401,2,3,3,2,2,7,0,2,3,2,13,
%T 3,2,2,3,7,7,11,2,5,5,17,7,5,2,2,3,2,31,3,13,257,3,2,2,5,41,2,3,2,2,
%U 31,2,0,3359,47,19,31,17,5,13,3,3,5,2,2,3,41,2,31
%N a(n) is the least prime p such that n*(p#^3)-1 is prime or 0 if n > 1 is a cube so no prime possible.
%e 1*(2^3)-1 = 7 is prime, so a(1) = 2.
%e 2*(2^3)-1 = 15 is composite, 2*((2*3)^3)-1 = 431 is prime, so a(2) = 3.
%t a[n_] := If[n>1 && IntegerQ[Surd[n, 3]], 0, Module[{p = pr = 2}, While[!PrimeQ[n * pr^3 - 1], p = NextPrime[p]; pr *= p]; p]]; Array[a, 100] (* _Amiram Eldar_, Sep 11 2021 *)
%o (PARI) pr(p) = my(pr=1); forprime(q=2, p, pr *= q); pr;
%o a(n) = if (ispower(n,3) && (n>1), return (0)); my(p=2); while (!ispseudoprime(n*pr(p)^3-1), p = nextprime(p+1)); p; \\ _Michel Marcus_, Sep 11 2021
%Y Cf. A118664 (with squares), A118925 (with 5th powers).
%K nonn
%O 1,1
%A _Pierre CAMI_, May 19 2006
%E Data corrected and more terms added by _Amiram Eldar_, Sep 11 2021