cp's OEIS Frontend

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.

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

This page as a plain text file.
%I A238848 #20 May 22 2025 10:21:37
%S A238848 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 A238848 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 A238848 4,2,16,3,6,9,2,3,30,5,14,6,24,5,16,5
%N A238848 Smallest k such that k*n^3 - 1 is prime.
%H A238848 Harvey P. Dale, <a href="/A238848/b238848.txt">Table of n, a(n) for n = 1..1000</a>
%e A238848 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 A238848 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 A238848 (Python)
%o A238848 import sympy
%o A238848 from sympy import isprime
%o A238848 def f(n):
%o A238848   for k in range(1,10**3):
%o A238848     if isprime(k*(n**3)-1):
%o A238848       return k
%o A238848 n = 1
%o A238848 while n < 10**3:
%o A238848   print(f(n))
%o A238848   n += 1
%Y A238848 Cf. A231819, A053989.
%K A238848 nonn
%O A238848 1,1
%A A238848 _Derek Orr_, Mar 06 2014