cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A159266 Least positive integer m such that 2^n+3^m is prime.

This page as a plain text file.
%I A159266 #20 Feb 04 2025 21:25:31
%S A159266 1,1,1,1,2,1,1,3,2,2,4,1,3,3,1,1,8,1,4,8,8,6,2,7,27,6,13,1,10,1,6,4,8,
%T A159266 18,9,19,2,15,29,3,3,17,10,3,11,6,2,5,20,34,4,12,10,26,1,4,2,9,29,29,
%U A159266 10,34,13,4,8,2,1,8,10,26,50,19,12,10,8,13,27,17,9,33,4,2,17,1,7,3,5,61,26
%N A159266 Least positive integer m such that 2^n+3^m is prime.
%C A159266 In contrast to A123340 which allows m=0, a(0) does not exist for this sequence.
%H A159266 Robert Israel, <a href="/A159266/b159266.txt">Table of n, a(n) for n = 1..2000</a>
%H A159266 M. F. Hasler, <a href="http://groups.yahoo.com/group/primenumbers/message/20014">Primes of the form (x+1)^p-x^p</a>, Apr 7, 2009.
%H A159266 Maximilian Hasler, Mike Oakes, Mark Underwood, David Broadhurst and others, <a href="/A159625/a159625.txt">Primes of the form (x+1)^p-x^p</a>, digest of 22 messages in primenumbers Yahoo group, Apr 5 - May 7, 2009. [Cached copy]
%F A159266 a(n) = min { m>0 | 2^n+3^m is prime } = A123340(n) whenever the latter is > 1.
%e A159266 a(1)=1 is the least m>0 such that 2^1+3^m (=5) is prime.
%e A159266 a(2)=1 is the least m>0 such that 2^2+3^m (=7) is prime.
%e A159266 a(5)=2 is the least m>0 such that 2^5+3^m (=41) is prime.
%p A159266 f:= proc(n) local t,m;
%p A159266   t:= 2^n;
%p A159266   for m from 1 do if isprime(t+3^m) then return m fi od
%p A159266 end proc:
%p A159266 map(f, [$1..100]); # _Robert Israel_, Sep 18 2018
%t A159266 a[n_] := Module[{m, t = 2^n}, For[m = 1, True, m++, If[PrimeQ[t + 3^m], Return[m]]]];
%t A159266 Table[a[n], {n, 1, 100}] (* _Jean-François Alcover_, Feb 01 2023 *)
%o A159266 (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 */
%Y A159266 Cf. A123340 (allows for m=0), A123359 (roles of 2 and 3 exchanged).
%K A159266 nonn
%O A159266 1,5
%A A159266 _M. F. Hasler_, Apr 07 2009