OFFSET
1,1
COMMENTS
Schinzel's hypothesis H implies that a(n) exists for every n. [Charles R Greathouse IV, Sep 18 2011]
FORMULA
a(n) is the least k such that (1/2)*k^n - 1 and (1/2)*k^n + 1 are prime.
MAPLE
isA054735 := proc(n)
if type(n, 'odd') then
false;
else
isprime(n/2-1) and isprime(n/2+1) ;
end if;
end proc:
A195336 := proc(n)
for k from 1 do
if isA054735(k^n) then
return k;
end if;
end do:
end proc:
for n from 1 do print(A195336(n)) ; end do: # R. J. Mathar, Sep 20 2011
PROG
(PARI) a(n)=my(k=2); while(!ispseudoprime(k^n/2-1)||!ispseudoprime(k^n/2+1), k+=2); k \\ Charles R Greathouse IV, Sep 18 2011
(Python)
from sympy import isprime
def cond(k, n): m = (k**n)//2; return isprime(m-1) and isprime(m+1)
def a(n):
k = 2
while not cond(k, n): k += 2
return k
print([a(n) for n in range(1, 25)]) # Michael S. Branicky, Aug 06 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Kausthub Gudipati, Sep 16 2011
EXTENSIONS
a(11)-a(50) from Charles R Greathouse IV, Sep 18 2011
STATUS
approved