OFFSET
1,2
COMMENTS
In a hexagonal grid, begin with a single central hexagon. Wrap strips of incrementally more hexagons (strip of 2, then 3, etc.) around the center such that they are connected at their start and endpoints to the previous and subsequent strips. If a strip's endpoint completes a convex set of hexagons with all of those before it (i.e., the boundary hexagons' centers represent the convex hull of all hexagons' centers), the number of hexagons in the construction is a term of this sequence.
EXAMPLE
The first term is trivial, as it represents a single hexagon. So a(1) = 1.
Adding a strip of two hexagons forms a triple of hexagons whose set is also convex, with 3 total hexagons included. a(2) = 3.
The three-hexagon strip forms the first concave honeycomb, missing a single hexagon in what would otherwise be a 7-hex flower.
The four-hexagon strip completes a convex honeycomb that consists of three layers -- 3|4|3 hexagons in each. a(3) = 10.
PROG
(R)
# This generates and displays the first 20 examples
generate_triangular_number <- function(n){
return(sum(1:n))
}
generate_hexangular_number <- function(n){
return(round((n + 3)^2/12))
}
tri_i <- 1
hex_i <- 1
n_matches <- 0
while(n_matches < 20){
if(generate_triangular_number(tri_i) == generate_hexangular_number(hex_i)){
n_matches <- n_matches + 1
print(c(n_matches, tri_i, hex_i, generate_triangular_number(tri_i)))
tri_i <- tri_i + 1
hex_i <- hex_i + 1
} else{
if(generate_triangular_number(tri_i) > generate_hexangular_number(hex_i)){
hex_i <- hex_i + 1
} else{
tri_i <- tri_i + 1
}
}
}
(PARI) lista(nn) = select(x->ispolygonal(x, 3), vector(nn, k, round((k + 3)^2/12))); \\ Michel Marcus, Jun 12 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Brandan Williams, May 22 2024
STATUS
approved