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.

A358620 Number of nonzero digits needed to write all nonnegative n-digit integers.

This page as a plain text file.
%I A358620 #20 Nov 30 2022 07:21:46
%S A358620 9,171,2520,33300,414000,4950000,57600000,657000000,7380000000,
%T A358620 81900000000,900000000000,9810000000000,106200000000000,
%U A358620 1143000000000000,12240000000000000,130500000000000000,1386000000000000000,14670000000000000000,154800000000000000000
%N A358620 Number of nonzero digits needed to write all nonnegative n-digit integers.
%H A358620 <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (20,-100).
%F A358620 a(n) = 9 * (9*n+1) * 10^(n-2).
%F A358620 a(n) = 20*a(n-1) - 100*a(n-2); a(1)=9, a(2)=171.
%F A358620 a(n) = 9 * A081045(n-1).
%F A358620 a(n) = A113119(n) - A212704(n-1), for n >= 2.
%e A358620 a(1) = 9 because there are 9 one-digit numbers that are > 0.
%e A358620 a(2) = 171 because there are 90 two-digit numbers, so 90*2 = 180 digits are needed to write these integers, nine of these integers end with 0, and 180-9 = 171.
%p A358620 seq((9*(9*n+1))*10^(n-2), n = 1 .. 20);
%t A358620 a[n_] := 9*(9*n + 1)*10^(n - 2); Array[a, 20] (* _Amiram Eldar_, Nov 23 2022 *)
%o A358620 (PARI) a(n)=(81*n+9)*10^(n-2) \\ _Charles R Greathouse IV_, Nov 29 2022
%o A358620 (Python)
%o A358620 def A358620(n): return 9 if n == 1 else 9*(9*n+1)*10**(n-2) # _Chai Wah Wu_, Nov 29 2022
%Y A358620 Cf. A081045, A113119, A212704.
%K A358620 nonn,base,easy
%O A358620 1,1
%A A358620 _Bernard Schott_, Nov 23 2022