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 11-13 of 13 results.

A207260 Triangle read by rows: T(n,k) = k^2 + (1-(-1)^(n-k))/2.

Original entry on oeis.org

0, 1, 1, 0, 2, 4, 1, 1, 5, 9, 0, 2, 4, 10, 16, 1, 1, 5, 9, 17, 25, 0, 2, 4, 10, 16, 26, 36, 1, 1, 5, 9, 17, 25, 37, 49, 0, 2, 4, 10, 16, 26, 36, 50, 64, 1, 1, 5, 9, 17, 25, 37, 49, 65, 81, 0, 2, 4, 10, 16, 26, 36, 50, 64, 82, 100, 1, 1, 5, 9, 17, 25, 37, 49, 65, 81, 101, 121
Offset: 0

Views

Author

Philippe Deléham, Feb 16 2012

Keywords

Comments

Row sums are A171218(n).

Examples

			Triangle begins:
  0;
  1, 1;
  0, 2, 4;
  1, 1, 5,  9;
  0, 2, 4, 10, 16;
  1, 1, 5,  9, 17, 25;
  0, 2, 4, 10, 16, 26, 36;
  1, 1, 5,  9, 17, 25, 37, 49;
  0, 2, 4, 10, 16, 26, 36, 50, 64;
  1, 1, 5,  9, 17, 25, 37, 49, 65, 81;
  ...
		

Crossrefs

Programs

  • Magma
    /* As triangle */ [[ k^2 + (1-(-1)^(n-k))/2: k in [0..n]]: n in [0.. 15]]; // Vincenzo Librandi, Nov 09 2024
  • Mathematica
    Table[k^2 + (1-(-1)^(n-k))/2, {n, 0, 15}, {k, 0, n}] (* Paolo Xausa, Nov 13 2024 *)

Formula

T(n+k, n) = A002522(n) if k is odd.
T(n+k, n) = n^2 = A000290(n) if k is even.
T(2*n, n) = A137928(n), n>0.
T(2*n+1, n+1) = A080335(n).
T(n,0) = A000035(n).
T(n+1,1) = A000034(n).
T(n+2,2) = A010710(n).
T(n+3,3) = A010735(n).
Sum_{k, 0<=k<=n} T(n,k)*x^k = (-1)^n*A007590(n), A000035(n), A171218(n)
for x = -1, 0, 1 respectively.
G.f.: x*(1 + y - x*y + x*(1 + 2*x)*y^2)/((1 - x^2)*(1 - x*y)^3). - Stefano Spezia, Nov 12 2024

A215470 Prime intersections in a square spiral with positive integers: primes p such that there are four primes among eight nearest neighbors of p.

Original entry on oeis.org

71, 353, 701, 1151, 1451, 3347, 4691, 13463, 21017, 27947, 34337, 42017, 52253, 57191, 79907, 80831, 81611, 121469, 144497, 159737, 161141, 256301, 265547, 284231, 285707, 312161, 334511, 346559, 348617, 382601, 392069, 422867, 440303, 502013, 541061, 545873, 593207
Offset: 1

Views

Author

Alex Ratushnyak, Aug 11 2012

Keywords

Comments

Conjecture: the sequence is infinite. - Alex Ratushnyak, Sep 19 2012

Examples

			The spiral begins:
.
  121  82--83--84--85--86--87--88--89--90--91
    |   |                                   |
  120  81  50--51--52--53--54--55--56--57  92
    |   |   |                           |   |
  119  80  49  26--27--28--29--30--31  58  93
    |   |   |   |                   |   |   |
  118  79  48  25  10--11--12--13  32  59  94
    |   |   |   |   |           |   |   |   |
  117  78  47  24   9   2---3  14  33  60  95
    |   |   |   |   |   |   |   |   |   |   |
  116  77  46  23   8   1   4  15  34  61  96
    |   |   |   |   |       |   |   |   |   |
  115  76  45  22   7---6---5  16  35  62  97
    |   |   |   |               |   |   |   |
  114  75  44  21--20--19--18--17  36  63  98
    |   |   |                       |   |   |
  113  74  43--42--41--40--39--38--37  64  99
    |   |                               |   |
  112  73--72--71--70--69--68--67--66--65 100
    |                                       |
  111-110-109-108-107-106-105-104-103-102-101
.
Among eight nearest neighbors of 71 four are primes: 41, 43, 107, 109.
		

Crossrefs

Programs

  • Python
    SIZE = 3335  # must be odd
    TOP = SIZE*SIZE
    prime = [1]*TOP
    prime[1]=0
    for i in range(4,TOP,2):
        prime[i]=0
    for i in range(3,TOP,2):
        if prime[i]==1:
            for j in range(i*3,TOP,i*2):
                prime[j]=0
    grid = [0] * TOP
    posX = posY = SIZE//2
    grid[posY*SIZE+posX] = 1
    n = 2
    saveX = [0]* (TOP+1)
    saveY = [0]* (TOP+1)
    saveX[1]=posX
    saveY[1]=posY
    def walk(stepX, stepY, chkX, chkY):
      global posX, posY, n
      while 1:
        posX+=stepX
        posY+=stepY
        grid[posY*SIZE+posX]=n
        saveX[n]=posX
        saveY[n]=posY
        n+=1
        if posX*posY==0 or grid[(posY+chkY)*SIZE+posX+chkX]==0:
            return
    while 1:
        walk(0, -1, 1, 0)   # up
        if posX*posY==0:
            break
        walk(1, 0, 0, 1)    # right
        walk(0, 1, -1, 0)   # down
        walk(-1, 0, 0, -1)  # left
    for s in range(1, n):
      if prime[s]:
        posX = saveX[s]
        posY = saveY[s]
        a,b=(grid[(posY-1)*SIZE+posX-1]) , (grid[(posY-1)*SIZE+posX+1])
        c,d=(grid[(posY+1)*SIZE+posX-1]) , (grid[(posY+1)*SIZE+posX+1])
        if a*b==0 or c*d==0:
            break
        if prime[a]+prime[b]+prime[c]+prime[d]==4:
            print(s, end=', ')

A219527 a(n) = (6*n^2 + 7*n - 9 + 2*n^3)/12 - (-1)^n*(n+1)/4.

Original entry on oeis.org

1, 3, 11, 19, 37, 55, 87, 119, 169, 219, 291, 363, 461, 559, 687, 815, 977, 1139, 1339, 1539, 1781, 2023, 2311, 2599, 2937, 3275, 3667, 4059, 4509, 4959, 5471, 5983, 6561, 7139, 7787, 8435, 9157, 9879, 10679, 11479, 12361, 13243
Offset: 1

Views

Author

Paul Curtz, Nov 21 2012

Keywords

Comments

First column of the Mendeleyev-Moseley-Seaborg table (with alkali metals) or 31st column of the Janet table. See A138726.
(a(n+10) - a(n))/10 = 29, 36, 45, 54, ... = A061925(n+7) + 3.
b(n) = a(n+1) - 2*a(n) = 1, 5, -3, -1, -19, -23, -55, -69, -119, -147, -219, -265, -363, -431, ... contains -a(2*n).
b(2*n-1) - b(2*n-2) = 4, 2, -4, -14, -28, -46, -68, ... = A147973(n+3).

Crossrefs

Cf. A147973.

Programs

  • Mathematica
    a[n_] := (6*n^2 + 7*n - 9 + 2*n^3)/12 - (-1)^n*(n + 1)/4; Table[ a[n], {n, 1, 42}] (* Jean-François Alcover, Apr 05 2013 *)
    LinearRecurrence[{2,1,-4,1,2,-1},{1,3,11,19,37,55},50] (* Harvey P. Dale, Apr 01 2018 *)

Formula

a(n) = A168380(n+1) - 1.
a(n+2) - a(n+1) = A093907(n) = A137583(n+1).
a(n+3) - a(n+1) = 10,16,26,36,... = A137928(n+3).
G.f. x*(1 + x + 4*x^2 - 2*x^3 + x^5 - x^4) / ( (1+x)^2*(x-1)^4 ). - R. J. Mathar, Mar 27 2013
Previous Showing 11-13 of 13 results.