login
Numbers k such that (k-1)*k*(k+1) = (k-1)*(1+u) = k*(1+v) = (k+1)*(1+w) with primes u, v, w.
1

%I #26 Sep 06 2023 13:41:15

%S 3,5,9,21,55,131,145,155,231,259,265,449,495,561,595,1045,1051,1365,

%T 1409,1491,1549,1849,1989,2001,2101,2469,2785,3365,3621,3641,3669,

%U 3845,3911,4285,4951,5181,5465,6049,6699,7189,7229,8219,8629,9175,9521,9539,9631,9729

%N Numbers k such that (k-1)*k*(k+1) = (k-1)*(1+u) = k*(1+v) = (k+1)*(1+w) with primes u, v, w.

%H Alois P. Heinz, <a href="/A328525/b328525.txt">Table of n, a(n) for n = 1..10000</a>

%e 3 is a term because 2*3*4 = 2*(1+11) = 3*(1+7) = 4*(1+5) with primes 11, 7, 5.

%e 9 is a term because 8*9*10 = 8*(1+89) = 9*(1+79) = 10*(1+71) with primes 89, 79, 71.

%p q:= k-> andmap(isprime, (t-> [t-1, t-k, t+k])(k^2-1)):

%p select(q, [$1..10000])[]; # _Alois P. Heinz_, Feb 25 2020

%t Select[Range[2, 10^4], AllTrue[{(# - 1)*#, #*(# + 1), (# + 1)*(# - 1)} - 1, PrimeQ] &] (* _Amiram Eldar_, Feb 24 2020 *)

%o (Rexx)

%o S = 3

%o do N = 5 to 595 by 2

%o if NOPRIME( N*N +N -1 ) then iterate N

%o if NOPRIME( N*N -2 ) then iterate N

%o if NOPRIME( N*N -N -1 ) then iterate N

%o S = S || ',' N

%o end N

%o say S

%o (PARI) isok(k) = isprime(k*(k+1)-1) && isprime((k+1)*(k-1)-1) && isprime(k*(k-1)-1); \\ _Michel Marcus_, Feb 25 2020

%Y Cf. A000040.

%Y Intersection of A002328, A028870 and A045546.

%K nonn

%O 1,1

%A _Frank Ellermann_, Feb 24 2020

%E More terms from _Amiram Eldar_, Feb 24 2020