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.

Showing 1-2 of 2 results.

A340395 a(n) = A340131(A001006(n)).

Original entry on oeis.org

5, 15, 50, 150, 455, 1365, 4100, 12300, 36905, 110715, 332150, 996450, 2989355, 8968065, 26904200, 80712600, 242137805, 726413415, 2179240250, 6537720750, 19613162255, 58839486765, 176518460300, 529555380900, 1588666142705, 4765998428115, 14297995284350
Offset: 2

Views

Author

Gennady Eremin, Jan 06 2021

Keywords

Comments

This sequence is associated with A340131, whose terms are sorted by the length of their ternary code. Elements with the same length of ternary code form a range that has a maximum. The maximal term of the n-range (a set of elements with ternary code length n in A340131) is a(n). Example: numbers 29, 33, 44, 45 and 50 have a ternary length of 4 (see A340131), respectively a(4) = 50.
Ternary code for a(n) is 12..12 for even n and 12..120 for odd n.

Examples

			A001006(2) = 2, so a(2) = A340131(2) = 5.
A001006(3) = 4, so a(3) = A340131(4) = 15, etc.
		

Crossrefs

Subsequence of A340131.

Programs

  • PARI
    Vec(5/(1 - 3*x - x^2 + 3*x^3) + O(x^30)) \\ Andrew Howroyd, Jan 08 2021

Formula

a(n) = 5*3^(n-2*k)*(9^k-1)/8 where k = floor(n/2).
a(n+1) = 3*a(n) for even n >= 2; a(n+1) = 3*a(n)+5 for odd n >= 3.
a(n) = 5*A033113(n-1).
a(n) = (5/8)*(3^n - (-1)^(n-1) - 2).
a(n) = 2*a(n-1) + 3*a(n-2) + 5 for n > 3.
From Stefano Spezia, Jan 06 2021: (Start)
G.f.: 5*x^2/(1 - 3*x - x^2 + 3*x^3).
a(n) = 3*a(n-1) + a(n-2) - 3*a(n-3) for n > 4. (End)

A340544 Numbers from A340131 that are not multiples of 3.

Original entry on oeis.org

5, 11, 29, 44, 50, 83, 98, 104, 116, 128, 140, 146, 245, 260, 266, 278, 290, 302, 308, 332, 344, 377, 380, 395, 401, 410, 416, 434, 449, 455, 731, 746, 752, 764, 776, 788, 794, 818, 830, 863, 866, 881, 887, 896, 902, 920, 935, 941, 980, 992, 1025, 1028, 1043
Offset: 1

Views

Author

Gennady Eremin, Jan 11 2021

Keywords

Comments

Terms are reduced, i.e., ternary codes do not have trailing zeros.
The term is a digitized Motzkin path that starts with an up step and ends with a down step. Such a path has neither leading nor final flat steps, i.e., the ternary code of the corresponding term has no finite 0's. Recall that in ternary code, 1's are up steps, and 2's are down steps.
The number of terms with a ternary code of length k is A026107(k-1). For instance, 7 (seven) reduced terms 83, 98, 104, 116, 128, 140, and 146 have a ternary length of 5, namely 10002, 10122, 10212, 11022, 11202, 12012, and 12102. Respectively A026107(4) = 7.

Crossrefs

Intersection of A001651 and A340131.
Subsequences: A134752, A168607.
Cf. A026107.

Programs

  • Python
    def digits(n, b):
      out = []
      while n >= b:
        out.append(n % b)
        n //= b
      return [n] + out[::-1]
    def ok(n):
      if n%3 == 0: return False
      t = digits(n, 3)
      if t.count(1) != t.count(2): return False
      return all(t[:i].count(1) >= t[:i].count(2) for i in range(1, len(t)))
    print([n for n in range(750) if ok(n)]) # after Michael S. Branicky (A340131)
Showing 1-2 of 2 results.