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!)
A238847 Smallest k such that k*n^3 + 1 is prime. 2
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, 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, 6, 6, 3, 14, 5, 16, 9, 18, 3, 2, 2, 4, 3, 10, 6 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
EXAMPLE
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).
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).
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).
MATHEMATICA
sk[n_]:=Module[{k=1, n3=n^3}, While[!PrimeQ[k*n3+1], k++]; k]; Array[sk, 80] (* Harvey P. Dale, Aug 27 2014 *)
Table[SelectFirst[Range[10^2], PrimeQ[# n^3 + 1] &], {n, 76}] (* Michael De Vlieger, Mar 27 2016, Version 10 *)
PROG
(Python)
import sympy
from sympy import isprime
def f(n):
..for k in range(1, 10**3):
....if isprime(k*(n**3)+1):
......return k
n = 1
while n < 10**3:
..print(f(n))
..n += 1
(PARI) a(n) = {k=1; while(!isprime(k*n^3+1), k++); k; } \\ Altug Alkan, Mar 26 2016
CROSSREFS
Sequence in context: A105972 A305024 A064134 * A011030 A005681 A049848
KEYWORD
nonn
AUTHOR
Derek Orr, Mar 06 2014
STATUS
approved

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 24 10:00 EDT 2024. Contains 371935 sequences. (Running on oeis4.)