1, 0, 1, 2, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 3, 0, 1, 0, 0, 0, 1, 2, 2, 0, 0, 0, 0, 0, 1, 2, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 2, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
Offset: 2
Rows start:
1;
0,1;
2,0,1;
1,0,0,1;
1,1,0,0,1;
0,0,0,0,0,1;
3,0,1,0,0,0,1;
2,2,0,0,0,0,0,1;
etc.
9 can be written in bases 2-9 as: 1001, 100, 21, 14, 13, 12, 11 and 10, in which case the numbers of zeros are 2,2,0,0,0,0,0,1.
A330166
Length of the longest run of 0's in the ternary expression of n.
Original entry on oeis.org
1, 0, 0, 1, 0, 0, 1, 0, 0, 2, 1, 1, 1, 0, 0, 1, 0, 0, 2, 1, 1, 1, 0, 0, 1, 0, 0, 3, 2, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 0, 0, 1, 0, 0, 2, 1, 1, 1, 0, 0, 1, 0, 0, 3, 2, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 0, 0, 1, 0, 0, 2, 1, 1, 1, 0, 0, 1, 0, 0, 4, 3, 3, 2, 2, 2, 2, 2, 2, 2
Offset: 0
For n = 87, the ternary expression of 87 is 10020. The length of the runs of 0's in the ternary expression of 87 are 2 and 1, respectively. The larger of these two values is 2, so a(87) = 2.
n [ternary n] a(n)
0 [ 0] 1
1 [ 1] 0
2 [ 2] 0
3 [ 1 0] 1
4 [ 1 1] 0
5 [ 1 2] 0
6 [ 2 0] 1
7 [ 2 1] 0
8 [ 2 2] 0
9 [ 1 0 0] 2
10 [ 1 0 1] 1
11 [ 1 0 2] 1
12 [ 1 1 0] 1
13 [ 1 1 1] 0
14 [ 1 1 2] 0
15 [ 1 2 0] 1
16 [ 1 2 1] 0
17 [ 1 2 2] 0
18 [ 2 0 0] 2
19 [ 2 0 1] 1
20 [ 2 0 2] 1
-
Table[Max@FoldList[If[#2==0,#1+1,0]&,0,IntegerDigits[n,3]],{n,0,90}]
A365278
In the binary expansion of n replace each run of k consecutive 1's by the decimal digits of A007931(k) to get the ternary expansion of a(n).
Original entry on oeis.org
0, 1, 3, 2, 9, 10, 6, 4, 27, 28, 30, 11, 18, 19, 12, 5, 81, 82, 84, 29, 90, 91, 33, 31, 54, 55, 57, 20, 36, 37, 15, 7, 243, 244, 246, 83, 252, 253, 87, 85, 270, 271, 273, 92, 99, 100, 93, 32, 162, 163, 165, 56, 171, 172, 60, 58, 108, 109, 111, 38, 45, 46, 21
Offset: 0
The binary expansion of 415 is "110011111", A007931(2) = 2 and A007931(5) = 21, so the ternary expansion of a(415) is "20021", and a(415) = 169.
-
A007931[n_]:=Rest[IntegerDigits[n+1,2]]+1;
A365278[n_]:=FromDigits[Flatten[Map[If[First[#]==1,A007931[Length[#]],#]&,Split[IntegerDigits[n,2]]]],3];
Array[A365278,100,0] (* Paolo Xausa, Oct 17 2023 *)
-
See Links section.
A370860
Numbers m such that c(0) <= c(1) > c(2), where c(k) = number of k's in the ternary representation of m.
Original entry on oeis.org
1, 3, 4, 10, 12, 13, 14, 16, 22, 28, 30, 31, 32, 34, 36, 37, 38, 39, 40, 41, 42, 43, 46, 48, 49, 58, 64, 66, 67, 85, 86, 88, 91, 92, 93, 94, 95, 96, 97, 100, 102, 103, 109, 110, 111, 112, 113, 114, 115, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127
Offset: 1
The ternary representation of 16 is 121, for which c(0)=0 <= c(1)=2 > c(2)=1.
-
Select[Range[1000], DigitCount[#, 3, 0] <= DigitCount[#, 3, 1] > DigitCount[#, 3, 2] &]
A370861
Numbers m such that c(0) < c(1) >= c(2), where c(k) = number of k's in the ternary representation of m.
Original entry on oeis.org
1, 4, 5, 7, 10, 12, 13, 14, 16, 22, 31, 32, 34, 37, 38, 39, 40, 41, 42, 43, 44, 46, 48, 49, 50, 52, 58, 64, 66, 67, 68, 70, 76, 85, 91, 93, 94, 95, 97, 98, 103, 104, 106, 109, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 127, 128
Offset: 1
The ternary representation of 16 is 121, for which c(0)=0 < c(1)=2 >= c(2)=1.
-
Select[Range[1000], DigitCount[#, 3, 0] < DigitCount[#, 3, 1] >= DigitCount[#, 3, 2] &]
A370862
Numbers m such that c(0) <= c(1) >= c(2), where c(k) = number of k's in the ternary representation of m.
Original entry on oeis.org
1, 3, 4, 5, 7, 10, 11, 12, 13, 14, 15, 16, 19, 21, 22, 28, 30, 31, 32, 34, 36, 37, 38, 39, 40, 41, 42, 43, 44, 46, 48, 49, 50, 52, 58, 64, 66, 67, 68, 70, 76, 85, 86, 88, 91, 92, 93, 94, 95, 96, 97, 98, 100, 102, 103, 104, 106, 109, 110, 111, 112, 113, 114
Offset: 1
The ternary representation of 15 is 120, for which c(0)=1 <= c(1)=1 >= c(2)=1.
-
Select[Range[1000], DigitCount[#, 3, 0] <= DigitCount[#, 3, 1] >= DigitCount[#, 3, 2] &]
A370866
Positive integers m such that c(0) >= c(1) <= c(2), where c(k) = number of k's in the ternary representation of m.
Original entry on oeis.org
2, 6, 8, 11, 15, 18, 19, 20, 21, 24, 26, 29, 33, 35, 45, 47, 51, 54, 55, 56, 57, 59, 60, 61, 62, 63, 65, 69, 72, 73, 74, 75, 78, 80, 83, 87, 89, 99, 101, 105, 107, 135, 137, 141, 143, 153, 155, 159, 162, 163, 164, 165, 167, 168, 169, 170, 171, 173, 177, 179
Offset: 1
The ternary representation of 20 is 202, for which c(0)=1 >= c(1)=0 <= c(2)=2.
-
Select[Range[1000], DigitCount[#, 3, 0] >= DigitCount[#, 3, 1] <= DigitCount[#, 3, 2] &]
A370871
Numbers m such that c(0) >= c(1) > c(2), where c(k) = number of k's in the ternary representation of m.
Original entry on oeis.org
3, 9, 27, 28, 30, 36, 81, 82, 84, 86, 88, 90, 92, 96, 100, 102, 108, 110, 114, 126, 136, 138, 144, 166, 172, 174, 190, 192, 198, 243, 244, 246, 247, 248, 250, 252, 253, 254, 255, 258, 262, 264, 270, 271, 272, 273, 276, 279, 288, 298, 300, 306, 324, 325, 326
Offset: 1
The ternary representation of 84 is 10010, for which c(0)=3 >= c(1)=2 > c(2)=0.
-
Select[Range[1000], DigitCount[#, 3, 0] >= DigitCount[#, 3, 1] > DigitCount[#, 3, 2] &]
Comments