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.

A249356 8*A200975(n)-7 where A200975 are the numbers on the diagonals in Ulam's spiral.

Original entry on oeis.org

1, 17, 33, 49, 65, 97, 129, 161, 193, 241, 289, 337, 385, 449, 513, 577, 641, 721, 801, 881, 961, 1057, 1153, 1249, 1345, 1457, 1569, 1681, 1793, 1921, 2049, 2177, 2305, 2449, 2593, 2737, 2881, 3041, 3201, 3361, 3521, 3697, 3873, 4049, 4225, 4417, 4609, 4801
Offset: 1

Views

Author

Todd Silvestri, Oct 27 2014

Keywords

Comments

All elements are odd.
The pair (a(n), a(n+1)) is separated by A002265(n-1) elements in A158057.

Programs

  • Maple
    seq(2*n*(n+2)+(-1)^n-4*sin((Pi*n)/2), n=1..100); # Robert Israel, Nov 04 2014
  • Mathematica
    a[n_Integer/;n>0]:=2 n (n+2)+(-1)^n-4 Mod[n^2 (3 n+2),4,-1]
    CoefficientList[Series[-(x^5 - x^4 + 15 x + 1) / ((x - 1)^3 (x^3 + x^2 + x + 1)), {x, 0, 40}], x] (* Vincenzo Librandi, Nov 16 2014 *)
    Table[2 n (n + 2) - (1 - (-1)^n) (1 - 2 I^(n + 1)) + 1, {n, 1, 50}] (* Bruno Berselli, Nov 18 2014 *)
    LinearRecurrence[{2,-1,0,1,-2,1},{1,17,33,49,65,97},50] (* Harvey P. Dale, Sep 29 2019 *)
  • PARI
    a(n) = 2*n*(n+2)+(-1)^n-4*round(sin((Pi*n)/2)) \\ Charles R Greathouse IV, Nov 17 2014

Formula

a(n) = 2*n*(n+2)+(-1)^n-4*sin((Pi*n)/2).
G.f.: - x*(x^5-x^4+15*x+1)/((x-1)^3*(x^3+x^2+x+1)).
a(n) = 2*a(n-1) - a(n-2) + 16 if n == 2 mod 4, a(n) = 2*a(n-1) - a(n-2) otherwise. - Robert Israel, Nov 04 2014
a(n) = 2*n*(n+2) - (1-(-1)^n)*(1-2*i^(n+1)) + 1, where i=sqrt(-1). - Bruno Berselli, Nov 18 2014

A121658 Primes neither of the n^2+1 nor n^2+n+1 form.

Original entry on oeis.org

11, 19, 23, 29, 41, 47, 53, 59, 61, 67, 71, 79, 83, 89, 97, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 163, 167, 173, 179, 181, 191, 193, 199, 223, 227, 229, 233, 239, 251, 263, 269, 271, 277, 281, 283, 293, 311, 313, 317, 331, 337, 347, 349
Offset: 1

Views

Author

Giovanni Teofilatto, Sep 10 2006, Sep 12 2006

Keywords

Comments

Previous name: Primes not equal to [k*(k or k+1 or k+2)] + 1 where k is a natural number.
Primes not of the form n^2 + 1 and n^2 + n + 1 and (n+1)^2. Correct version!!
Primes not contained in A200975 (numbers on the diagonals of Ulam's spiral). - Bob Selcoe, Oct 27 2014

Crossrefs

Cf. A200975.

Programs

  • Mathematica
    Select[Prime[Range[100]],NoneTrue[{Sqrt[#-1],(Sqrt[4#-3]-1)/2}, IntegerQ]&] (* The program uses the NoneTrue function from Mathematica version 10 *) (* Harvey P. Dale, Dec 23 2015 *)
  • PARI
    lista(nn) = {forprime(p=2, nn, if (!issquare(p-1) && !ispolygonal((p-1)/2, 3), print1(p, ", ")););} \\ Michel Marcus, Oct 28 2014

Extensions

Edited by R. J. Mathar, Aug 02 2008
Data corrected by Bob Selcoe and Michel Marcus, Oct 28 2014

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

A271725 T(n,k) is an array read by rows, with n > 0 and k=1..4, where row n gives four prime numbers in increasing order with locations in right angles of each concentric square drawn on a distorted version of the Ulam spiral.

Original entry on oeis.org

3, 7, 17, 19, 13, 23, 37, 41, 307, 359, 401, 419, 13807, 14159, 14401, 14519, 41413, 42023, 42437, 42641, 6317683, 6325223, 6330257, 6332771, 22958473, 22972847, 22982437, 22987229, 39081253, 39100007, 39112517, 39118769, 110617807, 110649359, 110670401, 110680919
Offset: 1

Views

Author

Michel Lagneau, Apr 13 2016

Keywords

Comments

See the illustration for more information.
Conjecture: there is an infinity of concentric squares having a prime number in each right angle. The number 5 is the center of all the squares.
It seems that the drawing of an infinite number of concentric squares having a prime number in each corner is impossible in an Ulam spiral. But with a slight distortion of this space, the problem becomes possible.
The illustration (see the link) shows the new version of a spiral with two remarkable orthogonal diagonals containing four classes of prime numbers given by the sequences A125202, A121326, A028871 and A073337 supported by four line segments. These intersect at a single point represented by the prime number 5.
The sequence of the corresponding length of the sides is {s(k)} = {2, 4, 18, 118, 204, 2514, 4792, 6252, 10518, 14032, 16752, 17598, ...}
The primes are defined by the polynomials: [4*m^2-10*m+7, (2*m-1)^2-2, 4*m^2+1, 4*(m+1)^2-6*(m+1)+1]. The sequence of the corresponding m is {b(k)} = {2, 3, 10, 60, 103, 1258, 2397, 3127, 5260, 7017, 8377, 8800, 10375, 11518, 11523, 12498, 15415, 15888, ...} with the relation b(k) = 1 + s(k)/2.
The array begins:
3, 7, 17, 19;
13, 23, 37, 41;
307, 359, 401, 419;
13807, 14159, 14401, 14519;
41413, 42023, 42437, 42641;
...
Construction of the spiral (see the illustration in the link):
. . . . . . . . . . . .
. 42 41 40 39 38 37 . . .
|
. 43 20 19 18 17 36 35 . .
|
. . 21 6 5 16 15 34 . .
|
. . 22 7 4 3 14 33 . .
. . 23 8 1 2 13 32 . .
. . 24 9 10 11 12 31 . .
. . 25 26 27 28 29 30 . .
. . . . . . . . . . .
The first squares of center 5 having a prime number in each vertex are:
19 18 17 41 40 39 38 37
6 5 16 20 19 18 17 36
7 4 3 21 6 5 16 15 . . . .
22 7 4 3 14
23 8 1 2 13

Crossrefs

Programs

  • Maple
    for n from 1 to 10000 do :
      x1:=4*n^2-10*n+7:x2:=(2*n-1)^2-2:
      x3:=4*(n+1)^2-6*(n+1)+1:x4:=4*n^2+1:
       if isprime(x1) and isprime(x2) and isprime(x3) and isprime(x4)
        then
         printf("%d %d %d %d %d \n",n,x1,x2,x4,x3):
        else
        fi:
    od:

A355759 Sums of the first ceiling((n+1)/2) entries on the diagonals of a square spiral with a starting value of 1 in the center, where the diagonal and the antidiagonal are used alternately.

Original entry on oeis.org

1, 4, 6, 11, 15, 24, 32, 45, 57, 76, 94, 119, 143, 176, 208, 249, 289, 340, 390, 451, 511, 584, 656, 741, 825, 924, 1022, 1135, 1247, 1376, 1504, 1649, 1793, 1956, 2118, 2299, 2479, 2680, 2880, 3101, 3321, 3564, 3806, 4071, 4335, 4624, 4912, 5225, 5537, 5876, 6214, 6579, 6943
Offset: 1

Views

Author

Karl-Heinz Hofmann, Aug 14 2022

Keywords

Examples

			See the PDF in links.
		

Crossrefs

Cf. A006527 and A208995 (bisections, see formulas).

Programs

  • Mathematica
    CoefficientList[Series[-(x^7 - 2*x^6 + x^4 - x^3 + 2*x^2 - 2*x - 1)/((x - 1)^4*(x + 1)^2*(x^2 + 1)), {x, 0, 50}], x] (* Amiram Eldar, Aug 19 2022 *)
  • PARI
    a(n) = (n^2 + 6*n + if(n%2,17,20))*n \ 24 + (n%4!=1); \\ Kevin Ryde, Aug 19 2022
  • Python
    def A355759(n):  # polynomial way.
        if   n % 2 == 0: return((24 + 20*n + 6*n**2 + n**3)//24)
        elif n % 4 == 3: return((12 + 17*n + 6*n**2 + n**3)//24)
        elif n % 4 == 1: return((     17*n + 6*n**2 + n**3)//24)
    

Formula

G.f.: -(x^7 - 2*x^6 + x^4 - x^3 + 2*x^2 - 2*x-1)/((x - 1)^4 * (x + 1)^2 * (x^2 +1)).
a(n) = (24 + 20*n + 6*n^2 + n^3) / 24 for n even.
a(n) = (12 + 17*n + 6*n^2 + n^3) / 24 for n odd and n (mod 4) == 3.
a(n) = (17*n + 6*n^2 + n^3) / 24 for n odd and n (mod 4) == 1.
a(2*n) = A006527(n+1).
a(2*n-1) = A208995(n) - 1.
E.g.f.: ((30 + 45*x + 12*x^2 + x^3)*cosh(x) + (51 + 42*x + 12*x^2 + x^3)*sinh(x) - 6*cos(x))/24. - Stefano Spezia, Aug 19 2022
Showing 1-5 of 5 results.