A227062 Numbers whose base-5 sum of digits is 5.
9, 13, 17, 21, 29, 33, 37, 41, 45, 53, 57, 61, 65, 77, 81, 85, 101, 105, 129, 133, 137, 141, 145, 153, 157, 161, 165, 177, 181, 185, 201, 205, 225, 253, 257, 261, 265, 277, 281, 285, 301, 305, 325, 377, 381, 385, 401, 405, 425, 501, 505, 525, 629, 633, 637
Offset: 1
Examples
The 5-ary expansion of 9 is (1,4), which has sum of digits 5. The 5-ary expansion of 53 is (2,0,3), which has sum of digits 5. 10 is not on the list since the 5-ary expansion of 10 is (2,0), which has sum of digits 2 not 5.
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..11613 (all terms with <= 15 base-5 digits)
Crossrefs
Programs
-
Mathematica
Select[Range@ 640, Total@ IntegerDigits[#, 5] == 5 &] (* Michael De Vlieger, Dec 23 2016 *)
-
PARI
select( is(n)=sumdigits(n,5)==5, [1..999]) \\ M. F. Hasler, Dec 23 2016
-
Python
from sympy.utilities.iterables import multiset_permutations def auptodigs(maxdigits_base5): alst = [] for d in range(2, maxdigits_base5 + 1): fulldigset = list("0"*(d-2) + "111112234") for firstdig in "1234": target_sum, restdigset = 5 - int(firstdig), fulldigset[:] restdigset.remove(firstdig) for p in multiset_permutations(restdigset, d-1): if sum(map(int, p)) == target_sum: alst.append(int(firstdig+"".join(p), 5)) if int(p[0]) == target_sum: break return alst print(auptodigs(5)) # Michael S. Branicky, Sep 13 2021
-
Python
agen = A226636gen(sod=5, base=5) # generator of terms using code in A226636 print([next(agen) for n in range(1, 56)]) # Michael S. Branicky, Jul 10 2022
-
Sage
[i for i in [0..1000] if sum(Integer(i).digits(base=5))==5]
Comments