login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

a(1)=1, a(n) is the smallest integer not included earlier such that a(n)*a(n-1)-1 and a(n)*a(n-1)+1 are twin primes.
1

%I #11 Mar 08 2017 02:44:15

%S 1,4,3,2,6,5,12,9,8,24,10,15,16,27,30,14,33,20,21,22,39,28,51,42,11,

%T 18,29,72,26,57,74,45,36,23,84,13,66,7,60,17,126,38,111,68,54,37,90,

%U 31,48,44,75,34,63,56,105,32,81,50,93,106,138,40,78,19,222,110,69,58

%N a(1)=1, a(n) is the smallest integer not included earlier such that a(n)*a(n-1)-1 and a(n)*a(n-1)+1 are twin primes.

%C It is only a conjecture that a(n) always exists. - Editors, OEIS, Mar 07 2017

%H Rémy Sigrist, <a href="/A282539/b282539.txt">Table of n, a(n) for n = 1..10000</a>

%o (Python)

%o from sympy import isprime

%o a = [1]

%o found = True

%o while found:

%o found = False

%o prev = a[len(a)-1]

%o for k in range(2,10001):

%o if isprime(prev*k-1) and isprime(prev*k+1) and (k not in a):

%o print str(k)+',',

%o a.append(k)

%o found = True

%o break

%Y Cf. A000040, A001097, A014574, A073666.

%K nonn

%O 1,2

%A _Alex Ratushnyak_, Feb 17 2017