login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

A106843
Numbers of form 3^i * prime(j), i>=0, j>0.
2
2, 3, 5, 6, 7, 9, 11, 13, 15, 17, 18, 19, 21, 23, 27, 29, 31, 33, 37, 39, 41, 43, 45, 47, 51, 53, 54, 57, 59, 61, 63, 67, 69, 71, 73, 79, 81, 83, 87, 89, 93, 97, 99, 101, 103, 107, 109, 111, 113, 117, 123, 127, 129, 131, 135, 137, 139, 141, 149, 151, 153, 157, 159
OFFSET
1,1
COMMENTS
a(n) is either prime or of form 3*a(m), m<n.
PROG
(Python)
from itertools import count, islice
from sympy import isprime
def A106843_gen(startvalue=2): # generator of terms >= startvalue
for m in count(max(startvalue, 2)):
a, b = divmod(m, 3)
while not b:
a, b = divmod(a, 3)
if (k:=3*a+b)==1 or isprime(k):
yield m
A106843_list = list(islice(A106843_gen(), 20)) # Chai Wah Wu, Mar 30 2023
CROSSREFS
Cf. A093641.
Sequence in context: A354525 A340610 A358229 * A057165 A245395 A347498
KEYWORD
nonn
AUTHOR
Ralf Stephan, May 05 2005
STATUS
approved