login
A375036
Perimeter of n when it is considered as a "histonumber" (see Comments for definition).
1
2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 6, 6, 8, 10, 12, 14, 16, 18, 20, 22, 8, 8, 8, 10, 12, 14, 16, 18, 20, 22, 10, 10, 10, 10, 12, 14, 16, 18, 20, 22, 12, 12, 12, 12, 12, 14, 16, 18, 20, 22, 14, 14, 14, 14, 14, 14, 16, 18, 20, 22, 16, 16, 16, 16, 16, 16, 16, 18
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
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
Cf. A001477, A007953, A194025 (Histogram link in the Links section).
Sequence in context: A052008 A117463 A248609 * A055960 A351626 A007928
KEYWORD
nonn,look,base
AUTHOR
Eric Angelini, Jul 28 2024
STATUS
approved