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.

A239677 Least numbers k such that k*3^n-1 is prime.

This page as a plain text file.
%I A239677 #10 May 22 2025 10:21:37
%S A239677 1,2,2,8,4,6,2,2,16,8,6,2,16,10,4,14,8,18,6,2,18,6,2,20,18,6,2,38,30,
%T A239677 10,16,20,18,6,2,60,20,10,10,40,58,48,16,12,4,32,90,30,10,8,130,62,26,
%U A239677 10,6,2,30,10,32,18,6,2,74,28,46,18,6,2,30,10,46,80,94,52
%N A239677 Least numbers k such that k*3^n-1 is prime.
%C A239677 All the numbers in this sequence, excluding a(1), are even.
%e A239677 1*3^2-1 = 8 is not prime. 2*3^2-1 = 17 is prime. Thus, a(2) = 2.
%e A239677 1*3^5-1 = 242 is not prime. 2*3^5-1 = 485 is not prime. 3*3^5-1 = 728 is not prime. 4*3^5-1 = 971 is prime. Thus, a(5) = 4.
%o A239677 (Python)
%o A239677 import sympy
%o A239677 from sympy import isprime
%o A239677 def Pow_3(n):
%o A239677   for k in range(10**4):
%o A239677     if isprime(k*(3**n)-1):
%o A239677       return n
%o A239677 n = 1
%o A239677 while n < 100:
%o A239677   print(Pow_3(n))
%o A239677   n += 1
%o A239677 (PARI)
%o A239677 for(n=1, 100, k=0; while(!isprime(k*3^n-1), k++); print1(k, ", ")) \\ _Colin Barker_, Mar 24 2014
%Y A239677 Cf. A085427.
%K A239677 nonn
%O A239677 1,2
%A A239677 _Derek Orr_, Mar 23 2014