A375257 Numbers whose sum of base-2 digits is 1 more than their sum of base-3 digits.
3, 9, 15, 28, 29, 39, 45, 57, 82, 83, 84, 85, 94, 95, 99, 110, 118, 119, 123, 135, 162, 163, 165, 174, 175, 183, 207, 219, 248, 297, 303, 315, 324, 325, 334, 335, 342, 343, 363, 382, 383, 406, 407, 411, 423, 435, 441, 447, 459, 488, 494, 496, 497, 502, 503, 506, 508, 509, 543, 570, 571, 573, 603
Offset: 1
Examples
a(3) = 15 is a term because 15 = 1111_2 = 120_3 so A000120(15) = 1+1+1+1 = 4 and A053735(15) = 1+2+0 = 3.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Maple
filter:= proc(n) convert(convert(n,base,2),`+`) = convert(convert(n,base,3),`+`)+1 end proc: select(filter, [$1..1000]);
-
Mathematica
Select[Range[600], Subtract @@ DigitSum[#, {2, 3}] == 1 &] (* Amiram Eldar, Aug 08 2024 *)
-
PARI
isok(k) = sumdigits(k,2) == 1 + sumdigits(k, 3); \\ Michel Marcus, Aug 08 2024
-
Python
from sympy.ntheory import digits def ok(n): return sum(digits(n, 2)[1:]) == sum(digits(n, 3)[1:]) + 1 print([k for k in range(604) if ok(k)]) # Michael S. Branicky, Aug 08 2024
Comments