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.

A362090 a(n) = A328749(A362089(n)).

Original entry on oeis.org

0, -1, 1, -2, -5, -3, 2, 3, 5, -4, -9, -7, -10, -21, -19, -6, -13, -11, 4, 7, 9, 6, 11, 13, 10, 19, 21, -8, -17, -15, -18, -37, -35, -14, -29, -27, -20, -41, -39, -42, -85, -83, -38, -77, -75, -12, -25, -23, -26, -53, -51, -22, -45, -43, 8, 15, 17, 14, 27, 29
Offset: 0

Views

Author

Rémy Sigrist, Apr 08 2023

Keywords

Comments

Every integer appears once in the sequence.

Examples

			For n = 5, the base-3 expansion of 5 is "12", so the base-3 expansion of A362089(5) is "102", and a(5) = -2^2 + 2^0 = -3.
		

Crossrefs

Programs

  • PARI
    a(n) = { if (n==0, 0, n%3, 4*a(n\3) + (-1)^(n%3), 2*a(n/3)); }
    
  • Python
    from gmpy2 import digits
    def A362090(n): return sum((-(1<Chai Wah Wu, Apr 12 2023

A328728 a(n) = Sum_{k = 0..w and t_k > 0} (-1)^t_k * 2^k, where Sum_{k = 0..w} t_k * 3^k is the ternary representation of A328727(n).

Original entry on oeis.org

0, -1, 1, -2, 2, -4, -5, -3, 4, 3, 5, -8, -9, -7, -10, -6, 8, 7, 9, 6, 10, -16, -17, -15, -18, -14, -20, -21, -19, -12, -13, -11, 16, 15, 17, 14, 18, 12, 11, 13, 20, 19, 21, -32, -33, -31, -34, -30, -36, -37, -35, -28, -29, -27, -40, -41, -39, -42, -38, -24
Offset: 1

Views

Author

Rémy Sigrist, Oct 26 2019

Keywords

Comments

Every integer appears once in the sequence.

Crossrefs

Programs

  • PARI
    for (n=0, 297, t = Vecrev(digits(n,3)); if (sum(k=1, #t-1, t[k]*t[k+1])==0, print1 (sum(k=1, #t, if (t[k], 2^k*(-1)^t[k], 0)/2) ", ")))
    
  • Python
    from itertools import count, islice
    from gmpy2 import digits
    def A328728_gen(startvalue=0): # generator of terms >= startvalue
        for n in count(max(startvalue,0)):
            s = digits(n,3)
            for i in range(len(s)-1):
                if '0' not in s[i:i+2]:
                    break
            else:
                yield sum((-(1<A328728_list = list(islice(A328728_gen(),20)) # Chai Wah Wu, Apr 12 2023

Formula

a(n) = A328749(A328727(n)).
Sum_{k = 1..n} a(k) = 0 iff n belongs to A001045.
Showing 1-2 of 2 results.