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.

User: Atticus Stewart

Atticus Stewart's wiki page.

Atticus Stewart has authored 2 sequences.

A347111 a(n) is n in binary rendered as a base-10 number minus n in ternary rendered as a base-10 number.

Original entry on oeis.org

0, 8, 1, 89, 89, 90, 90, 978, 901, 909, 909, 990, 990, 998, 991, 9879, 9879, 9810, 9810, 9898, 9891, 9899, 9899, 10780, 10780, 10788, 10011, 10099, 10099, 10100, 10100, 98988, 98981, 98989, 98989, 99000, 99000, 99008, 99001, 99889, 99889, 99890, 99890, 99978
Offset: 1

Author

Atticus Stewart, Aug 17 2021

Keywords

Comments

Theorem: a(6k - 2) = a(6k - 1), a(6k) = a(6k + 1), and a(6k + 2) != a(6k + 3) for all positive integers k.
Proof: a(6k - 2) in binary has a last digit of 0 and in ternary has a last digit of 1. a(6k - 1) is unchanged in both binary and ternary except for the last digit, which is increased by one in both bases. Since the 0 becomes a 1 in the binary number, which is a valid digit in binary, and the 1 becomes a 2 in the ternary number, which is a valid digit in ternary, the base-10 difference between the two numbers is the same.
The proof of the equality of a(6k) and a(6k + 1) is essentially the same; the binary and ternary numbers have last digits of 0, and those numbers plus 1 have last digits of 1; therefore the difference is the same.
In the last part of the theorem, a(6k + 2) != a(6k + 3), the binary number will increase by 1 when rendered in base 10. However, the ternary number's second to last digit will change because the last digit goes from 2 to 0. This means that there is an increase in the number not equal to one. Therefore the differences are different.
Theorem: a(n) contains only the digits 0, 1, 7, 8, and 9.
Proof: When we subtract the numbers in base 10, the possible digits of the difference are all of the possible combinations of the digits, including borrowed digits. With the number subtracted from being a number in binary and the number that is subtracted being a number in ternary, we can get the digits 0, 1, 7, 8, and 9 (with borrowing), and no other digits.

Examples

			a(7) = 111 (7 in binary) - 21 (7 in ternary) = 90.
		

Crossrefs

Programs

  • Mathematica
    Array[Subtract @@ Map[FromDigits, IntegerDigits[#, {2, 3}]] &, 44] (* Michael De Vlieger, Aug 18 2021 *)
  • PARI
    a(n) = fromdigits(digits(n, 2)) - fromdigits(digits(n, 3)); \\ Michel Marcus, Aug 19 2021

Formula

a(n) = A007088(n) - A007089(n).

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.

Original entry on oeis.org

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
Offset: 1

Author

Atticus Stewart, Aug 15 2021

Keywords

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.

Examples

			a(4) = 6 because 6 is the smallest k such that a(3) + k is the product of two distinct primes.
		

Crossrefs

Programs

  • 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 *)
  • 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