A226969 Numbers whose base-4 sum of digits is 4.
7, 10, 13, 19, 22, 25, 28, 34, 37, 40, 49, 52, 67, 70, 73, 76, 82, 85, 88, 97, 100, 112, 130, 133, 136, 145, 148, 160, 193, 196, 208, 259, 262, 265, 268, 274, 277, 280, 289, 292, 304, 322, 325, 328, 337, 340, 352, 385, 388, 400, 448, 514, 517, 520, 529, 532
Offset: 1
Examples
The quaternary expansion of 13 is (3,1), which has sum of digits 4. The quaternary expansion of 40 is (2,2,0), which has sum of digits 4. 17 is not on the list since the quaternary expansion of 17 is (1,0,1), which has sum of digits 2 not 4.
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..10000
Crossrefs
Programs
-
Mathematica
Select[Range@ 540, Total@ IntegerDigits[#, 4] == 4 &] (* Michael De Vlieger, Dec 23 2016 *)
-
PARI
select( is(n)=sumdigits(n,4)==4, [1..999]) \\ M. F. Hasler, Dec 23 2016
-
Python
agen = A226636gen(sod=4, base=4) # generator of terms using code in A226636 print([next(agen) for n in range(1, 57)]) # Michael S. Branicky, Jul 10 2022
-
Sage
[i for i in [0..1000] if sum(Integer(i).digits(base=4))==4]
Comments