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!)
A119624 Least k>0 such that, for n>1, 2*n^k + 1 is prime; or 0 if no such prime possible as 2*n^k + 1 is 0 mod(3). 3
1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 3, 0, 1, 1, 0, 47, 1, 0, 1, 1, 0, 1, 2, 0, 1, 2, 0, 1, 1, 0, 3, 1, 0, 1, 1, 0, 2729, 1, 0, 1, 2, 0, 1, 2, 0, 175, 1, 0, 1, 1, 0, 1, 1, 0, 1, 3, 0, 3, 3, 0, 43, 1, 0, 1, 2, 0, 1, 1, 0, 3, 2, 0, 1, 1, 0, 3, 1, 0, 11, 1, 0, 1, 4, 0, 1, 2, 0, 1, 1, 0, 3, 2, 0, 1, 1, 0, 1, 1, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,12

LINKS

Robert Israel, Table of n, a(n) for n = 1..217

MAPLE

f:= proc(n) local k;

if n mod 3 = 1 then return 0 fi;

  if n mod 3 = 2 then r:= 2 else r:= 1 fi;

  for k from 1 by r do if isprime(2*n^k+1) then return k fi od

end proc:

f(1):= 1:

map(f, [$1..100]); # Robert Israel, Apr 02 2018

MATHEMATICA

f[n_] := Block[{k = 0}, If[Mod[n, 3] != 1, k = 1; While[ ! PrimeQ[2*n^k + 1], k++ ]; ]; k ]; Table[f[n], {n, 2, 100}] (* Ray Chandler, Jun 08 2006 *)

Table[If[n>1 && Mod[n, 3]==1, 0, k=1; While[ !PrimeQ[2n^k+1], k++ ]; k], {n, 100}] (* T. D. Noe, Jun 08 2006 *)

PROG

(PARI) a(n) = if(n%3==1, 0, for(k=1, 2^24, if(ispseudoprime(2*n^k+1), return(k)))) \\ Eric Chen, Mar 20 2015

CROSSREFS

Cf. A119591, A253178.

Sequence in context: A147985 A147987 A036860 * A213727 A119612 A101949

Adjacent sequences:  A119621 A119622 A119623 * A119625 A119626 A119627

KEYWORD

nonn

AUTHOR

Pierre CAMI, Jun 08 2006

EXTENSIONS

Extended by Ray Chandler and T. D. Noe, Jun 08 2006

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 September 22 16:01 EDT 2020. Contains 337291 sequences. (Running on oeis4.)