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 31-40 of 43 results. Next

A143861 Ulam's spiral (NNE spoke).

Original entry on oeis.org

1, 14, 59, 136, 245, 386, 559, 764, 1001, 1270, 1571, 1904, 2269, 2666, 3095, 3556, 4049, 4574, 5131, 5720, 6341, 6994, 7679, 8396, 9145, 9926, 10739, 11584, 12461, 13370, 14311, 15284, 16289, 17326, 18395, 19496, 20629, 21794, 22991, 24220
Offset: 1

Views

Author

Keywords

Comments

Stanislaw M. Ulam was doodling during the presentation of a "long and very boring paper" at a scientific meeting in 1963. The spiral is its result. Note that conforming to trigonometric conventions, the spiral begins on the abscissa and rotates counterclockwise. Other spirals, orientations, direction of rotation and initial values exist, even in the OEIS.
Also sequence found by reading the segment (1, 14) together with the line from 14, in the direction 14, 59, ..., in the square spiral whose vertices are the generalized decagonal numbers A074377. - Omar E. Pol, Nov 05 2012

References

  • Chris K. Caldwell & G. L. Honaker, Jr., Prime Curios! The Dictionary of Prime Number Trivia, CreateSpace, Sept 2009, pp. 2-3.

Crossrefs

Programs

  • GAP
    List([1..40], n-> ((32*n-35)^2 +55)/64); # G. C. Greubel, Nov 09 2019
  • Magma
    [((32*n-35)^2 +55)/64: n in [1..40]]; // G. C. Greubel, Nov 09 2019
    
  • Maple
    seq( ((32*n-35)^2 +55)/64, n=1..40); # G. C. Greubel, Nov 09 2019
  • Mathematica
    (* From Robert G. Wilson v, Oct 29 2011 *)
    f[n_]:= 16n^2 -35n +20; Array[f, 40]
    LinearRecurrence[{3,-3,1}, {1,14,59}, 40]
    FoldList[#1 + #2 &, 1, 32Range@ 10 - 19] (* End *)
    ((32*Range[40] -35)^2 +55)/64 (* G. C. Greubel, Nov 09 2019 *)
  • PARI
    a(n)=16*n^2-35*n+20 \\ Charles R Greathouse IV, Oct 29 2011
    
  • Sage
    [((32*n-35)^2 +55)/64 for n in (1..40)] # G. C. Greubel, Nov 09 2019
    

Formula

a(n) = 16*n^2 - 35*n + 20. - R. J. Mathar, Sep 08 2008
G.f.: x*(1 + 11*x + 20*x^2)/(1-x)^3. - Colin Barker, Aug 03 2012
E.g.f.: -20 + (20 - 19*x + 16*x^2)*exp(x). - G. C. Greubel, Nov 09 2019

A172979 Primes with locations of right angle turns in Ulam square spiral (primes in A033638).

Original entry on oeis.org

2, 3, 5, 7, 13, 17, 31, 37, 43, 73, 101, 157, 197, 211, 241, 257, 307, 401, 421, 463, 577, 601, 677, 757, 1123, 1297, 1483, 1601, 1723, 2551, 2917, 2971, 3137, 3307, 3541, 3907, 4357, 4423, 4831, 5113, 5477, 5701, 6007, 6163, 6481, 7057, 8011, 8101, 8191, 8837, 9901
Offset: 1

Views

Author

Michel Lagneau, Nov 21 2010

Keywords

Comments

Except for the first term, 2, these are the primes on the main diagonals of the Ulam spiral. - Robert G. Wilson v, Jul 10 2014
Primes p for which floor(sqrt(p)) | (p-1). - Davide Rotondo, Jun 06 2025

Examples

			Ulam square spiral = 7 8 9 / 6 1 2 / 5 4 3 /...; changes of direction (right-angle)
  for the primes at 2 3 5 7 ...
		

Crossrefs

Programs

  • Maple
    with(numtheory): a0:=1:for n from 1 to 200 do : a1:=a0+floor(n/2):a0:=a1:if
      type(a1,prime)=true then printf(`%d, `,a1):else fi:od:
  • Mathematica
    Select[ Sort@ Flatten@ Table[ 4n^2 + (2j - 4)n + 1, {j, 0, 3}, {n, 55}], PrimeQ]
  • PARI
    for(n=0,10^3, my(t=n^2\4+1); if(isprime(t),print1(t,", "))); \\ Joerg Arndt, Jul 12 2014

A073338 Positive values of n for which 4n^2-10n+7 is prime.

Original entry on oeis.org

2, 3, 4, 9, 10, 12, 15, 18, 22, 30, 31, 36, 37, 39, 40, 46, 51, 52, 54, 57, 60, 61, 67, 72, 73, 75, 78, 79, 82, 85, 88, 96, 103, 106, 109, 117, 124, 141, 145, 148, 156, 166, 177, 180, 186, 192, 193, 199, 204, 219, 225, 228, 229, 246, 249, 264, 267, 268, 270, 277
Offset: 1

Views

Author

Zak Seidov, Aug 25 2002

Keywords

Examples

			n=10 is in the sequence since 4n^2-10n+7=307 is prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[300], PrimeQ[4#^2-10#+7]&]

Extensions

Edited by Dean Hickerson, Aug 28 2002

A081353 Diagonal of square maze arrangement of natural numbers A081349.

Original entry on oeis.org

3, 5, 13, 19, 31, 41, 57, 71, 91, 109, 133, 155, 183, 209, 241, 271, 307, 341, 381, 419, 463, 505, 553, 599, 651, 701, 757, 811, 871, 929, 993, 1055, 1123, 1189, 1261, 1331, 1407, 1481, 1561, 1639, 1723, 1805, 1893, 1979, 2071, 2161, 2257, 2351, 2451, 2549
Offset: 0

Views

Author

Paul Barry, Mar 19 2003

Keywords

Crossrefs

Bisections are in A054554, A125202.

Programs

Formula

a(n) = (n+1)*(n+2)+(-1)^n = 2*binomial(n+2,2)+(-1)^n.
G.f.: (3-x)*(1+x^2)/((1-x)^3*(1+x)). [Colin Barker, Sep 03 2012]
From Wesley Ivan Hurt, Aug 09 2015: (Start)
a(n) = 2*a(n-1)-2*a(n-3)+a(n-4), n>4.
a(n) = n^2+3n+3 if n is even, otherwise n^2+3n+1.
a(n) = A137932(n+3) - A109613(n+1). (End)

A254527 Total number of points on a sphere when both poles are on an x by x grid where x=8*n+1.

Original entry on oeis.org

6, 26, 62, 114, 182, 266, 366, 482, 614, 762, 926, 1106, 1302, 1514, 1742, 1986, 2246, 2522, 2814, 3122, 3446, 3786, 4142, 4514, 4902, 5306, 5726, 6162, 6614, 7082, 7566, 8066, 8582, 9114, 9662, 10226, 10806, 11402, 12014, 12642, 13286, 13946, 14622, 15314
Offset: 1

Views

Author

Thomas Olson, Jan 31 2015

Keywords

Comments

Maximum number of regions formed by n circles and n ellipses in the plane. - Ivan N. Ianakiev, Sep 21 2019
Number of points on a sphere whose longitude and latitude are both multiples of (90 degrees)/n, including the poles. - Jianing Song, Aug 28 2022

Crossrefs

Programs

  • Mathematica
    Table[8*n^2  - 4*n + 2,{n,1,44}] (* Ivan N. Ianakiev, Sep 21 2019 *)
  • PARI
    vector(50, n, 8*n^2 - 4*n + 2) \\ Michel Marcus, Feb 08 2015
    
  • PARI
    Vec(-2*x*(x+1)*(x+3)/(x-1)^3 + O(x^100)) \\ Colin Barker, Aug 09 2015

Formula

a(n) = 8*n^2 - 4*n + 2.
From Colin Barker, Aug 09 2015: (Start)
a(n) = 2*A054554(n+1).
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n>3.
G.f.: -2*x*(x+1)*(x+3) / (x-1)^3.
(End)
E.g.f.: -2 + exp(x)*(2 + 4*x + 8*x^2). - Stefano Spezia, Sep 21 2019
a(n) = A051890(2*n). - Jianing Song, Aug 28 2022

A357745 Numbers on the 8 main spokes of a square spiral with 1 in the center.

Original entry on oeis.org

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

Views

Author

Karl-Heinz Hofmann, Dec 22 2022

Keywords

Comments

The 8 main spokes are (with 1 in the center, 2 to the east, 3 to the northeast): east: A054552; northeast: A054554; north: A054556; northwest: A053755; west: A054567; southwest: A054569; south: A033951; southeast: A016754.
Alternatively the 8 main spokes are pairwise part of the 4 main axes: horizontal: A317186; vertical: A267682; diagonal: A002061; antidiagonal: A080335.
And lastly the 4 main axes are giving two main crosses: Horizontal-vertical cross: A039823; Diagonal-antidiagonal cross: A200975.

Examples

			See visualization in links.
		

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

A185669 a(n) = 4*n^2 + 3*n + 2.

Original entry on oeis.org

2, 9, 24, 47, 78, 117, 164, 219, 282, 353, 432, 519, 614, 717, 828, 947, 1074, 1209, 1352, 1503, 1662, 1829, 2004, 2187, 2378, 2577, 2784, 2999, 3222, 3453, 3692, 3939, 4194, 4457, 4728, 5007, 5294, 5589, 5892, 6203, 6522, 6849, 7184, 7527, 7878, 8237, 8604, 8979, 9362, 9753, 10152, 10559, 10974, 11397, 11828
Offset: 0

Views

Author

Paul Curtz, Feb 09 2011

Keywords

Comments

Natural numbers A000027 written clockwise as a square spiral:
.
43--44--45--46--47--48--49
|
42 21--22--23--24--25--26
| | |
41 20 7---8---9--10 27
| | | | |
40 19 6 1---2 11 28
| | | | | |
39 18 5---4---3 12 29
| | | |
38 17--16--15--14--13 30
| |
37--36--35--34--33--32--31
.
Walking in straight lines away from the center:
1, 2, 11, ... = A054552(n) = 1 -3*n+4*n^2,
1, 8, 23, ... = A033951(n) = 1 +3*n+4*n^2,
1, 3, 13, ... = A054554(n+1) = 1 -2*n-4*n^2,
1, 7, 21, ... = A054559(n+1) = 1 +2*n+4*n^2,
1, 4, 15, ... = A054556(n+1) = 1 -n+4*n^2,
1, 6, 19, ... = A054567(n+1) = 1 +n+4*n^2,
1, 5, 17, ... = A053755(n) = 1 +4*n^2,
1, 9, 25, ... = A016754(n) = 1 +4*n+4*n^2 = (1+2*n)^2,
2, 8, 22, ... = 2*A084849(n) = 2 +2*n+4*n^2,
2, 12, 30, ... = A002939(n+1) = 2 +6*n+4*n^2,
2, 9, 24, ... = a(n) = 2 +3*n+4*n^2,
2, 10, 26, ... = A069894(n) = 2 +4*n+4*n^2,
3, 11, 27, ... = A164897(n) = 3 +4*n+4*n^2,
3, 12, 29, ... = A054552(n+1)+1 = 3 +5*n+4*n^2,
3, 14, 33, ... = A033991(n+1) = 3 +7*n+4*n^2,
3, 15, 35, ... = A000466(n+1) = 3 +8*n+4*n^2,
4, 14, 32, ... = 2*A130883(n+1) = 4 +6*n+4*n^2,
4, 16, 36, ... = A016742(n+1) = 4 +8*n+4*n^2 = (2+2*n)^2,
5, 18, 39, ... = A007742(n+1) = 5 +9*n+4*n^2,
5, 19, 41, ... = A125202(n+2) = 5+10*n+4*n^2.

Programs

Formula

a(n) = a(n-1) + 8*n - 1.
a(n) = 2*a(n-1) - a(n-2) + 8.
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3).
G.f.: (2 +3*x +3*x^2)/(1-x)^3 . - R. J. Mathar, Feb 11 2011
a(n) = A033954(n) + 2. - Bruno Berselli, Apr 10 2011
E.g.f.: (4*x^2 + 7*x + 2)*exp(x). - G. C. Greubel, Jul 09 2017

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)

A386670 Number of ternary strings of length 2*n that have more 0's than the combined number of 1's and 2's.

Original entry on oeis.org

0, 1, 9, 73, 577, 4521, 35313, 275577, 2150721, 16793929, 131230609, 1026283545, 8032614625, 62921342953, 493262044977, 3869724080313, 30379987189377, 238661880787593, 1876072096450257, 14756076838714713, 116126703647975457, 914363729294862633, 7203083947383222897
Offset: 0

Views

Author

Enrique Navarrete, Jul 28 2025

Keywords

Examples

			a(1)=1 since the string of length 2 is 00.
a(2)=9 since the strings of length 4 are the 4 permutations of 0001, the 4 permutations of 0002, and 0000.
a(4)=577 since the strings of length 8 are (number of permutations in parentheses): 00000001 (8), 00000002 (8), 00000011 (28), 00000012 (56), 00000022 (28), 00000111 (56), 00000112 (168), 00000122 (168), 00000222 (56), 00000000 (1).
		

Crossrefs

Formula

a(n) = Sum_{k=1..n} 2^(n-k)*binomial(2*n,n-k).
a(n) = Sum_{k=1..n} A128417(n,k).
G.f.: (1-4*x-sqrt(1-8*x))/(sqrt(1-8*x)*(sqrt(1-8*x)+12*x-1)).
a(n) = A128418(n) - A059304(n).

A161372 In Ulam's spiral starting at 101, take the elements not used so far from the two spokes SW, NE, SW, NE, SW, NE ...

Original entry on oeis.org

107, 101, 121, 103, 143, 113, 173, 131, 211, 157, 257, 191, 311, 233, 373, 283, 443, 341, 521, 407, 607, 481, 701, 563, 803, 653, 913, 751, 1031, 857, 1157, 971, 1291, 1093, 1433, 1223, 1583, 1361, 1741, 1507, 1907, 1661, 2081, 1823, 2263, 1993, 2453
Offset: 1

Views

Author

Milton L. Brown (miltbrown(AT)earthlink.net), Jun 08 2009

Keywords

Comments

NE to SW Diagonal of Ulam's Spiral, with 101 at center.
The sequence did not match the original definition. A working definition might be a(2n)=4n^2-10n+107, a(2n-1)=4n^2+2n+101, a(n)=n^2-n+105+2*(-1)^n*(1-2*n), but this seems to be unrelated to Ulam spirals. [R. J. Mathar, Jun 11 2009]

Examples

			SW-NE diagonal in:
  137 136 135 134 133 132 131
  138 117 116 115 114 113 130
  139 118 105 104 103 112 129
  140 119 106 101 102 111 128
  141 120 107 108 109 110 127
  142 121 122 123 124 125 126
  143 144 145 146 147 148 149
		

Crossrefs

Cf. A054569 (SW spoke), A054554 (NE spoke).

Programs

  • Mathematica
    CoefficientList[Series[(107*x^4-6*x^3-194*x^2-6*x+107)/((1+x)^2*(1-x)^3), {x,0,32}], x] (* Georg Fischer, Dec 03 2024 *)

Extensions

Edited by Georg Fischer, Dec 03 2024
Previous Showing 31-40 of 43 results. Next