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.

This page as a plain text file.
%I A102368 #11 Apr 10 2016 10:16:34
%S A102368 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,
%T A102368 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,
%U A102368 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
%N A102368 Smallest k>0 such that n^k + 1 is not prime.
%C A102368 a(odd) = 1.
%C A102368 Since n + 1 divides n^3 + 1, a(n) <= 3. - _Robert Israel_, Jun 15 2014
%H A102368 Robert Israel, <a href="/A102368/b102368.txt">Table of n, a(n) for n = 2..10000</a>
%e A102368 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.
%p A102368 A102368:= proc(n)
%p A102368   if n::odd or not isprime(n+1) then 1
%p A102368     elif isprime(n^2+1) then 3 else 2
%p A102368   fi
%p A102368 end proc; # _Robert Israel_, Jun 15 2014
%t A102368 sk[n_]:=Module[{k=1},While[PrimeQ[n^k+1],k++];k]; Array[sk,110,2] (* _Harvey P. Dale_, Apr 09 2016 *)
%Y A102368 Cf. A070689: a(n) = 3.
%K A102368 nonn
%O A102368 2,1
%A A102368 _Reinhard Zumkeller_, Feb 22 2005