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-2 of 2 results.

A271511 a(n) = (p+1)*(p+2)/2 where p is the n-th prime.

Original entry on oeis.org

6, 10, 21, 36, 78, 105, 171, 210, 300, 465, 528, 741, 903, 990, 1176, 1485, 1830, 1953, 2346, 2628, 2775, 3240, 3570, 4095, 4851, 5253, 5460, 5886, 6105, 6555, 8256, 8778, 9591, 9870, 11325, 11628, 12561, 13530, 14196, 15225, 16290, 16653, 18528, 18915, 19701
Offset: 1

Views

Author

Vincenzo Librandi, Apr 09 2016

Keywords

Comments

Subsequence of A253145.

Crossrefs

Cf. A253145.

Programs

  • Magma
    [(p+1)*(p+2) / 2: p in PrimesUpTo(200)];
    
  • Mathematica
    Table[(Prime[n]^2 + 3 Prime[n] + 2) / 2, {n, 50}]
  • PARI
    lista(nn) = forprime(p=2, nn, print1((p+1)*(p+2)/2, ", ")); \\ Altug Alkan, Apr 09 2016

A335927 a(n+1) = Sum_{k=1..n} (a(k) + k*(n-k)), with a(1)=1.

Original entry on oeis.org

1, 2, 7, 20, 50, 115, 251, 530, 1096, 2237, 4529, 9124, 18326, 36743, 73591, 147302, 294740, 589633, 1179437, 2359064, 4718338, 9436907, 18874067, 37748410, 75497120, 150994565, 301989481, 603979340, 1207959086
Offset: 1

Views

Author

Daniel Cieslinski, Jul 01 2020

Keywords

Comments

First column of matrix given by:
C(1,1) = 1,
C(n,k+1) = C(n,k) + n,
C(n+1,1) = Sum_{k=1..n-1} C(k, n-k+1);
where C(i,j) denotes cell at row i and column j
1 2 3 4 5 6 ..
2 4 6 8 10 ...
7 10 13 16 ...
20 24 28 ...
50 55 ...
115...
-------
Can also be seen as diagonal of the following triangle, which is obtained by shifting n-th row of the earlier mentioned matrix, by n-1 cells:
1 2 3 4 5 6 ...
2 4 6 8 10 ...
7 10 13 16 ...
20 24 28 ...
50 55 ...
115...

Crossrefs

Cf. A253145.

Programs

  • Mathematica
    a[1] = 1; a[n_] := a[n] = Sum[a[k] + k*(n - k), {k, 1, n - 1}]; Array[a, 30] (* Amiram Eldar, Jul 02 2020 *)
    LinearRecurrence[{5,-9,7,-2},{1,2,7,20,50},30] (* Harvey P. Dale, Sep 27 2024 *)
  • Python
    def a(n):
        if n == 1: return 1
        return sum([a(k) + k*(n-k) for k in range(1,n)])

Formula

a(1) = 1, a(n+1) = Sum_{k=1..n} (a(k) + k*(n-k)); for n>1.
a(n) = 1/4 * (9*2^n - 2*n^2 - 6*n - 8); for n > 1.
a(n+1) = 2 * a(n) + A253145(n-1).
From Stefano Spezia, Jul 02 2020: (Start)
G.f.: x*(1 - 3*x + 6*x^2 - 4*x^3 + x^4)/((1 - x)^3*(1 - 2*x)).
a(n) = 5*a(n-1) - 9*a(n-2) + 7*a(n-3) - 2*a(n-4) for n > 5. (End)
Showing 1-2 of 2 results.