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.

A355640 a(0) = 0, and for any n > 0, a(n) is the least positive multiple of n whose balanced ternary expansion contains as many negative trits as positive trits.

Original entry on oeis.org

0, 2, 2, 6, 8, 20, 6, 56, 8, 18, 20, 154, 24, 26, 56, 60, 16, 136, 18, 266, 20, 168, 154, 46, 24, 400, 26, 54, 56, 232, 60, 62, 32, 462, 136, 70, 72, 74, 266, 78, 80, 164, 168, 86, 440, 180, 46, 188, 48, 98, 400, 408, 52, 424, 54, 440, 56, 798, 232, 236, 60
Offset: 0

Views

Author

Rémy Sigrist, Jul 11 2022

Keywords

Comments

A174658 corresponds to fixed points.

Examples

			For n = 5:
- the first multiple of 5 (alongside their balanced ternary expansions) are:
      k  k*5  bter(k*5)  #1  #T
      -  ---  ---------  --  --
      1    5        1TT   1   2
      2   10        101   2   0
      3   15       1TT0   1   2
      4   20       1T1T   2   2
- negative and positive trits are first balanced for k = 4,
- so a(5) = 4*5 = 20.
		

Crossrefs

See A143146 for a similar sequence.
Cf. A065363, A174658 (fixed points), A355639.

Programs

  • PARI
    a(n) = { for (k=1, oo, my (m=k*n, s=0, d); while (m, m=(m-d=[0, 1, -1][1+m%3])/3; s+=d); if (s==0, return (k*n))) }

Formula

a(n) = n * A355639(n).

A355642 Lexicographically earliest sequence of distinct nonnegative integers such that for any n >= 0, the balanced ternary expansion of n * a(n) contains as many negative trits as positive trits.

Original entry on oeis.org

0, 2, 1, 6, 4, 12, 3, 8, 7, 16, 13, 14, 5, 10, 11, 26, 9, 24, 23, 28, 20, 22, 21, 18, 17, 32, 15, 46, 19, 30, 29, 40, 25, 42, 34, 48, 36, 38, 37, 44, 31, 52, 33, 54, 39, 58, 27, 74, 35, 56, 55, 68, 41, 70, 43, 50, 49, 64, 45, 66, 60, 72, 63, 62, 57, 76, 59, 80
Offset: 0

Views

Author

Rémy Sigrist, Jul 11 2022

Keywords

Comments

This sequence is a self-inverse permutation of the nonnegative integers.

Examples

			The first terms, alongside the balanced ternary expansion of n * a(n), are:
  n   a(n)  bter(n*a(n))
  --  ----  ------------
   0     0             0
   1     2            1T
   2     1            1T
   3     6          1T00
   4     4          1TT1
   5    12         1T1T0
   6     3          1T00
   7     8         1T01T
   8     7         1T01T
   9    16        1TT100
  10    13        1TTT11
  11    14        1T0T01
  12     5         1T1T0
		

Crossrefs

See A306993 for a similar sequence.

Programs

  • PARI
    See Links section.
Showing 1-2 of 2 results.