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.

A238849 Smallest k such that k*n^3 - 1 and k*n^3 + 1 are twin primes.

This page as a plain text file.
%I A238849 #13 May 22 2025 10:21:37
%S A238849 4,9,4,3,24,2,24,30,58,3,12,19,96,3,10,165,114,11,390,159,2,30,114,10,
%T A238849 18,12,24,6,42,19,72,24,30,72,24,3,150,189,40,54,348,5,24,93,14,33,
%U A238849 324,9,150,81,70,39,354,3,138,42,56,51,180,16,18,9
%N A238849 Smallest k such that k*n^3 - 1 and k*n^3 + 1 are twin primes.
%e A238849 a(1) = 4 because for k = 1, 1*(1^3) - 1 = 0 and 1*(1^3) + 1 = 2 are not twin primes, for k = 2, 1 and 3 are not twin primes, for k = 3, 2 and 4 are not twin primes, so the smallest k that works is k = 4: 4*(1^3) - 1 = 3 and 4*(1^3) + 1 = 5 are twin primes.
%o A238849 (Python)
%o A238849 import sympy
%o A238849 from sympy import isprime
%o A238849 def f(n):
%o A238849   for k in range(1,10**4):
%o A238849     if isprime(k*(n**3)-1) and isprime(k*(n**3)+1):
%o A238849       return k
%o A238849 n = 1
%o A238849 while n < 10**3:
%o A238849   print(f(n))
%o A238849   n += 1
%Y A238849 Cf. A071558, A110559.
%K A238849 nonn
%O A238849 1,1
%A A238849 _Derek Orr_, Mar 06 2014