login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Numbers m such that 3^(2m+1) - 3^m + 1 is prime.
1

%I #27 Aug 12 2024 23:28:25

%S 0,3,4,11,35,56,88,104,476,1367,1707,2472,22232,25260

%N Numbers m such that 3^(2m+1) - 3^m + 1 is prime.

%C a(14) > 30000.

%C a(14) > 50000. - _Michael S. Branicky_, Aug 12 2024

%p for m from 0 to 3000 do if isprime(3^(2*m + 1) - 3^m + 1) then print(m); end if; end do;

%t Do[If[PrimeQ[3^(2 m + 1) - 3^m + 1], Print[m]], {m, 0, 3000}]

%t Select[Range[0,2500],PrimeQ[3^(2#+1)-3^#+1]&] (* _Harvey P. Dale_, Mar 01 2023 *)

%o (PARI) for(m=0, 3e3, if(isprime(3^(2*m+1)-3^m+1), print1(m", ")))

%o (SageMath)

%o for m in range(3000):

%o if is_prime(3^(2*m + 1) - 3^m + 1):

%o print(m)

%Y Cf. A344170.

%K nonn,more

%O 1,2

%A _Reza K Ghazi_, May 13 2021