OFFSET
0,1
COMMENTS
A histonumber is a geometric figure that appears when we transform each digit "d" of n into a column of unit squares of height "d". The number zero becomes a horizontal segment of unit length.
All histonumbers are even.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..23000
Eric Angelini, Histonumbers
EXAMPLE
Histonumbers "1234", "2024" and "1000"
.
+---+ +---+
| | | |
+---+ + + +
| | | | |
+---+ + + +---+ +---+ +
| | | | | | | | |
+---+ + + + + + + + + +---+
| 1 2 | 3 | 4 | | 2 | 0 | 2 | 4 | | 1 | 0 0 0
+---+---+---+---+ +---+---+---+---+ +---+---+---+---+
.
The “1234” histonumber is a figure with a perimeter P of 16 units and a surface S of 10 square units (the surface of a histonumber is always the sum of its digits).
The “2024” histonumber is a figure with a perimeter P of 20 units and a surface S of 8 square units.
The “1000” histonumber is a figure with a perimeter P of 10 units and a surface S of 1 square unit.
By definition, a histonumber can always be drawn in one go on a sheet of paper, without ever lifting the pencil. This seems obvious for the 1234 histonumber above but is less so for 2024 and 1000. However, this is also the case here because the pencil will pass twice below the zeros. This justifies the value P = 20 of the perimeter of 2024 and the value P = 10 of the perimeter of 1000.
MAPLE
a:= n-> (l-> (h-> 2*h+l[1]+l[-1]+add(abs(l[i]-l[i-1])
, i=2..h))(nops(l)))(convert(n, base, 10)):
seq(a(n), n=0..67); # Alois P. Heinz, Jul 29 2024
PROG
(Python)
def a(n):
d = [0] + list(map(int, str(n))) + [0]
return 2*(len(d)-2) + sum(abs(d[i+1]-d[i]) for i in range(len(d)-1))
print([a(n) for n in range(68)]) # Michael S. Branicky, Jul 28 2024
CROSSREFS
KEYWORD
AUTHOR
Eric Angelini, Jul 28 2024
STATUS
approved