cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A309417 Number of steps needed to reduce 10^n to zero by subtracting its digital sum.

This page as a plain text file.
%I A309417 #34 Feb 12 2025 12:44:09
%S A309417 2,11,81,611,4798,39320,333583,2897573,25632474,230231687,2091437006,
%T A309417 19145032382,176258021378,1630867803755,15161044498785,
%U A309417 141573907590908,1327916557473475,12513166293358138,118472791400037286,1126683083504083356,10754171449735292485
%N A309417 Number of steps needed to reduce 10^n to zero by subtracting its digital sum.
%C A309417 Conjecture: lim_{n->infinity} a(n+1)/a(n) = 10.
%H A309417 Dominic McCarty, <a href="/A309417/b309417.txt">Table of n, a(n) for n = 1..500</a>
%H A309417 Dominic McCarty, <a href="/A309417/a309417.txt">Python program for A309417</a>
%e A309417 a(100)=11 since 100->99->81->72->63->54->45->36->27->18->9->0.
%t A309417 f[n_] := Length[NestWhileList[# - Total[IntegerDigits[#]]&, n, # > 0 &]]-1; f /@ (10^Range[8]) (* _Amiram Eldar_, Aug 08 2019 *)
%o A309417 (Python)
%o A309417 import math
%o A309417 def digitsum(n):
%o A309417    ds = 0
%o A309417    while n > 0:
%o A309417       ds += n % 10
%o A309417       n = n // 10
%o A309417    return ds
%o A309417 def steps(n):
%o A309417    count = 0
%o A309417    while n > 0:
%o A309417       n = n - digitsum(n)
%o A309417       count += 1
%o A309417    return count
%o A309417 n = 1
%o A309417 for i in range(1,10):
%o A309417    n = 10 * n
%o A309417    print(steps(n))
%o A309417 (PARI) a(n)={my(s=10^n, k=0); while(s, k++; s-=sumdigits(s)); k} \\ _Andrew Howroyd_, Sep 09 2019
%Y A309417 Cf. A066568 (n - sum of digits of n).
%K A309417 nonn,base
%O A309417 1,1
%A A309417 _Reiner Moewald_, Jul 30 2019
%E A309417 a(13)-a(15) from _Giovanni Resta_, Sep 10 2019
%E A309417 a(16) and on from _Dominic McCarty_, Feb 12 2025