login
A037335
Numbers whose base-8 and base-10 expansions have the same digit sum.
0
1, 2, 3, 4, 5, 6, 7, 70, 71, 130, 131, 132, 133, 134, 135, 260, 261, 262, 263, 320, 321, 322, 323, 324, 325, 326, 327, 390, 391, 450, 451, 452, 453, 454, 455, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1144, 1145, 1146, 1147, 1148, 1149, 1208, 1209, 1272
OFFSET
1,2
MATHEMATICA
Select[Range[1200], Total[IntegerDigits[#]]==Total[IntegerDigits[#, 8]]&] (* Harvey P. Dale, May 21 2018 *)
PROG
(Python)
def ok(n): return sum(map(int, str(n))) == sum(map(int, oct(n)[2:]))
print(list(filter(ok, range(1, 1273)))) # Michael S. Branicky, Jun 20 2021
CROSSREFS
Sequence in context: A278942 A303166 A024649 * A028429 A331565 A171644
KEYWORD
nonn,base
STATUS
approved