login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Smallest m such that at least one of the two odd numbers which bracket n^m is not a prime.
6

%I #12 Feb 03 2018 12:27:20

%S 1,1,2,2,2,1,1,3,1,1,2,1,1,3,1,1,2,1,1,3,1,1,1,1,1,1,1,1,2,1,1,1,1,1,

%T 1,1,1,2,1,1,2,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,2,

%U 1,1,2,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1

%N Smallest m such that at least one of the two odd numbers which bracket n^m is not a prime.

%C The locution "the two odd numbers which bracket n^m" indicates the pair (n^m-1,n^m+1) for even n and (n^m-2,n^m+2) for odd n.

%C The initial records in this sequence are a(2)=1, a(4)=2, a(9)=3, a(102795)=4. No higher value was found up to 5500000. It is not clear whether a(n) is bounded.

%H Stanislav Sykora, <a href="/A245514/b245514.txt">Table of n, a(n) for n = 2..10000</a>

%e a(2)=1 because one of the two odd numbers (1,3) which bracket 2^1 is not a prime. a(5)=2 because 5^1 is bracketed by the odd numbers (3,7) which are both prime, while 5^2 is bracketed by the odd numbers (23,27), one of which is not a prime.

%e The number c=102795 is the smallest one whose powers c^1, c^2, c^3 are all odd-bracketed by primes, while c^4 is not.

%o (PARI) avector(nmax)={my(n, k, d=2, v=vector(nmax)); for(n=2, #v+1, d=3-d; k=1; while(1, if((!isprime(n^k-d))||(!isprime(n^k+d)), v[n-1]=k; break, k++)); ); return(v); }

%o a=avector(10000) \\ For nmax=6000000 runs out of 1GB memory

%Y Cf. A245509, A245510, A245511, A245512, A245513.

%K nonn

%O 2,3

%A _Stanislav Sykora_, Jul 24 2014