OFFSET
0,2
COMMENTS
Number of endpoints: 0,8 - zero, 6,9 - one, 1,2,3,5 - two, 4,7 - four. - Michael B. Porter, Oct 28 2017
LINKS
Harvey P. Dale, Table of n, a(n) for n = 0..1000
David A. Corneth, Image of digits with their endpoints.
FORMULA
a(10*n + d) = a(n) + e where e is the number of endpoints of single digit d. - David A. Corneth, Oct 28 2017
EXAMPLE
The digit 1 has two endpoints, and the digit 8 has no endpoints, so a(18) = 2. - Michael B. Porter, Oct 28 2017
MATHEMATICA
Table[Total[IntegerDigits[n]/.{1->2, 3->2, 5->2, 6->1, 7->4, 8->0, 9->1}], {n, 0, 100}] (* Harvey P. Dale, May 08 2022 *)
PROG
(PARI) a(n)=vecsum(apply(d->[0, 2, 2, 2, 4, 2, 1, 4, 0, 1][d+1], digits(n))); \\ based on program for A027386 by Andrew Howroyd, Michael B. Porter, Oct 28 2017
CROSSREFS
KEYWORD
nonn,base
AUTHOR
EXTENSIONS
a(6) corrected by Michael B. Porter, Oct 28 2017 (per Andrew Howroyd)
a(27) to a(80) by Michael B. Porter, Oct 28 2017
STATUS
approved