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.

A233580 In balanced ternary notation, zerofree non-repdigit numbers that are either palindromes or sign reversed palindromes.

This page as a plain text file.
%I A233580 #10 Mar 16 2019 19:11:45
%S A233580 2,7,16,20,32,43,61,103,124,146,182,196,292,302,338,367,421,547,601,
%T A233580 859,913,1039,1096,1172,1280,1312,1600,1640,1748,1816,2560,2624,2732,
%U A233580 2776,3064,3092,3200,3283,3445,3823,3985,4759,4921,5299,5461,7663,7825,8203
%N A233580 In balanced ternary notation, zerofree non-repdigit numbers that are either palindromes or sign reversed palindromes.
%C A233580 Zerofree numbers in balanced ternary notation can be used as reversible sign operators. This sequence collects such operators that are either in palindrome form or sign reversed palindrome form (which is defined as (n)_bt+Reverse((n)_bt)=0).
%H A233580 Lei Zhou, <a href="/A233580/b233580.txt">Table of n, a(n) for n = 1..10000</a>
%e A233580 2 = (1T)_bt in balanced ternary notation, where we use T to represent -1.
%e A233580 1T + T1 = 0, matches the definition of sign reversed palindrome form. So 2 is in the sequence.
%e A233580 Other examples:
%e A233580 7 = (1T1_bt) - palindrome; in the sequence.
%e A233580 13 = (111)_bt - palindrome but repdigit; not in the sequence.
%e A233580 16 = (1TT1)_bt - palindrome; in the sequence.
%e A233580 ...
%e A233580 52 = (1T0T1)_bt - palindrome but not zerofree; not in the sequence.
%t A233580 BTDigits[m_Integer, g_] :=
%t A233580 (* This is to determine digits of a number in balanced ternary notation. *)
%t A233580 Module[{n = m, d, sign, t = g},  If[n != 0, If[n > 0, sign = 1,
%t A233580   sign = -1; n = -n];   d = Ceiling[Log[3, n]]; If[3^d - n <= ((3^d - 1)/2), d++];   While[Length[t] < d, PrependTo[t, 0]]; t[[Length[t] + 1 - d]] = sign;   t = BTDigits[sign*(n - 3^(d - 1)), t]]; t];
%t A233580 BTnum[g_]:=Module[{bo=Reverse[g],data=0,i},Do[data=data+3^(i-1)*bo[[i]],{i,1,Length[bo]}];data];
%t A233580 ct=0;n=0;dg=0;spool={};res={};While[ct<50,n++; nbits = BTDigits[n, {0}];cdg=Length[nbits];If[cdg>dg,If[Length[spool]>0,Do[bits=spool[[j]];If[!MemberQ[bits,0],rb=Reverse[bits]; sign=rb[[1]];bo=Join[bits,-sign*rb];If[MemberQ[bo,-1],data=BTnum[bo];ct++;AppendTo[res,data]];bo=Join[bits,sign*rb];If[MemberQ[bo,-1],data=BTnum[bo];ct++;AppendTo[res,data]]],{j,1,Length[spool]}];Do[bits=spool[[j]];If[!MemberQ[bits,0],rb=Reverse[bits];bo=Join[bits,{-1},rb];If[MemberQ[bo,-1],data=BTnum[bo];ct++;AppendTo[res,data]];bo=Join[bits,{1},rb];If[MemberQ[bo,-1],data=BTnum[bo];ct++;AppendTo[res,data]]],{j,1,Length[spool]}];spool={};dg=cdg]];AppendTo[spool,nbits]];Print[res]
%Y A233580 Cf. A002113, A061917, A006995, A057890, A134027, A233010, A233571, A233572.
%K A233580 nonn,base,easy
%O A233580 1,1
%A A233580 _Lei Zhou_, Dec 14 2013