login
Numbers k such that k * (1+i)^k + 1 is a Gaussian prime.
0

%I #21 May 09 2023 12:11:37

%S 1,2,3,5,9,19,20,29,30,68,142,143,150,159,198,468,782,858,1100,1137,

%T 3337,3638,3909,4845,16895,30349,42692,48470

%N Numbers k such that k * (1+i)^k + 1 is a Gaussian prime.

%H <a href="/index/Ga#gaussians">Index entries for Gaussian integers and primes</a>

%p select(n -> GaussInt:-GIprime(n*(1+I)^n+1), [$1..50000]); # _Robert Israel_, May 08 2023

%t Do[ If[ PrimeQ[ n * (1 + I)^n + 1, GaussianIntegers -> True], Print[n] ], {n, 1, 4000} ]

%o (Python)

%o from itertools import count, islice

%o from sympy import I

%o from sympy.ntheory import is_gaussian_prime

%o def A058770_gen(startvalue=1): # generator of terms

%o x = (1+I)**(m:=max(startvalue,1))

%o for k in count(m):

%o if is_gaussian_prime(k*x+1):

%o yield k

%o x *= (1+I)

%o A058770_list = list(islice(A058770_gen(),20)) # _Chai Wah Wu_, May 09 2023

%K nonn,hard,more

%O 1,2

%A _Robert G. Wilson v_, Jan 02 2001

%E Corrected by _Robert Israel_, May 08 2023