login
Number of positive integers < 10^n divisible by their first digit.
1

%I #16 Oct 05 2017 03:39:00

%S 9,41,327,3158,31450,314349,3143320,31433005,314329833,3143298089,

%T 31432980631,314329806030,3143298060001,31432980599686,

%U 314329805996514,3143298059964770,31432980599647312,314329805996472711,3143298059964726682,31432980599647266367

%N Number of positive integers < 10^n divisible by their first digit.

%C a(n)/10^n seems to converge to a number around .3143...

%C a(n)/10^n converges to 7129/22680. - _Hiroaki Yamanouchi_, Sep 26 2014

%H Hiroaki Yamanouchi, <a href="/A247884/b247884.txt">Table of n, a(n) for n = 1..100</a>

%H Beyond Solutions Blog, <a href="https://beyondmathsolutions.wordpress.com/2014/09/23/soln-multiple-of-the-first-digit">Multiple of the first digit</a>

%H J. J. O'Connor and E. F. Robertson, <a href="http://www-history.mcs.st-and.ac.uk/Printonly/Mengoli.html">Pietro Mengoli</a>

%o (PARI)

%o a(n)=c=0;for(k=1,10^n-1,d=digits(k);if(k%d[1]==0,c++));c

%o n=1;while(n<10,print1(a(n),", ");n++)

%o (Python)

%o count = 9#Start with the first 9 digits

%o print(1,9)

%o n = 2

%o while n < 101:

%o ....for a in range(1,10):

%o ........count += 10**(n-1)/a

%o ........if 10**(n-1) % a != 0:

%o ............count += 1

%o ....print(n,count)

%o ....n += 1

%o # _David Consiglio, Jr._, Sep 26 2014

%Y Cf. A034837, A028569, A119947, A119948.

%K nonn,easy,base

%O 1,1

%A _Derek Orr_, Sep 25 2014

%E a(9)-a(20) from _Hiroaki Yamanouchi_, Sep 26 2014