OFFSET
1,2
COMMENTS
a(116) = 32770, a(117) = 32771 and a(118) = 32772 is the first time that three consecutive numbers appear in this sequence. Conjecture: There is no occurrence of four or more consecutive numbers. Tested by exhaustive search up to a(n) = 3^26. - Thomas König, Jul 19 2020
LINKS
Thomas König, Table of n, a(n) for n = 1..30000
EXAMPLE
41_10 = 1TTTT_bt = 101001_2, the sum of the digits is 1-1-1-1-1 = -3 for balanced ternary and 1+1+1 = 3 for base 2, so 41 is a term.
MATHEMATICA
Select[Range[0, 10^4], -Total@ If[First@ # == 0, Rest@ #, #] &[Prepend[IntegerDigits[#, 3], 0] //. {x___, y_, k_ /; k > 1, z___} :> {x, y + 1, -1, z}] == DigitCount[#, 2, 1] &] (* Michael De Vlieger, Jul 08 2020 *)
PROG
(PARI) bt(n)= if (n==0, return (0)); my(d=digits(n, 3), c=1); while(c, if(d[1]==2, d=concat(0, d)); c=0; for(i=2, #d, if(d[i]==2, d[i]=-1; d[i-1]+=1; c=1))); vecsum(d); \\ A065363
isok(m) = bt(m) + hammingweight(m) == 0; \\ Michel Marcus, Jun 07 2020
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Thomas König, May 10 2020
STATUS
approved