login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo

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 56th year, we are closing in on 350,000 sequences, and we’ve crossed 9,700 citations (which often say “discovered thanks to the OEIS”).

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A245511 Smallest m such that the largest odd number < n^m is not prime. 6
1, 1, 2, 3, 2, 3, 2, 4, 1, 1, 2, 3, 2, 4, 1, 1, 2, 4, 2, 3, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 2, 3, 1, 1, 1, 1, 2, 2, 1, 1, 2, 3, 2, 2, 1, 1, 2, 3, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 2, 3, 2, 3, 1, 1, 1, 1, 2, 3, 1, 1, 2, 2, 2, 3, 1, 1, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET

2,3

COMMENTS

The locution "largest odd number < n^m" means n^m-1 for even n and n^m-2 for odd n.

The record values in this sequence are a(2)=1, a(4)=2, a(5)=3, a(9)=4, a(279)=5, a(15331)=6, a(1685775)=7. No higher value was found up to 5500000 (see also A245512). It is not clear whether a(n) is bounded.

LINKS

Stanislav Sykora, Table of n, a(n) for n = 2..10000

EXAMPLE

a(2)=1 because 2^1-1 is 1, which is not a prime.

a(5)=3 because the numbers 5^k-2, for k=1,2,3,.., are 3,23,123,... and the first nonprime among them corresponds to k=3.

MATHEMATICA

f[n_] := Block[{m = 1, d = If[ OddQ@ n, 2, 1]}, While[t = n^m - d; EvenQ@ t || PrimeQ@ t, m++]; m]; Array[f, 105, 2] (* Robert G. Wilson v, Aug 04 2014 *)

PROG

(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), v[n-1]=k; break, k++)); ); return(v); }

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

CROSSREFS

Cf. A245509, A245510, A245512, A245513, A245514.

Sequence in context: A103509 A252941 A069898 * A259940 A228829 A341982

Adjacent sequences:  A245508 A245509 A245510 * A245512 A245513 A245514

KEYWORD

nonn

AUTHOR

Stanislav Sykora, Jul 24 2014

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified December 3 12:16 EST 2021. Contains 349462 sequences. (Running on oeis4.)