OFFSET
0,1
COMMENTS
The display is the one described in A006942 (see also the example section below).
FORMULA
a(n) = a(floor(n/10)) + a(n mod 10), for n > 9 (a formula by Reinhard Zumkeller, same for A006942 and A010371).
EXAMPLE
To illustrate a(0),...,a(9):
_ _ _ _ _ _ _ _
| | | _| _| |_| |_ |_ | |_| |_|
|_| | |_ _| | _| |_| | |_| _|
.
MATHEMATICA
Evaluate[Table[a[n], {n, 0, 9}]]={4, 0, 4, 4, 3, 4, 6, 1, 8, 6};
a[n_/; n>9]:=a[Floor[n/10]]+a[Mod[n, 10]]; a/@Range[0, 100] (* or *)
Table[Total[IntegerDigits[n]/.{0->4, 1->0, 2->4, 3->4, 4-> 3, 5->4, 7->1, 9->6}], {n, 0, 100}]
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Ivan N. Ianakiev, Aug 14 2019
STATUS
approved