cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-5 of 5 results.

A265413 Positions of records in A265410: a(0) = 1; for n >= 1, a(n) = 1 + A265412(n-1).

Original entry on oeis.org

1, 2, 9, 12, 15, 16, 19, 20, 23, 24, 25, 28, 29, 30, 33, 34, 35, 36, 39, 40, 41, 42, 45, 46, 47, 48, 49, 52, 53, 54, 55, 56, 59, 60, 61, 62, 63, 64, 67, 68, 69, 70, 71, 72, 75, 76, 77, 78, 79, 80, 81, 84, 85, 86, 87, 88, 89, 90, 93, 94, 95, 96, 97, 98, 99, 100, 103, 104, 105, 106, 107, 108, 109, 110, 113, 114, 115
Offset: 0

Views

Author

Antti Karttunen, Dec 09 2015

Keywords

Comments

Sequence gives the positions of records in A265410, equal to the points where its value increases by one.

Crossrefs

Programs

  • Scheme
    (define (A265413 n) (if (zero? n) 1 (+ 1 (A265412 (- n 1)))))

Formula

a(0) = 1; for n >= 1, a(n) = 1 + A265412(n-1).
Other identities. For all n >= 0:
A265410(a(n)) = n. [Particularly: a(n) gives the position where n occurs for the first time in A265410.]

A265409 a(n) = index to the nearest inner neighbor in Ulam-style square-spirals using zero-based indexing.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 4, 4, 4, 5, 6, 6, 6, 7, 8, 9, 9, 9, 10, 11, 12, 12, 12, 13, 14, 15, 16, 16, 16, 17, 18, 19, 20, 20, 20, 21, 22, 23, 24, 25, 25, 25, 26, 27, 28, 29, 30, 30, 30, 31, 32, 33, 34, 35, 36, 36, 36, 37, 38, 39, 40, 41, 42, 42, 42, 43, 44, 45, 46, 47, 48, 49, 49, 49, 50
Offset: 1

Views

Author

Antti Karttunen, Dec 13 2015

Keywords

Comments

Each n occurs A265411(n+1) times.
Useful when defining recurrences like A078510 and A265408.

Examples

			We arrange natural numbers as a counterclockwise spiral into the square grid in the following manner (here A stands for 10, B for 11). The first square corresponds with n (where the initial term 0 is at the center), and the second square with the value of a(n). This sequence doesn't specify a(0), thus it is shown as an asterisk (*):
                    44322
            432B    40002B
            501A    50*01A
            6789    600119
                    667899
-
For each n > 0, we look for the nearest horizontally or vertically adjacent neighbor of n towards the center that is not n-1, which will then be value of a(n) [e.g., it is 0 for 3, 5 and 7, while it is 1 for 8, 9 and A (10) and 2 for B (11)] unless n is in the corner (one of the terms of A002620), in which case the value is the nearest diagonally adjacent neighbor towards the center, e.g. 0 for 2, 4 and 6, while it is 1 for 9).
See also the illustration at A078510.
		

Crossrefs

One less than A265410(n+1).

Formula

If n <= 7, a(n) = 0 for n >= 8: if either A240025(n) or A240025(n-1) is not zero [when n or n-1 is in A002620], then a(n) = a(n-1), otherwise, a(n) = 1 + a(n-1).
If n <= 7, a(n) = 0, for n >= 8, a(n) = a(n-1) + (1-A240025(n))*(1-A240025(n-1)). [The same formula in a more compact form.]
a(n) = A265410(n+1) - 1.
Other identities. For all n >= 0:
a(n) = n - A265359(n).

A265411 a(0) = 1, a(1) = 7, otherwise, if A240025(n-1) = 1 [when n is in A033638] a(n) = 3, otherwise a(n) = 1.

Original entry on oeis.org

1, 7, 3, 3, 1, 3, 1, 3, 1, 1, 3, 1, 1, 3, 1, 1, 1, 3, 1, 1, 1, 3, 1, 1, 1, 1, 3, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3
Offset: 0

Views

Author

Antti Karttunen, Dec 09 2015

Keywords

Comments

Each n occurs a(n) times in A265410.

Crossrefs

Cf. A265410, A265412 (partial sums).

Programs

  • Scheme
    (define (A265411 n) (cond ((zero? n) 1) ((= 1 n) 7) ((= 1 (A240025 (- n 1))) 3) (else 1)))

Formula

a(0) = 1, a(1) = 7, otherwise, if A240025(n-1) = 1 [when n is in A033638] a(n) = 3, otherwise a(n) = 1.

A265412 Partial sums of A265411.

Original entry on oeis.org

1, 8, 11, 14, 15, 18, 19, 22, 23, 24, 27, 28, 29, 32, 33, 34, 35, 38, 39, 40, 41, 44, 45, 46, 47, 48, 51, 52, 53, 54, 55, 58, 59, 60, 61, 62, 63, 66, 67, 68, 69, 70, 71, 74, 75, 76, 77, 78, 79, 80, 83, 84, 85, 86, 87, 88, 89, 92, 93, 94, 95, 96, 97, 98, 99, 102, 103, 104, 105, 106, 107, 108, 109, 112, 113, 114, 115, 116, 117, 118, 119, 120, 123
Offset: 0

Views

Author

Antti Karttunen, Dec 09 2015

Keywords

Crossrefs

Cf. A265410, A265411 (first differences), A265413.

Programs

Formula

a(0) = 1; for n >= 1, a(n) = A265411(n) + a(n-1).
Other identities. For all n >= 0:
A265410(a(n)) = n. [Particularly: a(n) gives the position where n occurs for the last time in A265410.]

A265400 a(n) = one-based index to the nearest horizontally or vertically adjacent inner neighbor in square-grid spirals, or 0 if n is one of the corner cases A033638.

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 0, 1, 2, 0, 2, 3, 0, 3, 4, 5, 0, 5, 6, 7, 0, 7, 8, 9, 10, 0, 10, 11, 12, 13, 0, 13, 14, 15, 16, 17, 0, 17, 18, 19, 20, 21, 0, 21, 22, 23, 24, 25, 26, 0, 26, 27, 28, 29, 30, 31, 0, 31, 32, 33, 34, 35, 36, 37, 0, 37, 38, 39, 40, 41, 42, 43, 0, 43, 44, 45, 46, 47, 48, 49, 50, 0, 50, 51, 52, 53, 54, 55, 56, 57, 0, 57, 58, 59, 60, 61, 62, 63, 64, 65, 0
Offset: 1

Views

Author

Antti Karttunen, Dec 09 2015

Keywords

Comments

By convention we set a(1) = 0, because as 1 is a starting point of such spirals, it has no "inner neighbors" for itself.
This sequence is useful when constructing spiral-based sequences like A260643.

Examples

			We arrange natural numbers as a counterclockwise spiral into the square grid in the following manner (here A stands for 10, B for 11 and C for 12). The first square corresponds with n, and the second square with the value of a(n):
                    05430
            543C    50103
            612B    61002
            789A    70120
                    0789A0
-
For each n > 1, we look for the nearest horizontally or vertically adjacent neighbor of n towards the center that is not n-1, which will then be value of a(n) [e.g., it is 1 for 4, 6 and 8, while it is 2 for 9 and 11 and 3 for 12] unless no such additional neighbor exists, in which case a(n) = 0 (this occurs when n is one of the A033638, Quarter-squares plus 1).
		

Crossrefs

Cf. A000035, A000267, A033638 (positions of zeros), A240025, A260643.
Cf. A265410 (a variant).

Formula

If A240025(n-1) = 1 [when n is in A033638], then a(n) = 0, otherwise a(n) = A265410(n).
a(1) = a(2) = 0. If 3 <= n <= 8, then a(n) = 1 - (n mod 2), and for n >= 8, if A240025(n-1) is not zero [when n is in A033638], then a(n) = 0, otherwise, if A240025(n-2) is not zero [when n is one more than some term of A033638], then a(n) = A033638(A000267(n)-4), otherwise, a(n) = 1 + a(n-1).
Showing 1-5 of 5 results.