A357745 Numbers on the 8 main spokes of a square spiral with 1 in the center.
1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13, 15, 17, 19, 21, 23, 25, 28, 31, 34, 37, 40, 43, 46, 49, 53, 57, 61, 65, 69, 73, 77, 81, 86, 91, 96, 101, 106, 111, 116, 121, 127, 133, 139, 145, 151, 157, 163, 169, 176, 183, 190, 197, 204, 211, 218, 225, 233, 241, 249, 257, 265, 273
Offset: 1
Examples
See visualization in links.
Links
- Karl-Heinz Hofmann, Table of n, a(n) for n = 1..10000
- Karl-Heinz Hofmann, Visualization of the first few terms
- Index entries for linear recurrences with constant coefficients, signature (2,-1,0,0,0,0,0,1,-2,1).
Crossrefs
Programs
-
Mathematica
Rest@ CoefficientList[Series[x (1 - x^8 + x^9)/((1 - x)^3*(1 + x) (1 + x^2) (1 + x^4)), {x, 0, 63}], x] (* Michael De Vlieger, Dec 29 2022 *) a[n_] := BitShiftRight[(n + 3)^2, 4] + Boole[BitAnd[n, 7] != 1]; Array[a, 65] (* Amiram Eldar, Dec 30 2022, after the PARI code *) LinearRecurrence[{2,-1,0,0,0,0,0,1,-2,1},{1,2,3,4,5,6,7,8,9,11},70] (* Harvey P. Dale, Jul 13 2025 *)
-
PARI
a(n) = sqr(n+3)>>4 + (bitand(n,7)!=1); \\ Kevin Ryde, Dec 30 2022
-
Python
def A357745(n): return ((n+3)**2 >> 4) + 1 if n % 8 != 1 else (n+3)**2 >> 4
Formula
G.f.: x*(1-x^8+x^9)/((1-x)^3*(1+x)*(1+x^2)*(1+x^4)). - Joerg Arndt, Dec 29 2022
a(n) = floor((n+3)^2 / 16) + (1 if n != 1 mod 8). - Kevin Ryde, Dec 30 2022
Comments