login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Numbers with as many zeros as the sum of their digits.
1

%I #33 Jan 12 2023 18:31:55

%S 10,200,1001,1010,1100,3000,10002,10020,10200,12000,20001,20010,20100,

%T 21000,40000,100003,100011,100030,100101,100110,100300,101001,101010,

%U 101100,103000,110001,110010,110100,111000,130000,200002,200020,200200,202000,220000

%N Numbers with as many zeros as the sum of their digits.

%C As is normal, there are no leading zeros. The places of k zeros and the nonzero digits that are partitions of k are combinatorial.

%C Numbers k such that A007953(k) = A055641(k). - _Felix Fröhlich_, May 26 2022

%H Rémy Sigrist, <a href="/A354410/a354410.gp.txt">PARI program</a>

%t Select[Range[250000],DigitCount[#,10,0]==Total[IntegerDigits[#]]&] (* _Harvey P. Dale_, Jan 12 2023 *)

%o (PARI) isok(m) = my(d=digits(m)); vecsum(d) == #select(x->(x==0), d); \\ _Michel Marcus_, May 26 2022

%o (PARI) See Links section.

%o (Python) # after linked PARI by _Rémy Sigrist_

%o base, vv, nb = 10, [0], 0

%o def visit(v, s, z, r):

%o global base, vv, nb

%o if v and s==z:

%o nb += 1

%o if nb > len(vv): vv.append(len(vv))

%o vv[nb-1] = v

%o if s-z-r <= 0 and s-z+(base-1)*r >= 0:

%o if v: visit(base*v, s, z+1, r-1)

%o for d in range(1, base): visit(base*v+d, s+d, z, r-1)

%o def auptod(digits): visit(0, 0, 0, digits); return sorted(set(vv))

%o print(auptod(6)) # _Michael S. Branicky_, May 26 2022

%Y Subsequence of A011540.

%Y Cf. A007953 (sum of digits), A055641 (number of 0's).

%Y Cf. A031443, A061384.

%K nonn,base

%O 1,1

%A _Tamas Sandor Nagy_, May 25 2022