A055640 Number of nonzero digits in decimal expansion of n.
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2
Offset: 0
Examples
129 is written as rho kappa theta in the old Greek system.
References
- L. Threatte, The Greek Alphabet, in The World's Writing Systems, edited by Peter T. Daniels and William Bright, Oxford Univ. Press, 1996, p. 278.
Links
- Hieronymus Fischer, Table of n, a(n) for n = 0..10000
- Unicode Consortium, Unicode Home Page. (Follow the link "Display Problems?" to find an appropriate information/font file to show the Greek characters correctly. Or look at the HTML source to see their names.)
Crossrefs
Programs
-
Haskell
a055640 n = length $ filter (/= '0') $ show n -- Reinhard Zumkeller, May 02 2011
-
Mathematica
Table[Count[IntegerDigits[n],?(#>0&)],{n,0,120}] (* _Harvey P. Dale, Mar 11 2012 *) Total[Most[DigitCount[#]]]&/@Range[0,120] (* Harvey P. Dale, Mar 19 2021 *)
-
PARI
a(n)=my(v=digits(n));sum(i=1,#v,!!v[i]) \\ Charles R Greathouse IV, Aug 05 2012
Formula
From Hieronymus Fischer, Jun 06 2012: (Start)
a(n) = Sum_{j=1..m+1} (floor(n/10^j+0.9) - floor(n/10^j)), where m = floor(log_10(n)).
a(n) = m + 1 - A055641(n).
G.f.: (1/(1-x))*Sum_{j>=0} (x^10^j - x^(10*10^j))/(1-x^10^(j+1)). (End)
Comments