A340544 Numbers from A340131 that are not multiples of 3.
5, 11, 29, 44, 50, 83, 98, 104, 116, 128, 140, 146, 245, 260, 266, 278, 290, 302, 308, 332, 344, 377, 380, 395, 401, 410, 416, 434, 449, 455, 731, 746, 752, 764, 776, 788, 794, 818, 830, 863, 866, 881, 887, 896, 902, 920, 935, 941, 980, 992, 1025, 1028, 1043
Offset: 1
Links
- Gennady Eremin, Table of n, a(n) for n = 1..1000
- Kurt Mahler, The representation of squares to the base 3, Acta Arith. Vol. 53, Issue 1 (1989), p. 105.
Programs
-
Python
def digits(n, b): out = [] while n >= b: out.append(n % b) n //= b return [n] + out[::-1] def ok(n): if n%3 == 0: return False t = digits(n, 3) if t.count(1) != t.count(2): return False return all(t[:i].count(1) >= t[:i].count(2) for i in range(1, len(t))) print([n for n in range(750) if ok(n)]) # after Michael S. Branicky (A340131)
Comments