login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A227062 Numbers whose base-5 sum of digits is 5. 10

%I #27 Jul 10 2022 13:23:58

%S 9,13,17,21,29,33,37,41,45,53,57,61,65,77,81,85,101,105,129,133,137,

%T 141,145,153,157,161,165,177,181,185,201,205,225,253,257,261,265,277,

%U 281,285,301,305,325,377,381,385,401,405,425,501,505,525,629,633,637

%N Numbers whose base-5 sum of digits is 5.

%C All of the entries are odd.

%C Subsequence of A016813. - _Michel Marcus_, Sep 03 2013

%C In general, the set of numbers with sum of base-b digits equal to b is a subset of { (b-1)*k + 1; k = 2, 3, 4, ... }. - _M. F. Hasler_, Dec 23 2016

%H Michael S. Branicky, <a href="/A227062/b227062.txt">Table of n, a(n) for n = 1..11613</a> (all terms with <= 15 base-5 digits)

%e The 5-ary expansion of 9 is (1,4), which has sum of digits 5.

%e The 5-ary expansion of 53 is (2,0,3), which has sum of digits 5.

%e 10 is not on the list since the 5-ary expansion of 10 is (2,0), which has sum of digits 2 not 5.

%t Select[Range@ 640, Total@ IntegerDigits[#, 5] == 5 &] (* _Michael De Vlieger_, Dec 23 2016 *)

%o (Sage) [i for i in [0..1000] if sum(Integer(i).digits(base=5))==5]

%o (PARI) select( is(n)=sumdigits(n,5)==5, [1..999]) \\ _M. F. Hasler_, Dec 23 2016

%o (Python)

%o from sympy.utilities.iterables import multiset_permutations

%o def auptodigs(maxdigits_base5):

%o alst = []

%o for d in range(2, maxdigits_base5 + 1):

%o fulldigset = list("0"*(d-2) + "111112234")

%o for firstdig in "1234":

%o target_sum, restdigset = 5 - int(firstdig), fulldigset[:]

%o restdigset.remove(firstdig)

%o for p in multiset_permutations(restdigset, d-1):

%o if sum(map(int, p)) == target_sum:

%o alst.append(int(firstdig+"".join(p), 5))

%o if int(p[0]) == target_sum:

%o break

%o return alst

%o print(auptodigs(5)) # _Michael S. Branicky_, Sep 13 2021

%o (Python)

%o agen = A226636gen(sod=5, base=5) # generator of terms using code in A226636

%o print([next(agen) for n in range(1, 56)]) # _Michael S. Branicky_, Jul 10 2022

%Y Cf. A018900, A187813.

%Y Cf. A226636 (b = 3), A226969 (b = 4), A227080 (b = 6), A227092 (b = 7), A227095 (b = 8), A227238 (b = 9), A052224 (b = 10).

%K nonn,base,easy

%O 1,1

%A _Tom Edgar_, Sep 01 2013

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 17:29 EDT 2024. Contains 371962 sequences. (Running on oeis4.)