A350776 Nonnegative integers whose balanced ternary expansion has no two consecutive nonzero digits.
0, 1, 3, 8, 9, 10, 24, 26, 27, 28, 30, 71, 72, 73, 78, 80, 81, 82, 84, 89, 90, 91, 213, 215, 216, 217, 219, 233, 234, 235, 240, 242, 243, 244, 246, 251, 252, 253, 267, 269, 270, 271, 273, 638, 639, 640, 645, 647, 648, 649, 651, 656, 657, 658, 699, 701, 702
Offset: 1
Examples
The first terms, in decimal and in balanced ternary, are: n a(n) bter(n) -- ---- ------- 1 0 0 2 1 1 3 3 10 4 8 10T 5 9 100 6 10 101 7 24 10T0 8 26 100T 9 27 1000 10 28 1001 11 30 1010 12 71 10T0T
Programs
-
PARI
is(n) = { my (p=0, d); while (n, d=[0, 1, -1][1+n%3]; if (p && d, return (0), n=(n-d)/3; p=d)); 1 }
Formula
A350775(n) = 0 iff n belongs to the present sequence.
Comments