A334765 Numbers m such that the numbers of 1's in the binary expansion of m equals the negative sum of balanced ternary trits of m.
0, 41, 68, 131, 132, 368, 384, 528, 1095, 1098, 1100, 1106, 1112, 1122, 1124, 1152, 1176, 1346, 1824, 2561, 3282, 3284, 3336, 3344, 3392, 3524, 4098, 4101, 4104, 4112, 4118, 4128, 4172, 4352, 4496, 4739, 4740, 5504, 6224, 9856, 9857, 9869, 9896, 9923, 9924
Offset: 1
Examples
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.
Links
- Thomas König, Table of n, a(n) for n = 1..30000
Crossrefs
Programs
-
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 *)
-
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
Comments