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.

Previous Showing 31-40 of 60 results. Next

A253586 The sum of the i-th ternary digits of n, k, and A(n,k) equals 0 (mod 3) for each i>=0 (leading zeros included); square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

0, 2, 2, 1, 1, 1, 6, 0, 0, 6, 8, 8, 2, 8, 8, 7, 7, 7, 7, 7, 7, 3, 6, 6, 3, 6, 6, 3, 5, 5, 8, 5, 5, 8, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 18, 3, 3, 0, 3, 3, 0, 3, 3, 18, 20, 20, 5, 2, 2, 5, 2, 2, 5, 20, 20, 19, 19, 19, 1, 1, 1, 1, 1, 1, 19, 19, 19, 24, 18, 18, 24, 0, 0, 6, 0, 0, 24, 18, 18, 24
Offset: 0

Views

Author

Alois P. Heinz, Jan 04 2015

Keywords

Examples

			Square array A(n,k) begins:
  0, 2, 1, 6, 8, 7, 3, 5, 4, ...
  2, 1, 0, 8, 7, 6, 5, 4, 3, ...
  1, 0, 2, 7, 6, 8, 4, 3, 5, ...
  6, 8, 7, 3, 5, 4, 0, 2, 1, ...
  8, 7, 6, 5, 4, 3, 2, 1, 0, ...
  7, 6, 8, 4, 3, 5, 1, 0, 2, ...
  3, 5, 4, 0, 2, 1, 6, 8, 7, ...
  5, 4, 3, 2, 1, 0, 8, 7, 6, ...
  4, 3, 5, 1, 0, 2, 7, 6, 8, ...
		

Crossrefs

Column k=0 and row n=0 gives A004488.
Main diagonal gives A001477.
A(n,floor(n/3)) gives A060587.

Programs

  • Maple
    A:= proc(n, k) local i, j; `if`(n=0 and k=0, 0,
          A(iquo(n, 3, 'i'), iquo(k, 3, 'j'))*3 +irem(6-i-j, 3))
        end:
    seq(seq(A(n, d-n), n=0..d), d=0..14);

Formula

A(n,k) = A(floor(n/3),floor(k/3))*3+(6-(n mod 3)-(k mod 3) mod 3), A(0,0) = 0.

A253587 The sum of the i-th ternary digits of n, k, and T(n,k) equals 0 (mod 3) for each i>=0 (leading zeros included); triangle T(n,k), n>=0, 0<=k<=n, read by rows.

Original entry on oeis.org

0, 2, 1, 1, 0, 2, 6, 8, 7, 3, 8, 7, 6, 5, 4, 7, 6, 8, 4, 3, 5, 3, 5, 4, 0, 2, 1, 6, 5, 4, 3, 2, 1, 0, 8, 7, 4, 3, 5, 1, 0, 2, 7, 6, 8, 18, 20, 19, 24, 26, 25, 21, 23, 22, 9, 20, 19, 18, 26, 25, 24, 23, 22, 21, 11, 10, 19, 18, 20, 25, 24, 26, 22, 21, 23, 10, 9, 11
Offset: 0

Views

Author

Alois P. Heinz, Jan 04 2015

Keywords

Examples

			Triangle T(n,k) begins:
  0;
  2, 1;
  1, 0, 2;
  6, 8, 7, 3;
  8, 7, 6, 5, 4;
  7, 6, 8, 4, 3, 5;
  3, 5, 4, 0, 2, 1, 6;
  5, 4, 3, 2, 1, 0, 8, 7;
  4, 3, 5, 1, 0, 2, 7, 6, 8;
		

Crossrefs

Column k=0 gives A004488.
Main diagonal gives A001477.
T(n,floor(n/3)) gives A060587.

Programs

  • Maple
    T:= proc(n, k) local i, j; `if`(n=0 and k=0, 0,
          T(iquo(n, 3, 'i'), iquo(k, 3, 'j'))*3 +irem(6-i-j, 3))
        end:
    seq(seq(T(n, k), k=0..n), n=0..14);

Formula

T(n,k) = T(floor(n/3),floor(k/3))*3+(6-(n mod 3)-(k mod 3) mod 3), T(0,0) = 0.

A361818 For any number k >= 0, let T_k be the triangle whose base corresponds to the ternary expansion of k (without leading zeros) and other values, say t above u and v, satisfy t = (-u-v) mod 3; this sequence lists the numbers k such that T_k has 3-fold rotational symmetry.

Original entry on oeis.org

0, 1, 2, 4, 8, 13, 26, 34, 40, 46, 59, 65, 80, 112, 121, 130, 224, 233, 242, 304, 364, 424, 518, 578, 728, 772, 862, 925, 1003, 1093, 1183, 1261, 1324, 1414, 1535, 1598, 1688, 1766, 1856, 1919, 2006, 2096, 2186, 2257, 2509, 2734, 3028, 3280, 3532, 3826, 4051
Offset: 1

Views

Author

Rémy Sigrist, Mar 25 2023

Keywords

Comments

We can devise a similar sequence for any fixed base b >= 2; the present sequence corresponds to b = 3, and A334556 corresponds to b = 2.
This sequence is infinite as it contains A048328.
If k belongs to the sequence, then A004488(k) and A030102(k) belong to the sequence.
Empirically, there are 2*3^floor((w-1)/3) positive terms with w ternary digits.
For any k, if t appears above u and v in T_k, then t + u + v = 0 (mod 3) and #{t, u, v} = 1 or 3 (the three values are either equal or all distinct); each value is uniquely determined by the two others in the same way: t = (-u-v) mod 3, u = (-t-v) mod 3, v = (-t-u) mod 3; this means that we can reconstruct T_k from any of its three sides.
If some row of T_k, say r, has w values and corresponds to the ternary expansion of m, then the row above r corresponds to the w-1 rightmost digits of the ternary expansion of A060587(m).
All positive terms belong to A297250 (their most significant digit equals their least significant digit in base 3).

Examples

			The ternary expansion of 304 is "102021", and the corresponding triangle is:
             1
            0 2
           2 1 0
          0 1 1 2
         2 1 1 1 0
        1 0 2 0 2 1
As this triangle has 3-fold rotational symmetry, 304 belongs to the sequence.
		

Crossrefs

Programs

  • PARI
    See Links section.

A380349 In the ternary expansion of n, from left to right: replace the first, third, fifth, etc. nonzero digit, says d, by 3-d.

Original entry on oeis.org

0, 2, 1, 6, 7, 8, 3, 4, 5, 18, 19, 20, 21, 23, 22, 24, 26, 25, 9, 10, 11, 12, 14, 13, 15, 17, 16, 54, 55, 56, 57, 59, 58, 60, 62, 61, 63, 65, 64, 69, 70, 71, 66, 67, 68, 72, 74, 73, 78, 79, 80, 75, 76, 77, 27, 28, 29, 30, 32, 31, 33, 35, 34, 36, 38, 37, 42, 43
Offset: 0

Views

Author

Rémy Sigrist, Jan 22 2025

Keywords

Comments

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

Examples

			The ternary expansion of 321 is "102220", so the ternary expansion of a(321) is "202120", and a(321) = 555.
		

Crossrefs

See A380350, A380351 and A380352 for similar sequences.
Cf. A004488.

Programs

  • PARI
    a(n) = { my (d = digits(n, 3), nz = 0); for (k = 1, #d, if (d[k], if (nz++%2==1, d[k] = 3-d[k];););); fromdigits(d, 3); }
    
  • Python
    from gmpy2 import digits
    def a(n):
        d, nz = list(digits(n, 3)), 0
        for i, di in enumerate(d):
            if di != '0':
                nz += 1
                if nz&1: d[i] = '2' if di == '1' else '1'
        return int("".join(d), 3)
    print([a(n) for n in range(68)]) # Michael S. Branicky, Jan 24 2025

Formula

a(A380350(n)) = A380350(a(n)) = A004488.
{a(n), A380350(n)} = {A380351(n), A380352(n)}.

A380350 In the ternary expansion of n, from left to right: replace the second, fourth, sixth, etc. nonzero digit, says d, by 3-d.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Jan 22 2025

Keywords

Comments

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

Examples

			The ternary expansion of 321 is "102220", so the ternary expansion of a(321) is "101210", and a(321) = 292.
		

Crossrefs

See A380349, A380351 and A380352 for similar sequences.

Programs

  • PARI
    a(n) = { my (d = digits(n, 3), nz = 0); for (k = 1, #d, if (d[k], if (nz++%2==0, d[k] = 3-d[k];););); fromdigits(d, 3); }
    
  • Python
    from gmpy2 import digits
    def a(n):
        d, nz = list(digits(n, 3)), 0
        for i, di in enumerate(d):
            if di != '0':
                nz += 1
                if nz&1 == 0: d[i] = '2' if di == '1' else '1'
        return int("".join(d), 3)
    print([a(n) for n in range(68)]) # Michael S. Branicky, Jan 24 2025

Formula

a(A380349(n)) = A380349(a(n)) = A004488.
{a(n), A380349(n)} = {A380351(n), A380352(n)}.
a(n) = n iff n = 0 or n belongs to A038754.

A380351 In the ternary expansion of n, from right to left: replace the first, third, fifth, etc. nonzero digit, says d, by 3-d.

Original entry on oeis.org

0, 2, 1, 6, 5, 4, 3, 8, 7, 18, 11, 10, 15, 23, 22, 12, 26, 25, 9, 20, 19, 24, 14, 13, 21, 17, 16, 54, 29, 28, 33, 59, 58, 30, 62, 61, 45, 65, 64, 69, 50, 49, 66, 53, 52, 36, 74, 73, 78, 41, 40, 75, 44, 43, 27, 56, 55, 60, 32, 31, 57, 35, 34, 72, 38, 37, 42, 77
Offset: 0

Views

Author

Rémy Sigrist, Jan 22 2025

Keywords

Comments

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

Examples

			The ternary expansion of 321 is "102220", so the ternary expansion of a(321) is "101210", and a(321) = 291.
		

Crossrefs

See A380349, A380350 and A380352 for similar sequences.
Cf. A004488.

Programs

  • PARI
    a(n) = { my (d = digits(n, 3), nz = 0); forstep (k = #d, 1, -1, if (d[k], if (nz++%2==1, d[k] = 3-d[k];););); fromdigits(d, 3); }
    
  • Python
    from gmpy2 import digits
    def a(n):
        d, nz = list(digits(n, 3)), 0
        for i, di in enumerate(d[::-1], 1):
            if di != '0':
                nz += 1
                if nz&1: d[-i] = '2' if di == '1' else '1'
        return int("".join(d), 3)
    print([a(n) for n in range(68)]) # Michael S. Branicky, Jan 24 2025

Formula

a(A380352(n)) = A380352(a(n)) = A004488(n).
{a(n), A380352(n)} = {A380349(n), A380350(n)}.

A380352 In the ternary expansion of n, from right to left: replace the second, fourth, sixth, etc. nonzero digit, says d, by 3-d.

Original entry on oeis.org

0, 1, 2, 3, 7, 8, 6, 4, 5, 9, 19, 20, 21, 16, 17, 24, 13, 14, 18, 10, 11, 12, 25, 26, 15, 22, 23, 27, 55, 56, 57, 34, 35, 60, 31, 32, 63, 46, 47, 48, 70, 71, 51, 67, 68, 72, 37, 38, 39, 79, 80, 42, 76, 77, 54, 28, 29, 30, 61, 62, 33, 58, 59, 36, 73, 74, 75, 43
Offset: 0

Views

Author

Rémy Sigrist, Jan 22 2025

Keywords

Comments

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

Examples

			The ternary expansion of 321 is "102220", so the ternary expansion of a(321) is "202120", and a(321) = 555.
		

Crossrefs

See A380349, A380350 and A380351 for similar sequences.

Programs

  • PARI
    a(n) = { my (d = digits(n, 3), nz = 0); forstep (k = #d, 1, -1, if (d[k], if (nz++%2==0, d[k] = 3-d[k];););); fromdigits(d, 3); }
    
  • Python
    from gmpy2 import digits
    def a(n):
        d, nz = list(digits(n, 3)), 0
        for i, di in enumerate(d[::-1], 1):
            if di != '0':
                nz += 1
                if nz&1 == 0: d[-i] = '2' if di == '1' else '1'
        return int("".join(d), 3)
    print([a(n) for n in range(68)]) # Michael S. Branicky, Jan 24 2025

Formula

a(A380351(n)) = A380351(a(n)) = A004488(n).
{a(n), A380351(n)} = {A380349(n), A380350(n)}.
a(n) = n iff n = 0 or n belongs to A038754.

A055116 Base-6 complement of n (write n in base 6, then replace each digit with its base-6 negative).

Original entry on oeis.org

0, 5, 4, 3, 2, 1, 30, 35, 34, 33, 32, 31, 24, 29, 28, 27, 26, 25, 18, 23, 22, 21, 20, 19, 12, 17, 16, 15, 14, 13, 6, 11, 10, 9, 8, 7, 180, 185, 184, 183, 182, 181, 210, 215, 214, 213, 212, 211, 204, 209, 208, 207, 206, 205, 198, 203, 202, 201, 200, 199, 192, 197, 196
Offset: 0

Views

Author

Henry Bottomley, Apr 19 2000

Keywords

Crossrefs

Column k=6 of A248813.

A289838 a(n) = A289815(n) * A289816(n).

Original entry on oeis.org

1, 2, 2, 3, 6, 6, 3, 6, 6, 4, 10, 10, 12, 30, 30, 12, 30, 30, 4, 10, 10, 12, 30, 30, 12, 30, 30, 5, 14, 14, 15, 42, 42, 15, 42, 42, 20, 70, 70, 60, 210, 210, 60, 210, 210, 20, 70, 70, 60, 210, 210, 60, 210, 210, 5, 14, 14, 15, 42, 42, 15, 42, 42, 20, 70, 70
Offset: 0

Views

Author

Rémy Sigrist, Jul 13 2017

Keywords

Comments

Each number k > 0 appears 2^omega(k) times (where omega = A001221).
a(A004488(n)) = a(n) for any n >= 0.
The number of distinct prime factors of a(n) equals the number of nonzero digits in the ternary representation of n.

Examples

			a(42) = A289815(42) * A289816(42) = 20 * 3 = 60.
		

Crossrefs

Programs

  • PARI
    a(n) = { my (v=1);
           for (o=2, oo,
               if (n==0, return (v));
               if (gcd(v, o)==1 && omega(o)==1,
                   if (n % 3, v *= o);
                   n \= 3;
               );
           );}
    
  • Python
    from sympy import gcd, primefactors
    def omega(n): return 0 if n==1 else len(primefactors(n))
    def a(n):
        v, o = 1, 2
        while True:
            if n==0: return v
            if gcd(v, o)==1 and omega(o)==1:
                if n%3: v*=o
                n //= 3
            o+=1
    print([a(n) for n in range(101)]) # Indranil Ghosh, Aug 02 2017

A325827 a(n) = A325825(2*n, sigma(n)).

Original entry on oeis.org

1, 1, 1, 1, 1, 12, 1, 1, 1, 1, 1, 4, 1, 4, 3, 1, 1, 3, 1, 1, 1, 4, 1, 3, 5, 1, 1, 28, 1, 3, 1, 1, 3, 1, 1, 4, 1, 1, 1, 10, 14, 12, 1, 4, 3, 1, 1, 4, 5, 1, 3, 5, 1, 12, 1, 4, 1, 1, 1, 12, 5, 4, 1, 1, 1, 48, 1, 1, 3, 16, 1, 3, 5, 1, 5, 4, 1, 12, 1, 1, 1, 14, 1, 28, 1, 1, 3, 1, 1, 9, 16, 1, 5, 1, 1, 12, 5, 11, 3, 1, 34, 12, 1, 5, 3
Offset: 1

Views

Author

Antti Karttunen, May 22 2019

Keywords

Comments

See also comment in A325808.

Crossrefs

Programs

  • PARI
    A004488(n) = subst(Pol(apply(x->(3-x)%3, digits(n, 3)), 'x), 'x, 3);
    A325825sq(a,b) = { my(a=fromdigits(Vec(lift(gcd(Pol(digits(a,3))*Mod(1, 3),Pol(digits(b,3))*Mod(1, 3)))),3), b=A004488(a)); min(a,b); };
    A325827(n) = A325825sq(n+n, sigma(n));

Formula

a(n) = A325825(2*n, A000203(n)).

Extensions

Terms corrected to agree with the new corrected definition of A325825. - Antti Karttunen, Jan 11 2020
Previous Showing 31-40 of 60 results. Next