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.

A227363 a(n) = n + (n-1)*(n-2) + (n-3)*(n-4)*(n-5) + (n-6)*(n-7)*(n-8)*(n-9) + ... + ...*(n-n).

Original entry on oeis.org

0, 1, 2, 5, 10, 17, 32, 61, 110, 185, 316, 557, 986, 1705, 2840, 4661, 7702, 12881, 21620, 35965, 58706, 94217, 150016, 239045, 382670, 614401, 984332, 1564301, 2458810, 3826745, 5918936, 9136597, 14115686, 21842225, 33803620, 52181021, 80128082, 122221801, 185211440
Offset: 0

Views

Author

Alex Ratushnyak, Jul 07 2013

Keywords

Comments

From a question by Jonathan Vos Post dated Jul 09 2013, the indices of a(n) which are prime begin: 2, 3, 5, 7, 11, 41, 111, 205, 211, 215, 341, 345, 395, 581, 585, 1221, ..., . - Robert G. Wilson v, Jul 10 2013

Examples

			a(2) = 2 + 1*0 = 2.
a(3) = 3 + 2*1 = 5.
a(9) = 9 + 8*7 + 6*5*4 + 3*2*1*0 = 9 + 56 + 120 = 185.
a(11) = 11 + 10*9 + 8*7*6 + 5*4*3*2 = 557.
a(18) = 18 + 17*16 + 15*14*13 + 12*11*10*9 + 8*7*6*5*4 = 21620.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Sum[ Product[ n - k (k - 1)/2 - i + 1, {i, k}], {k, Sqrt[ 2n]}]; Array[f, 39, 0] (* Robert G. Wilson v, Jul 10 2013 *)
  • PARI
    a(n)=sum(k=1,sqrtint(2*n)+1,prod(i=1,k,max(n-k*(k-1)/2-i+1,0))) \\ Charles R Greathouse IV, Jul 09 2013
  • Python
    for n in range(55):
      sum = i = 0
      k = 1
      while i<=n:
        product = 1
        for x in range(k):
          product *= n-i
          i += 1
          if i>n: break
        sum += product
        k += 1
      print(str(sum), end=',')