A277837 Number of '7' digits in the set of all numbers from 0 to A014824(n) = Sum_{i=1..n} i*10^(n-i) = (0, 1, 12, 123, 1234, 12345, ...).
0, 0, 1, 22, 343, 4664, 58985, 713307, 8367637, 96022049, 1083677281, 12071340713, 133059086145, 1454047651577, 15775044417009, 170096123182441, 1824418021947873, 19478748120713314, 207133160219478837, 2194788392318245180, 23182451824417019723
Offset: 0
Examples
For n=2 there is only one digit '7' in the sequence 0, 1, 2, ..., 12. For n=3 there are 11 + 10 = 21 more digits '7' in { 17, 27, ..., 67, 70, ..., 79, 87, 97, 107, 117 }, where 77 accounts for two '7's.
Links
- David A. Corneth, Table of n, a(n) for n = 0..998
Programs
-
PARI
print1(c=N=0);for(n=1,8,print1(","c+=sum(k=N+1,N=N*10+n,#select(d->d==7,digits(k)))))
-
PARI
A277837(n,m=7)=if(n>16,error("n>16 not yet implemented"), n>m,A277837(n,m+1)+(m+2)*10^(n-m-1),(9*n-11)*(10^n+1)\729+2-(m>n)) \\ Edited by M. F. Hasler, Dec 29 2020
Formula
Extensions
More terms from Lars Blomberg, Nov 05 2016
Removed incorrect b-file. - David A. Corneth, Dec 31 2020
Comments