login
A127597
Least number k such that k 4^n + (4^n-1)/3 is prime.
2
2, 1, 0, 2, 3, 2, 4, 4, 3, 10, 3, 3, 2, 7, 2, 25, 6, 17, 4, 13, 3, 20, 36, 20, 11, 27, 66, 23, 39, 24, 19, 13, 3, 10, 6, 122, 71, 58, 24, 13, 3, 2, 41, 10, 6, 32, 58, 17, 4, 79, 26, 55, 36, 48, 31, 28, 9, 2, 76, 24, 32, 28, 63, 20, 37, 9, 2, 7, 39, 10, 91, 47
OFFSET
0,1
LINKS
MATHEMATICA
a = {}; Do[k = 0; While[ !PrimeQ[k 4^n + (4^n - 1)/3], k++ ]; AppendTo[a, k], {n, 0, 50}]; a (*Artur Jasinski*)
lnk[n_]:=Module[{k=0, n4=4^n}, While[!PrimeQ[k*n4+(n4-1)/3], k++]; k]; Array[ lnk, 60, 0] (* Harvey P. Dale, May 28 2018 *)
PROG
(Python)
from sympy import isprime
def a(n):
k, fourn = 0, 4**n
while not isprime(k*fourn + (fourn-1)//3): k += 1
return k
print([a(n) for n in range(72)]) # Michael S. Branicky, May 18 2022
KEYWORD
nonn
AUTHOR
Artur Jasinski, Jan 19 2007
EXTENSIONS
Offset corrected and a(51) and beyond from Michael S. Branicky, May 18 2022
STATUS
approved