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.

A065364 Alternating sum of balanced ternary digits in n. Replace 3^k with (-1)^k in balanced ternary expansion of n.

This page as a plain text file.
%I A065364 #9 Jun 27 2020 19:49:45
%S A065364 1,-2,-1,0,1,2,3,0,1,2,-1,0,1,-2,-1,0,-3,-2,-1,-4,-3,-2,-1,0,1,-2,-1,
%T A065364 0,-3,-2,-1,0,1,2,-1,0,1,-2,-1,0,1,2,3,0,1,2,-1,0,1,2,3,4,1,2,3,0,1,2,
%U A065364 3,4,5,2,3,4,1,2,3,0,1,2,-1,0,1,-2,-1,0,1,2,3,0,1,2,-1,0,1,2,3,4,1,2,3,0,1,2,-1,0,1,-2,-1,0,-3,-2,-1,0
%N A065364 Alternating sum of balanced ternary digits in n. Replace 3^k with (-1)^k in balanced ternary expansion of n.
%C A065364 Notation: (3)<n>(-1).
%H A065364 Michael De Vlieger, <a href="/A065364/b065364.txt">Table of n, a(n) for n = 1..10000</a>
%e A065364 5 = +1(9)-1(3)-1(1) -> +1(+1)-1(-1)-1(+1) = +1 = a(5).
%t A065364 Array[Total@ MapIndexed[#1 (2 Mod[First[#2], 2] - 1) &, Reverse@ #] &[Prepend[IntegerDigits[#, 3], 0] //. {a___, b_, 2, c___} :> {a, b + 1, -1, c}] &, 104] (* _Michael De Vlieger_, Jun 27 2020 *)
%Y A065364 Cf. A059095, A065363, A065368.
%K A065364 base,easy,sign
%O A065364 1,2
%A A065364 _Marc LeBrun_, Oct 31 2001