OFFSET
1,5
COMMENTS
In contrast to A123340 which allows m=0, a(0) does not exist for this sequence.
LINKS
Robert Israel, Table of n, a(n) for n = 1..2000
M. F. Hasler, Primes of the form (x+1)^p-x^p, Apr 7, 2009.
Maximilian Hasler, Mike Oakes, Mark Underwood, David Broadhurst and others, Primes of the form (x+1)^p-x^p, digest of 22 messages in primenumbers Yahoo group, Apr 5 - May 7, 2009. [Cached copy]
FORMULA
a(n) = min { m>0 | 2^n+3^m is prime } = A123340(n) whenever the latter is > 1.
EXAMPLE
a(1)=1 is the least m>0 such that 2^1+3^m (=5) is prime.
a(2)=1 is the least m>0 such that 2^2+3^m (=7) is prime.
a(5)=2 is the least m>0 such that 2^5+3^m (=41) is prime.
MAPLE
f:= proc(n) local t, m;
t:= 2^n;
for m from 1 do if isprime(t+3^m) then return m fi od
end proc:
map(f, [$1..100]); # Robert Israel, Sep 18 2018
MATHEMATICA
a[n_] := Module[{m, t = 2^n}, For[m = 1, True, m++, If[PrimeQ[t + 3^m], Return[m]]]];
Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Feb 01 2023 *)
PROG
(PARI) A159266(n, m=0)=until( is/*pseudo*/prime(2^n+3^m++), ); m /* 2nd optional arg allows us to resume search after a given m and thus (when set to previous result) the list of all m yielding primes */
CROSSREFS
KEYWORD
nonn,changed
AUTHOR
M. F. Hasler, Apr 07 2009
STATUS
approved