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.
%I A277635 #46 Jan 01 2021 12:04:41 %S A277635 0,1,22,343,4664,58985,713307,8367637,96022049 %N A277635 Number of 7's appearing in the sequence of consecutive natural numbers from 1 to A007908(n), where A007908 = (1, 12, 123, 1234, ...). %C A277635 First 6 terms are the same as in A083449, also see A272525. [See the OEIS wiki page for more details. - _M. F. Hasler_, Dec 29 2020] %C A277635 a(n) gives the number of times the digit 7 occurs in all terms of A000027 in the interval [A000027(1), A007908(n)]. - _Felix Fröhlich_, Oct 28 2016 %C A277635 The sequence was initially defined only up to n = 9 and then extended using A007908 = concat(1..n); see A277837 for the extension using A014824 (a(n) = 10 a(n-1) + n) leading to a smoother growth, in particular at powers of 10. - _M. F. Hasler_, Nov 01 2016, edited Dec 29 2020 %H A277635 Puzzling Stack Exchange, <a href="http://puzzling.stackexchange.com/questions/42029/how-manysevens">How many sevens?</a> %H A277635 M. F. Hasler, <a href="https://oeis.org/wiki/User_talk:M._F._Hasler/Digits_d_in_0_through_123...n">Digits d in 0 through 123...n</a>, OEIS Wiki, Nov. 2016. %e A277635 22 is the third term of the sequence because there are 22 occurrences of the digit '7' contained in numbers within the range of 1 to 123. %e A277635 96022049 is the 9th term of the sequence because there are 96022049 occurrences of the digit '7' contained in numbers within the range of 1 to 123456789. %t A277635 Table[a[n] = Count[Flatten@ Map[IntegerDigits, Range@ FromDigits@ Range@ n], k_ /; k == 8]; Print@ a@ n; an = a[n]; an, {n, 0, 9}] (* _Michael De Vlieger_, Oct 30 2016 *) %o A277635 (PARI) print1(c=0);N=1;for(n=2,8,print1(","c+=sum(k=N+1,N=eval(Str(N,n)),#select(d->d==7,digits(k))))) \\ For illustration; more efficient code below. - _M. F. Hasler_, Oct 31 2016 %o A277635 (PARI) A277635(n, m=7)=if(n>m,A277635(n, m+1)+(m+2)*10^(n-m-1),A277830(n)-(m>n)) \\ Valid only for n <= 9. - _M. F. Hasler_, Nov 02 2016 %Y A277635 Cf. A083449, A272525, A014824. %Y A277635 Cf. A277830 - A277838 and A277849: analog for digits 0 .. 9, but based on A014824 instead of A083449. %K A277635 nonn,base %O A277635 1,3 %A A277635 _Alexander R. Povolotsky_, Oct 24 2016