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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A102368 Smallest k>0 such that n^k + 1 is not prime. 1
3, 1, 3, 1, 3, 1, 1, 1, 3, 1, 2, 1, 1, 1, 3, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 3, 1, 1, 1, 3, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 3, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2 (list; graph; refs; listen; history; text; internal format)
OFFSET

2,1

COMMENTS

a(odd) = 1.

Since n + 1 divides n^3 + 1, a(n) <= 3. - Robert Israel, Jun 15 2014

LINKS

Robert Israel, Table of n, a(n) for n = 2..10000

EXAMPLE

n=10: 10^1+1=11=A000040(5), 10^2+1=101=A000040(26), but 10^3+1=1001=7*11*13, therefore a(10)=3.

MAPLE

A102368:= proc(n)

  if n::odd or not isprime(n+1) then 1

    elif isprime(n^2+1) then 3 else 2

  fi

end proc; # Robert Israel, Jun 15 2014

MATHEMATICA

sk[n_]:=Module[{k=1}, While[PrimeQ[n^k+1], k++]; k]; Array[sk, 110, 2] (* Harvey P. Dale, Apr 09 2016 *)

CROSSREFS

Cf. A070689: a(n) = 3.

Sequence in context: A201681 A062174 A154754 * A277109 A063062 A066056

Adjacent sequences:  A102365 A102366 A102367 * A102369 A102370 A102371

KEYWORD

nonn

AUTHOR

Reinhard Zumkeller, Feb 22 2005

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 July 24 06:56 EDT 2021. Contains 346273 sequences. (Running on oeis4.)