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!)
A238848 Smallest k such that k*n^3 - 1 is prime. 2

%I #18 Jan 04 2023 17:47:57

%S 3,1,2,2,4,2,14,7,6,2,4,4,14,3,4,2,16,4,12,9,2,5,16,2,2,3,16,6,10,4,2,

%T 4,22,2,6,3,6,10,6,3,22,5,2,3,4,2,18,4,26,10,4,5,6,2,2,7,6,2,10,5,2,9,

%U 4,2,16,3,6,9,2,3,30,5,14,6,24,5,16,5

%N Smallest k such that k*n^3 - 1 is prime.

%H Harvey P. Dale, <a href="/A238848/b238848.txt">Table of n, a(n) for n = 1..1000</a>

%e a(1) = 3 because for k = 1, 1*(1^3) - 1 = 0 is not prime, for k = 2, 2*(1^3) - 1 = 1 is not prime, but for k = 3, 3*(1^3) - 1 = 2 is prime.

%t sk[n_]:=Module[{k=1,n3=n^3},While[!PrimeQ[k*n3-1],k++];k]; Array[sk,80] (* _Harvey P. Dale_, Jan 04 2023 *)

%o (Python)

%o import sympy

%o from sympy import isprime

%o def f(n):

%o ..for k in range(1,10**3):

%o ....if isprime(k*(n**3)-1):

%o ......return k

%o n = 1

%o while n < 10**3:

%o ..print(f(n))

%o ..n += 1

%Y Cf. A231819, A053989.

%K nonn

%O 1,1

%A _Derek Orr_, Mar 06 2014

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 23 06:04 EDT 2024. Contains 371906 sequences. (Running on oeis4.)