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!)
A344093 a(n) is the smallest positive integer not already in the sequence such that a(n) + a(n-1) is the product of two distinct primes, with a(1) = 1. 0
1, 5, 9, 6, 4, 2, 8, 7, 3, 11, 10, 12, 14, 19, 15, 18, 16, 17, 21, 13, 20, 26, 25, 30, 27, 24, 22, 29, 28, 23, 32, 33, 36, 38, 31, 34, 35, 39, 43, 42, 40, 37, 45, 41, 44, 47, 46, 48, 58, 53, 62, 49, 57, 54, 52, 59, 56, 50, 61, 68, 51, 55, 60, 63, 66, 67, 74, 69, 64 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
This sequence is not to be confused with A243625 (similar but with "semiprime" instead of "product of two distinct primes"). This sequence omits squares of primes, whereas semiprimes include them. This sequence is also similar to A055625, in which sums of consecutive terms are primes instead of semiprimes.
Interestingly, the first 9 terms are a permutation of the first 9 positive integers. This is also true for the first 12, 21, 30, and 48 terms, and possibly higher values as well. This suggests that every positive integer occurs, but this is unproved.
LINKS
EXAMPLE
a(4) = 6 because 6 is the smallest k such that a(3) + k is the product of two distinct primes.
MATHEMATICA
a[1]=1; a[n_]:=a[n]=(k=1; While[MemberQ[Array[a, n-1], k]||Last/@FactorInteger[a[n-1]+k]!={1, 1}, k++]; k); Array[a, 100] (* Giorgos Kalogeropoulos, Aug 16 2021 *)
PROG
(Python)
terms = [1]
previous = 1
def isValid(num):
counter = 0
for possibleDiv in range(1, int(math.sqrt(num)) + 1):
if num % possibleDiv == 0:
counter += 1
if num/possibleDiv % possibleDiv == 0 and possibleDiv != 1:
return False
if counter > 2:
return False
if counter == 2:
return True
return False
def generateSequence(numOfTerms):
for i in range(numOfTerms):
testNum = 1
valid = False
while not valid:
if testNum not in terms:
possibleNum = previous + testNum
if isValid(num):
valid = True
terms.append(testNum)
previous = testNum
testNum += 1
CROSSREFS
Sequence in context: A117605 A303983 A073003 * A087498 A274633 A238200
KEYWORD
nonn
AUTHOR
Atticus Stewart, Aug 15 2021
STATUS
approved

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 23 13:11 EDT 2024. Contains 371913 sequences. (Running on oeis4.)