login
Numbers k such that (3^k - k^3)/2 is prime.
0

%I #35 Oct 03 2024 23:31:50

%S 5,13,205,409,413,545,88649

%N Numbers k such that (3^k - k^3)/2 is prime.

%C All terms must be odd. - _Michael S. Branicky_, Mar 03 2022

%C No further terms less than 25000. - _Michael S. Branicky_, Mar 04 2022

%e 5 is a term since (3^5 - 5^3)/2 = 59 is prime.

%t Select[Range[1, 600, 2], PrimeQ[(3^# - #^3)/2] &] (* _Amiram Eldar_, Mar 03 2022 *)

%o (Sage) for n in srange(1,10000):

%o if ((3^n-n^3)//2).is_prime():

%o print(n)

%o (PARI) isok(k) = if (denominator(x=(3^k-k^3)/2) == 1, ispseudoprime(x)); \\ _Michel Marcus_, Mar 03 2022

%o (Python)

%o from sympy import isprime

%o def afind(limit):

%o for k in range(1, limit+1, 2):

%o if isprime((3**k - k**3)//2):

%o print(k, end=", ")

%o afind(1000) # _Michael S. Branicky_, Mar 03 2022

%K nonn,more

%O 1,1

%A _Brennan G. Benfield_, Mar 03 2022

%E a(7) from _Michael S. Branicky_, Oct 03 2024