A318291 a(n) is the minimum k > 0 such that n*2^k - 3 is prime, or 0 if no such k exists.
3, 2, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 2, 0, 1, 1, 0, 2, 1, 0, 1, 1, 0, 1, 2, 0, 1, 2, 0, 1, 1, 0, 3, 1, 0, 1, 1, 0, 2, 1, 0, 1, 2, 0, 1, 3, 0, 2, 1, 0, 1, 1, 0, 1, 1, 0, 1, 2, 0, 2, 7, 0, 3, 1, 0, 1, 2, 0, 1, 1, 0, 5, 2, 0, 1, 1, 0, 2, 1, 0, 3, 1, 0, 1, 4, 0
Offset: 1
Keywords
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Maple
f:= proc(n) local k; if n mod 3 = 0 then return 0 fi; for k from 1 do if isprime(n*2^k-3) then return k fi od end proc: f(3):= 1: map(f, [$1..100]); # Robert Israel, Sep 03 2018
-
Mathematica
Array[If[And[Mod[#, 3] == 0, # > 3], 0, Block[{k = 1}, While[! PrimeQ[# 2^k - 3], k++]; k]] &, 105] (* Michael De Vlieger, Sep 04 2018 *)
-
PARI
a(n)={my(k=0); if(n%3||n==3, k++; while(!isprime((n<
Andrew Howroyd, Aug 24 2018
Extensions
a(3) corrected and a(19)-a(87) from Andrew Howroyd, Aug 25 2018
a(47), a(62), and a(86) corrected by Jon E. Schoenfield, Aug 29 2018
Comments