A039337 Numbers whose base-8 representation has the same nonzero number of 1's and 3's.
11, 25, 67, 83, 88, 90, 92, 93, 94, 95, 99, 107, 115, 123, 139, 153, 193, 200, 202, 204, 205, 206, 207, 209, 225, 233, 241, 249, 267, 281, 331, 345, 395, 409, 459, 473, 515, 531, 536, 538, 540, 541, 542, 543, 547, 555, 563, 571, 603, 643, 659, 664, 666, 668
Offset: 1
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..10000
Crossrefs
Cf. A007094.
Programs
-
Mathematica
Select[Range[700],DigitCount[#,8,1]==DigitCount[#,8,3]>0&] (* Harvey P. Dale, Oct 24 2015 *)
-
Python
def ok(n): o = oct(n); return o.count('1') == o.count('3') > 0 print([k for k in range(669) if ok(k)]) # Michael S. Branicky, Nov 25 2021