login
Integers n such that A061720(n-1) + 1 or A061720(n-1) - 1 is prime.
0

%I #13 Nov 28 2015 19:16:55

%S 1,2,3,4,5,8,9,15,25,36,57,80,81,133,225,281,282,288,343,632,653

%N Integers n such that A061720(n-1) + 1 or A061720(n-1) - 1 is prime.

%C Integers n such that A002110(n) - A002110(n-1) + 1 or A002110(n) - A002110(n-1) - 1 is prime.

%C Are there any other squares in sequence?

%e a(3) = 3 because 2*3*5 - 2*3 - 1 = 23 is prime.

%e a(6) = 8 because 2*3*5*7*11*13*17*19 - 2*3*5*7*11*13*17 + 1 = 9189181 is prime.

%t t = Differences[FoldList[Times, 1, Prime@ Range@ 1200]]; Select[Range@ 360, Or[PrimeQ[t[[# - 1]] + 1], PrimeQ[t[[# - 1]] - 1]] &] - 1 (* _Michael De Vlieger_, Nov 28 2015, after _Alonso del Arte_ at A061720 *)

%o (PARI) a(n) = prod(k=1, n, prime(k));

%o for(n=0, 1e3, if(ispseudoprime(a(n)-a(n-1)-1) || ispseudoprime(a(n)-a(n-1)+1), print1(n, ", ")))

%Y Cf. A002110, A061720.

%K nonn,more

%O 1,2

%A _Altug Alkan_, Nov 27 2015