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.

A102368 Smallest k>0 such that n^k + 1 is not prime.

Original entry on oeis.org

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
Offset: 2

Views

Author

Reinhard Zumkeller, Feb 22 2005

Keywords

Comments

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

Examples

			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.
		

Crossrefs

Cf. A070689: a(n) = 3.

Programs

  • 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 *)