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.

Previous Showing 51-56 of 56 results.

A257171 Sum of numbers on n-th segment of Ulam's spiral.

Original entry on oeis.org

1, 5, 9, 13, 27, 36, 62, 78, 120, 145, 207, 243, 329, 378, 492, 556, 702, 783, 965, 1065, 1287, 1408, 1674, 1818, 2132, 2301, 2667, 2863, 3285, 3510, 3992, 4248, 4794, 5083, 5697, 6021, 6707, 7068, 7830, 8230, 9072, 9513, 10439, 10923, 11937, 12466, 13572, 14148, 15350
Offset: 0

Views

Author

Kival Ngaokrajang, Apr 17 2015

Keywords

Comments

From Ulam's spiral, consider successive segments s(0) = [1]; s(1) = [2, 3]; s(2) = [4, 5]; s(3) = [6, 7]; s(4) = [8, 9, 10] and so on. a(n) is sum of numbers of the segment s(n). The first differences are A000290 interleaved with 2*A002061. See illustration in the links.

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{t = {5, 9}}, For[i = 3, i <= n, i++, If[OddQ@ i, AppendTo[t, t[[i - 1]] + ((i - 1)/2 + 1)^2], AppendTo[t, t[[i - 1]] + 2 ((i - 1)^2/4 + (i - 1) + 7/4)]]]; {1}~Join~t]; f@ 48(* Michael De Vlieger, Apr 17 2015 *)
  • PARI
    a(n) = if(n<=0, 1, if(n<=1, 5, if(n<=2, 9, if(Mod(n,2)==0, a(n-1)+2*((n-1)^2/4+(n-1)+7/4), a(n-1)+((n-1)/2+1)^2))))
    for (n=0, 100, print1(a(n),", "))
    
  • PARI
    Vec((2*x^8-3*x^7-5*x^6+9*x^5+5*x^4-8*x^3+x^2+4*x+1)/((x-1)^4*(x+1)^3) + O(x^100)) \\ Colin Barker, Apr 18 2015

Formula

a(0) = 1; a(1) = 5; a(2) = 9; for n >= 3, a(n) = a(n-1)+((n-1)/2+1)^2, if n = even; otherwise a(n) = a(n-1)+2*((n-1)^2/4+(n-1)+7/4).
From Colin Barker, Apr 17 2015: (Start)
a(n) = (n^3+5*n^2+14*n+16)/8 for n even and n>1.
a(n) = (n^3+4*n^2+11*n+8)/8 for n odd and n>1.
G.f.: (2*x^8-3*x^7-5*x^6+9*x^5+5*x^4-8*x^3+x^2+4*x+1) / ((x-1)^4*(x+1)^3).
(End)

A308385 a(n) is the last square visited by fers moves on a spirally numbered (2n-1) X (2n-1) board, moving to the lowest available unvisited square at each step.

Original entry on oeis.org

1, 3, 15, 29, 61, 87, 139, 177, 249, 299, 391, 453, 565, 639, 771, 857, 1009, 1107, 1279, 1389, 1581, 1703, 1915, 2049, 2281, 2427, 2679, 2837, 3109, 3279, 3571, 3753, 4065, 4259, 4591, 4797, 5149, 5367, 5739, 5969, 6361, 6603, 7015, 7269, 7701, 7967, 8419
Offset: 1

Views

Author

Sangeet Paul, May 23 2019

Keywords

Comments

A 5 X 5 board, for example, is numbered with the square spiral:
.
21--22--23--24--25
|
20 7---8---9--10
| | |
19 6 1---2 11
| | | |
18 5---4---3 12
| |
17--16--15--14--13
.
A fers is a (1,1)-leaper and can move one square diagonally.

Crossrefs

Programs

  • Magma
    [(3/2)*(5+(-1)^n) - (10+(-1)^n)*n + 4*n^2: n in [1..50]]; // Vincenzo Librandi, Aug 01 2019
  • Mathematica
    Table[(3/2) (5 + (-1)^n) - (10 + (-1)^n) n + 4 n^2, {n, 60}] (* Vincenzo Librandi, Aug 01 2019 *)
  • PARI
    Vec(x*(1 + 2*x + 10*x^2 + 10*x^3 + 9*x^4) / ((1 - x)^3*(1 + x)^2) + O(x^40)) \\ Colin Barker, May 23 2019
    

Formula

a(n) = (4n^2-9n+6)*[n is odd] + (4n^2-11n+9)*[n is even] where [] is the Iverson bracket.
a(n) = A054556(n)*[n is odd] + (A054552(n)+1)*[n is even] where [] is the Iverson bracket.
a(n) = A316884(n^2)*[n is odd] + A316884(n^2-n)*[n is even] where [] is the Iverson bracket.
From Colin Barker, May 23 2019: (Start)
G.f.: x*(1 + 2*x + 10*x^2 + 10*x^3 + 9*x^4) / ((1 - x)^3*(1 + x)^2).
a(n) = (3/2)*(5+(-1)^n) - (10+(-1)^n)*n + 4*n^2.
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5) for n>4.
(End)
E.g.f.: (1/2)*exp(-x)*(3 + 2*x + exp(2*x)*(15 - 12*x + 8*x^2)) - 9. - Stefano Spezia, Aug 17 2019

A336335 a(n) is the index of the first occurrence of the Euclidean distance prime(n) from a point on a square spiral to its starting point at 1.

Original entry on oeis.org

11, 28, 50, 176, 452, 536, 848, 1388, 2048, 1682, 3752, 4784, 6272, 7268, 8696, 7938, 13748, 14210, 17756, 19952, 11888, 24728, 27308, 25322, 20456, 38888, 42128, 45476, 32792, 49826, 64136, 68252, 43698, 76868, 77930, 90752, 69216, 105788, 111056, 108354, 127628
Offset: 1

Views

Author

Hugo Pfoertner, Jul 24 2020

Keywords

Examples

			  37--36--35--34--33--32--31
   |                       |
  38  17--16--15--14--13  30  ...
   |   |               |   |   |
  39  18   5---4---3  12  29  54
   |   |   |       |   |   |   |
  40  19   6   1---2 d=2 d=3  53
   |   |   |           |   |   |
  41  20   7---8---9--10  27  52
   |   |                   |   |
  42  21--22--23--24--25--26  51
   |                           |
  43--44--45--46--47--48--49-d=5
.
a(1) = 11 is the index of the first occurrence of distance d = 2 = prime(1) from the start of the spiral.
a(2) = 28 is the index of the first occurrence of distance d = 3 = prime(2) from the start of the spiral.
Distances of the form 4*k+1 corresponding to Pythagorean primes A002144 occur earlier than on the East spoke of the square spiral, dependent on the decomposition of p^2 into two squares. prime(3)^2 = 4^2 + 3^2 leads to index a(3) = 50 in the spiral.
		

Crossrefs

Formula

a(n) = A054552(prime(n)) if prime(n) != 1 mod 4.

A357281 The numbers of a square spiral with 1 in the center, lying at integer points of the right branch of the parabola y=n^2.

Original entry on oeis.org

1, 9, 79, 355, 1077, 2581, 5299, 9759, 16585, 26497, 40311, 58939, 83389, 114765, 154267, 203191, 262929, 334969, 420895, 522387, 641221, 779269, 938499, 1120975, 1328857, 1564401, 1829959, 2127979, 2461005, 2831677, 3242731, 3696999, 4197409
Offset: 0

Views

Author

Nicolay Avilov, Sep 22 2022

Keywords

Comments

On a square spiral with 1 in the center is a parabola y=n^2. The coordinate system is defined by the On and Oy axes, which intersect at the center of the spiral. The points of the parabola with integer coordinates located on the right branch of the parabola y=n^2 determine the terms of the sequence. In the attached figure, the terms are highlighted in red cells.

Examples

			a(0) = 1;
a(4) = 4*4^4 + 3*4^2 + 4 + 1 = 1024 + 48 + 5 = 1077.
		

Crossrefs

Cf. A033951 (x axes), A054552 (y axes).

Programs

  • Mathematica
    LinearRecurrence[{5,-10,10,-5,1},{1,9,79,355,1077},40] (* Harvey P. Dale, Oct 15 2023 *)

Formula

a(n) = 4*n^4 + 3*n^2 + n + 1.
a(n) = 4*A000583(n) + A056108(n).
G.f.: (1 + 4*x + 44*x^2 + 40*x^3 + 7*x^4)/(1 - x)^5. - Stefano Spezia, Sep 24 2022

A357744 a(n) is the least k such that prime(n) * k occurs in one of the eight main spokes of a square spiral with 1 in the center.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 1, 25, 1, 17, 1, 59, 1, 13, 37, 1, 4, 3, 13, 5, 1, 21, 8, 2, 4, 1, 131, 3, 1, 2, 1, 1, 1, 2, 37, 4, 13, 58, 7, 1, 34, 1, 7, 23, 4, 1, 29, 1, 251, 1, 5, 25, 3, 13, 1, 7, 30, 1, 311, 31, 38, 3, 49, 3, 6, 5, 37, 19, 16, 7, 5, 149, 3, 1, 7, 419, 1, 1, 91, 10, 2
Offset: 1

Views

Author

Karl-Heinz Hofmann, Dec 01 2022

Keywords

Comments

Numbers on the spokes of the spiral are A357745.
a(n) = 1 when prime(n) is directly on a main spoke.
a(n) <= prime(n) since odd squares are on the southeast spoke (A016754).

Crossrefs

Programs

  • Python
    from sympy import sieve
    A357744, A357745, aupto = [], [], 82
    for n in range (1, sieve[aupto]**2):
        A357745.append(((n+3)**2 >> 4) + 1 if n % 8 != 1 else (n+3)**2 >> 4)
    for p in sieve[1:aupto + 1]:
        k = 1
        while (p*k) not in A357745: k += 1
        A357744.append(k)
    print(A357744)

A386486 a(0) = 1; thereafter a(n) = 4*n^2 - 3*n + 2.

Original entry on oeis.org

1, 3, 12, 29, 54, 87, 128, 177, 234, 299, 372, 453, 542, 639, 744, 857, 978, 1107, 1244, 1389, 1542, 1703, 1872, 2049, 2234, 2427, 2628, 2837, 3054, 3279, 3512, 3753, 4002, 4259, 4524, 4797, 5078, 5367, 5664, 5969, 6282, 6603, 6932, 7269, 7614, 7967, 8328, 8697, 9074, 9459, 9852, 10253, 10662, 11079, 11504, 11937, 12378
Offset: 0

Views

Author

N. J. A. Sloane, Aug 27 2025

Keywords

Comments

Differs from A001107, A054552, and A343560 only by a small constant, but has its own entry because of an important geometric application (which will be added soon).

Crossrefs

Programs

  • Mathematica
    A386486[n_] := If[n == 0, 1, (4*n - 3)*n + 2]; Array[A386486, 100, 0] (* or *)
    LinearRecurrence[{3, -3, 1}, {1, 3, 12, 29}, 100] (* Paolo Xausa, Aug 27 2025 *)

Formula

From Elmo R. Oliveira, Sep 02 2025: (Start)
G.f.: (1 + 6*x^2 + x^3)/(1 - x)^3.
E.g.f.: exp(x)*(2 + x + 4*x^2) - 1.
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n > 3. (End)
Previous Showing 51-56 of 56 results.