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-5 of 5 results.

A060373 q(n), negative part of n when n=p(n)-q(n) with p(n), q(n), p(n)+q(n) in A005836, integers written without 2 in base 3.

Original entry on oeis.org

0, 0, 1, 0, 0, 4, 3, 3, 1, 0, 0, 1, 0, 0, 13, 12, 12, 10, 9, 9, 10, 9, 9, 4, 3, 3, 1, 0, 0, 1, 0, 0, 4, 3, 3, 1, 0, 0, 1, 0, 0, 40, 39, 39, 37, 36, 36, 37, 36, 36, 31, 30, 30, 28, 27, 27, 28, 27, 27, 31, 30, 30, 28, 27, 27, 28, 27, 27, 13, 12, 12, 10, 9, 9, 10, 9, 9, 4, 3, 3, 1, 0, 0, 1, 0
Offset: 0

Views

Author

Claude Lenormand (claude.lenormand(AT)free.fr), Apr 02 2001

Keywords

Crossrefs

Programs

A343228 A binary encoding of the digits "+1" in balanced ternary representation of n.

Original entry on oeis.org

0, 1, 2, 2, 3, 4, 4, 5, 4, 4, 5, 6, 6, 7, 8, 8, 9, 8, 8, 9, 10, 10, 11, 8, 8, 9, 8, 8, 9, 10, 10, 11, 12, 12, 13, 12, 12, 13, 14, 14, 15, 16, 16, 17, 16, 16, 17, 18, 18, 19, 16, 16, 17, 16, 16, 17, 18, 18, 19, 20, 20, 21, 20, 20, 21, 22, 22, 23, 16, 16, 17, 16
Offset: 0

Views

Author

Rémy Sigrist, Apr 08 2021

Keywords

Comments

The ones in the binary representation of a(n) correspond to the digits "+1" in the balanced ternary representation of n.
We can extend this sequence to negative indices: a(-n) = A343229(n) for any n >= 0.

Examples

			The first terms, alongside the balanced ternary representation of n (with "T" instead of digits "-1") and the binary representation of a(n), are:
  n   a(n)  ter(n)  bin(a(n))
  --  ----  ------  ---------
   0     0       0          0
   1     1       1          1
   2     2      1T         10
   3     2      10         10
   4     3      11         11
   5     4     1TT        100
   6     4     1T0        100
   7     5     1T1        101
   8     4     10T        100
   9     4     100        100
  10     5     101        101
  11     6     11T        110
  12     6     110        110
  13     7     111        111
  14     8    1TTT       1000
  15     8    1TT0       1000
		

Crossrefs

Programs

  • PARI
    a(n) = { my (v=0, b=1, t); while (n, t=centerlift(Mod(n, 3)); if (t==+1, v+=b); n=(n-t)\3; b*=2); v }

Formula

a(n) = A289831(A060372(n)).

A060374 a(n)=p+q, where n=p-q and p, q, p+q are in A005836 (integers written without 2 in base 3).

Original entry on oeis.org

0, 1, 4, 3, 4, 13, 12, 13, 10, 9, 10, 13, 12, 13, 40, 39, 40, 37, 36, 37, 40, 39, 40, 31, 30, 31, 28, 27, 28, 31, 30, 31, 40, 39, 40, 37, 36, 37, 40, 39, 40, 121, 120, 121, 118, 117, 118, 121, 120, 121, 112, 111, 112, 109, 108, 109, 112, 111, 112, 121, 120, 121, 118
Offset: 0

Views

Author

Claude Lenormand (claude.lenormand(AT)free.fr), Apr 02 2001

Keywords

Crossrefs

Programs

  • Haskell
    a060374 n = f $ dropWhile (< n) a005836_list where
       f (p:ps) | a039966 (p-n) == 1 && a039966 (2*p-n) == 1 = 2*p - n
                | otherwise                                  = f ps
    -- Reinhard Zumkeller, Sep 29 2011

Extensions

Definition clarified by Zoran Sunic, Feb 16 2006

A380180 Irregular table T(n, k), n >= 0, k = 1..2^A005812(n); the n-th row lists the integers m (possibly negative) such that the nonzero digits in the balanced ternary expansion of m appear in the balanced ternary expansion of n.

Original entry on oeis.org

0, 0, 1, -1, 0, 2, 3, 0, 3, 0, 1, 3, 4, -4, -3, -1, 0, 5, 6, 8, 9, -3, 0, 6, 9, -3, -2, 0, 1, 6, 7, 9, 10, -1, 0, 8, 9, 0, 9, 0, 1, 9, 10, -1, 0, 2, 3, 8, 9, 11, 12, 0, 3, 9, 12, 0, 1, 3, 4, 9, 10, 12, 13, -13, -12, -10, -9, -4, -3, -1, 0, 14, 15, 17, 18, 23, 24, 26, 27
Offset: 0

Views

Author

Rémy Sigrist, Jan 15 2025

Keywords

Comments

Every integer appears infinitely many times in the sequence.
See A368239 (resp. A380181) for the nonnegative values (resp. the nonpositive values, negated) in order of appearance in the present sequence.

Examples

			Irregular table T(n, k) begins:
  n   n-th row
  --  -------------------------
   0  0
   1  0, 1
   2  -1, 0, 2, 3
   3  0, 3
   4  0, 1, 3, 4
   5  -4, -3, -1, 0, 5, 6, 8, 9
   6  -3, 0, 6, 9
   7  -3, -2, 0, 1, 6, 7, 9, 10
   8  -1, 0, 8, 9
   9  0, 9
  10  0, 1, 9, 10
  11  -1, 0, 2, 3, 8, 9, 11, 12
  12  0, 3, 9, 12
.
Irregular table T(n, k) begins in balanced ternary:
  n    n-th row
  ---  --------------------------------
    0  0
    1  0, 1
   1T  T, 0, 1T, 10
   10  0, 10
   11  0, 1, 10, 11
  1TT  TT, T0, T, 0, 1TT, 1T0, 10T, 100
  1T0  T0, 0, 1T0, 100
  1T1  T0, T1, 0, 1, 1T0, 1T1, 100, 101
  10T  T, 0, 10T, 100
  100  0, 100
  101  0, 1, 100, 101
  11T  T, 0, 1T, 10, 10T, 100, 11T, 110
  110  0, 10, 100, 110
		

Crossrefs

See A380123 for a similar sequence.

Programs

  • PARI
    row(n) = { my (r = [0], d, t = 1); while (n, d = centerlift(Mod(n, 3)); if (d, r = concat(r, [v + d*t | v <- r]);); n = (n-d)/3; t *= 3;); vecsort(r); }

Formula

T(n, 1) = - A060373(n).
T(n, 2^A005812(n)) = A060372(n).

A112867 Greater of two ternary (base 3) numbers (each using only 0's and 1's, the latter's positions never coinciding) such that the decimal representation of their difference is n.

Original entry on oeis.org

0, 1, 10, 10, 11, 100, 100, 101, 100, 100, 101, 110, 110, 111, 1000, 1000, 1001, 1000, 1000, 1001, 1010, 1010, 1011, 1000, 1000, 1001, 1000, 1000, 1001, 1010, 1010, 1011, 1100, 1100, 1101, 1100, 1100, 1101, 1110, 1110, 1111, 10000, 10000, 10001, 10000
Offset: 0

Views

Author

Lekraj Beedassy, Jan 12 2006

Keywords

Comments

Base 3 representation of A060372. For the smaller number see A112952. Any number is expressible as a unique combination of powers of 3 in the form +/- 3^0 +/- 3^1 +/- 3^2 +/- 3^3 +/- ...(Related to Bachet's Weight problem)
Showing 1-5 of 5 results.