The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A362869 a(n) is equal to the number of cells in one octant of the octagon of unit squares with side equal n. 1
1, 2, 8, 11, 22, 27, 43, 50, 71, 80, 106, 117, 148, 161, 197, 212, 253, 270, 316, 335, 386, 407, 463, 486, 547, 572, 638, 665, 736, 765, 841, 872, 953, 986, 1072, 1107, 1198, 1235, 1331, 1370, 1471, 1512, 1618, 1661, 1772, 1817, 1933, 1980, 2101, 2150, 2276 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
The octagon is obtained from a square of side 3n-2 cells by removing a triangle of cells from each of the four corners.
LINKS
Anatoliy A. Abramov, Illustration of initial terms
FORMULA
a(n) = k*(k + 1)/2 - floor(n^2/4), where k = ceiling((n + 2*(n - 1))/2).
G.f.: x*(1 + x + 4*x^2 + x^3)/((1 - x)^3*(1 + x)^2). - Stefano Spezia, May 07 2023
EXAMPLE
For n=3, the octagon is a square of side 3n-2 = 7 with corners chopped to leave each side with 3 "*",
* * *
* * * * *
* * * * * * *
@ @ @ @ * * *
@ @ @ * * * *
@ * * * *
* * *
The a(3) = 8 cells marked "@" are an eighth of the figure and are the primitive cells in the sense that other cells map to them by rotations or reflections.
MATHEMATICA
LinearRecurrence[{1, 2, -2, -1, 1}, {1, 2, 8, 11, 22}, 100] (* Paolo Xausa, Oct 16 2023 *)
PROG
(Java)
import java.util.function.Function;
import java.util.stream.IntStream;
public class Main {
private static int A362869(int n) {
Function<Integer, Integer> trianglarNumber = p -> p * (p + 1) / 2;
Function<Integer, Integer> quarterOfSquareNumber = p -> p * p / 4;
int k = (n + 2 * (n - 1) + 1) / 2;
return trianglarNumber.apply(k) - quarterOfSquareNumber.apply(n);
}
public static void main(String[] args) {
IntStream.range(1, 100).forEach(n -> System.out.print(A362869(n) + ", "));
}
}
CROSSREFS
Sequence in context: A009420 A189328 A090746 * A234924 A336771 A174114
KEYWORD
nonn,easy
AUTHOR
Anatoliy A. Abramov, May 07 2023
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 18 19:23 EDT 2024. Contains 372665 sequences. (Running on oeis4.)