login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A308829 Numbers k such that 3^k - k + 1 is prime. 0

%I #88 Apr 14 2020 10:39:34

%S 0,1,5,27,45,47,75,8895,11405,29517,84615,218307

%N Numbers k such that 3^k - k + 1 is prime.

%C Sieving can be limited to odd values of k, because 3^k - k + 1 is even when k is even. In fact, if k is even, 3^k - k is odd and the successor is even.

%t ListA[k_] := Block[{seq = {}, n = 0, i = 0}, While[Length[seq] < k, {n = 3^i - i + 1, If[PrimeQ[n], AppendTo[seq, i]], i += 1}]; seq]

%o (Sage)

%o def list_a(k):

%o return [i for i in range(k) if (3**i) - i + 1 in Primes()]

%o (PARI) isok(k) = isprime(3^k - k + 1); \\ _Jinyuan Wang_, Aug 03 2019

%Y Cf. A100361, A100362.

%K nonn,hard,more

%O 1,3

%A _Giuseppe Bonaccorso_, Aug 02 2019

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 16:45 EDT 2024. Contains 371989 sequences. (Running on oeis4.)