A260348 Numbers n such that n is divisible by (10^k - digitsum(n)), where k equals the number of digits of digitsum(n).
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
Examples
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.
Links
- Pieter Post, Table of n, a(n) for n = 1..12089
Programs
-
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 *)
-
PARI
isok(n)=my(sd = sumdigits(n), nsd = #digits(sd)); n % (10^nsd - sd) == 0; \\ Michel Marcus, Aug 05 2015
-
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)
Comments