login
A039283
Numbers whose base-5 representation has the same nonzero number of 0's and 1's.
0
5, 27, 28, 29, 35, 40, 45, 51, 55, 76, 80, 101, 105, 126, 130, 137, 138, 139, 142, 143, 144, 147, 148, 149, 150, 177, 178, 179, 185, 190, 195, 202, 203, 204, 210, 215, 220, 227, 228, 229, 235, 240, 245, 257, 258, 259, 261, 266, 271, 277, 278, 279, 285, 290
OFFSET
1,1
MATHEMATICA
Select[Range[300], DigitCount[#, 5, 0]==DigitCount[#, 5, 1]>0&] (* Harvey P. Dale, Oct 16 2019 *)
PROG
(Python)
from sympy.ntheory import count_digits
def ok(n): c = count_digits(n, 5); return 0 in c and 1 in c and c[0] == c[1]
print(list(filter(ok, range(291)))) # Michael S. Branicky, May 27 2021
(PARI) is(n) = my(d=vecsort(digits(n, 5)), e=vector(#d), f=vector(#d, t, 1), side=#setintersect(d, e), sidf=#setintersect(d, f)); side==sidf && side > 0 \\ Felix Fröhlich, May 27 2021
KEYWORD
nonn,base,easy
STATUS
approved