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.
%I A238847 #32 May 22 2025 10:21:37 %S A238847 1,2,4,3,2,2,4,15,2,3,2,2,6,3,10,3,26,3,4,2,2,15,26,7,4,2,2,6,2,2,10, %T A238847 2,20,4,2,3,4,3,4,6,6,4,10,2,14,16,12,3,4,9,10,6,24,3,4,6,2,3,2,2,18, %U A238847 6,6,3,14,5,16,9,18,3,2,2,4,3,10,6 %N A238847 Smallest k such that k*n^3 + 1 is prime. %e A238847 a(1) = 1 because in order for k*(1^3)+1 to be the smallest prime, k must be 1 (1*(1^3)+1 = 2). %e A238847 a(2) = 2 because in order for k*(2^3)+1 to be the smallest prime, k must be 2 (2*(2^3)+1 = 17). %e A238847 a(3) = 4 because in order for k*(3^3)+1 to be the smallest prime, k must be 4 (4*(3^3)+1 = 109). %t A238847 sk[n_]:=Module[{k=1,n3=n^3},While[!PrimeQ[k*n3+1],k++];k]; Array[sk, 80] (* _Harvey P. Dale_, Aug 27 2014 *) %t A238847 Table[SelectFirst[Range[10^2], PrimeQ[# n^3 + 1] &], {n, 76}] (* _Michael De Vlieger_, Mar 27 2016, Version 10 *) %o A238847 (Python) %o A238847 import sympy %o A238847 from sympy import isprime %o A238847 def f(n): %o A238847 for k in range(1,10**3): %o A238847 if isprime(k*(n**3)+1): %o A238847 return k %o A238847 n = 1 %o A238847 while n < 10**3: %o A238847 print(f(n)) %o A238847 n += 1 %o A238847 (PARI) a(n) = {k=1; while(!isprime(k*n^3+1), k++); k;} \\ _Altug Alkan_, Mar 26 2016 %Y A238847 Cf. A034693, A035092. %K A238847 nonn %O A238847 1,2 %A A238847 _Derek Orr_, Mar 06 2014