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

A356097 A family of triangles T(m), m >= 0, read by triangles and then by rows; triangle T(0) is [1; 1, 1]; for m >= 0, triangle T(m+1) is obtained by replacing each subtriangle [t; u, v] in T(m) by [t; t, t; u, t+u+v, v; u, u, v, v].

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 5, 1, 1, 1, 5, 3, 3, 5, 1, 1, 1, 3, 3, 3, 1, 1, 1, 1, 5, 3, 3, 5, 1, 1, 1, 3, 1, 1, 5, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 5, 1, 1, 1, 5, 3, 3, 5, 1
Offset: 0

Views

Author

Rémy Sigrist, Jul 26 2022

Keywords

Comments

We apply the following substitutions to transform T(m) into T(m+1):
t
/ \
/ \
t t-----t
/ \ _\ / \ / \
/ \ / / \ / \
u-----v u---t+u+v---v
/ \ / \ / \
/ \ / \ / \
u-----u-----v-----v
and:
u-----u-----v-----v
\ / \ / \ /
\ / \ / \ /
u-----v u---t+u+v---v
\ / _\ \ / \ /
\ / / \ / \ /
t t-----t
\ /
\ /
t
T(m) has 3^m+1 rows.
All terms are odd.
As m gets larger, T(m) exhibits interesting fractal features (see illustrations in Links section).

Examples

			Triangle T(0) is:
              1
             1 1
Triangle T(1) is:
              1
             1 1
            1 3 1
           1 1 1 1
Triangle T(2) is:
              1
             1 1
            1 3 1
           1 1 1 1
          1 1 5 1 1
         1 5 3 3 5 1
        1 1 3 3 3 1 1
       1 1 5 3 3 5 1 1
      1 3 1 1 5 1 1 3 1
     1 1 1 1 1 1 1 1 1 1
		

Crossrefs

See A355855, A356002, A356096 and A356098 for similar sequences.
Cf. A353174.

Programs

  • PARI
    See Links section.

A352502 a(n) is the number of integers k in the interval 0..n such that k and n-k can be added without carries in balanced ternary.

Original entry on oeis.org

1, 2, 2, 4, 4, 2, 4, 4, 6, 10, 8, 6, 10, 8, 2, 4, 4, 6, 10, 8, 6, 10, 8, 10, 16, 12, 18, 28, 20, 14, 22, 16, 10, 16, 12, 18, 28, 20, 14, 22, 16, 2, 4, 4, 6, 10, 8, 6, 10, 8, 10, 16, 12, 18, 28, 20, 14, 22, 16, 10, 16, 12, 18, 28, 20, 14, 22, 16, 18, 28, 20, 30
Offset: 0

Views

Author

Rémy Sigrist, Apr 28 2022

Keywords

Comments

Two integers can be added without carries in balanced ternary if they have no equal nonzero digit at the same position.
This sequence has connections with Gould's sequence (A001316); here we work with balanced ternary, there with binary.

Examples

			For n = 8:
- we consider the following cases:
              k|    0    1    2    3    4    5    6    7    8
      ---------+---------------------------------------------
        bter(k)|    0    1   1T   10   11  1TT  1T0  1T1  10T
      bter(8-k)|  10T  1T1  1T0  1TT   11   10   1T    1    0
       carries?|  no   yes  no   no   yes  no   no   yes  no
- so a(8) = 6.
		

Crossrefs

Cf. A001316, A059095, A140429, A353174 (corresponding k's).

Programs

  • PARI
    ok(u,v) = { while (u && v, my (uu=[0,+1,-1][1+u%3], vv=[0,+1,-1][1+v%3]); if (abs(uu+vv)>1, return (0)); u=(u-uu)/3; v=(v-vv)/3); return (1) }
    a(n) = sum(k=0, n, ok(n-k, k))

Formula

a(n) <= n+1 with equality iff n belongs to A140429.
a(3*n) = 3*a(n) - 2.
a(3*n+1) = a(3*n-1) + 2.

A380273 Irregular table T(n, k), n >= 0, k = 1..A380272(n), read by rows; the n-th row lists the integers m in 0..n such that the nonadjacent forms for m-n and m can be added without carries.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Jan 18 2025

Keywords

Comments

The nonadjacent forms for two integers, say Sum_{i >= 0} x_i * 2^i and Sum_{i >= 0} y_i * 2^i, can be added without carries iff for any i >= 0:
- abs(x_i + y_i) <= 1,
- (x_i + y_i) * (x_{i+1} + y_{i+1}) = 0.

Examples

			Table T(n, k) begins:
  n   n-th row
  --  ----------------------------------------
   0  0
   1  0, 1
   2  0, 2
   3  0, 3
   4  0, 1, 3, 4
   5  0, 1, 4, 5
   6  0, 6
   7  0, 7
   8  0, 1, 2, 6, 7, 8
   9  0, 1, 8, 9
  10  0, 2, 8, 10
  11  0, 11
  12  0, 1, 11, 12
  13  0, 1, 12, 13
  14  0, 14
  15  0, 3, 4, 11, 12, 15
  16  0, 1, 2, 3, 4, 5, 11, 12, 13, 14, 15, 16
		

Crossrefs

See A295989 and A353174 for similar sequences.
Cf. A380272.

Programs

  • PARI
    ok(x, y) = { my (dx, dy, p = 0, q); while (x || y, if (x % 2, x -= dx = 2 - (x%4), dx = 0); if (y % 2, y -= dy = 2 - (y%4), dy = 0); if (dx && dx==dy, return (0);); q = dx + dy; if (p && q, return (0);); x /= 2; y /= 2; p = q;); return (1); }
    row(n) = select(k -> ok(n-k, k), [0..n])

Formula

T(n, 1) = 0.
T(n, A380272(n)) = n.

A363930 Irregular table T(n, k), n >= 0, k = 1..A363710(n), read by rows; the n-th row lists the nonnegative numbers m <= n such that A003188(m) AND A003188(n-m) = 0 (where AND denotes the bitwise AND operator).

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Jun 28 2023

Keywords

Comments

This sequence is related to the T-square fractal (see A363710).

Examples

			Table T(n, k) begins:
  n   n-th row
  --  ----------------------
   0  0
   1  0, 1
   2  0, 2
   3  0, 3
   4  0, 1, 3, 4
   5  0, 1, 4, 5
   6  0, 6
   7  0, 7
   8  0, 1, 7, 8
   9  0, 1, 2, 3, 6, 7, 8, 9
  10  0, 2, 3, 7, 8, 10
  11  0, 3, 8, 11
  12  0, 1, 3, 9, 11, 12
  13  0, 1, 12, 13
  14  0, 14
  15  0, 15
  16  0, 1, 15, 16
		

Crossrefs

See A295989, A353174 and A362327 for similar sequences.

Programs

  • PARI
    row(n) = { select (m -> bitand(bitxor(m, m\2), bitxor(n-m, (n-m)\2))==0, [0..n]) }

Formula

T(n, 1) = 0.
T(n, A363710(n)) = n.
T(n, k) + T(n, A363710(n)+1-k) = n.
Showing 1-4 of 4 results.