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”).

A260348
Numbers n such that n is divisible by (10^k - digitsum(n)), where k equals the number of digits of digitsum(n).
1
5, 8, 9, 18, 21, 24, 26, 27, 36, 44, 45, 50, 54, 60, 62, 63, 72, 80, 81, 86, 90, 108, 116, 117, 126, 132, 134, 135, 140, 144, 152, 153, 162, 170, 171, 180, 200, 204, 206, 207, 210, 216, 224, 225, 230, 234, 240, 242, 243, 252, 260, 261, 264, 270, 306, 312, 314
OFFSET
1,1
COMMENTS
This sequence is infinite because all numbers with a digitsum equal to 9 are part of this sequence.
EXAMPLE
a(1) = 5, because 5 divided by (10 - 5) equals 1.
a(7) = 26, because digitsum(26) = 8 and 26 divided by (10 - 8) equals 13.
a(20) = 86, the first member of this sequence where digitsum(n) >= 10. Digitsum(86) = 14, so k = 10^2 - 14 = 86, so 86 is a member of this sequence.
MATHEMATICA
fQ[n_] := Block[{d = Total@ IntegerDigits@ n, k}, k = IntegerLength@ d;
Divisible[n, 10^k - d]]; Select[Range@ 314, fQ] (* or *)
Select[Range@ 314, Divisible[#, (10^(Floor[Log[10, Total@ IntegerDigits@ #]] + 1) - Total@ IntegerDigits@ #)] &] (* Michael De Vlieger, Aug 05 2015 *)
PROG
(Python)
def sod(n, m):
....kk = 0
....while n > 0:
........kk= kk+(n%m)
........n =int(n//m)
....return kk
for c in range (1, 10**6):
....k=len(str(sod(c, 10)))
....kl=10**k-sod(c, 10)
....if c%kl==0:
........print (c)
(PARI) isok(n)=my(sd = sumdigits(n), nsd = #digits(sd)); n % (10^nsd - sd) == 0; \\ Michel Marcus, Aug 05 2015
CROSSREFS
KEYWORD
nonn,base,less
AUTHOR
Pieter Post, Jul 23 2015
STATUS
approved