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.

A214696 Sum of next a(n) > 1 positive triangular numbers is a triangular number.

Original entry on oeis.org

3, 7, 13, 17, 4919, 73789919
Offset: 1

Views

Author

Alex Ratushnyak, Jul 26 2012

Keywords

Comments

Two or more triangular numbers in the sum.
Because an oblong number is twice a triangular number, this sequence also gives: the sum of next a(n) positive oblong numbers is an oblong number.

Examples

			1+3+6 = 10 is a triangular number, so a(1)=3, then 10+15+21+28+36+45+55 = 210 is a triangular number, seven summands, so a(2)=7.
		

Crossrefs

Formula

a(n) is the smallest integer k > 1 such that (4*k^3 + 12*s*k^2 + 4*(3*s^2-1)*k)/3 + 1 is a square, where s = 1 + a(1) + a(2) + ... + a(n-1). - Max Alekseyev, Jan 30 2014

A214697 Least k > 1 such that tri(n)+ ... + tri(n+k-1) is a triangular number.

Original entry on oeis.org

2, 3, 5, 17, 7, 2, 89, 125, 3, 215, 269, 13, 10, 8, 11, 27, 719, 815, 21, 57, 316, 11, 26, 1517, 17, 1799, 30, 26, 7, 5, 2609, 11, 2975, 10, 2, 76, 3779, 1251, 208, 4445, 115, 4919, 1045, 5417, 11, 17, 1205, 6485, 38, 2860, 7349, 18, 25, 8267, 8585, 8909
Offset: 0

Views

Author

Alex Ratushnyak, Jul 26 2012

Keywords

Comments

tri(n) = n*(n+1)/2 is the n-th triangular number, A000217(n).
a(n) is how many consecutive triangular numbers starting from tri(n) are needed to sum up to tri(x) for some x. The requirement a(n) > 1 is needed, because otherwise all a(n) = 1.
Because an oblong number (A002378) is twice a triangular number, this sequence is also the least k > 1 such that oblong(n) + ... + oblong(n+k-1) is an oblong number.
a(n) is least k > 1 such that 12*k^3 + 36*n*k^2 + 36*k*n^2 - 12*k + 9 is a perfect square. - Chai Wah Wu, Mar 01 2016
a(n) <= 3*n^2 - 3*n - 1 for n > 1, since 12*k^3 + 36*n*k^2 + 36*k*n^2 - 12*k + 9 is a square when k = 3*n^2 - 3*n - 1. - Robert Israel, Mar 03 2016

Examples

			0+1 = 1 is a triangular number, two summands, so a(0)=2.
1+3+6 = 10 is a triangular number, three summands, so a(1)=3.
3+6+10+15+21 = 55 is a triangular number, five summands, so a(2)=5.
Starting from Triangular(5)=15:  15+21=36 is a triangular number, two summands, so a(5)=2.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local k;
        for k from 2 do if issqr(12*k^3+36*k^2*n+36*k*n^2-12*k+9) then return k fi od
    end proc:
    map(f, [$0..100]); # Robert Israel, Mar 03 2016
  • Mathematica
    triQ[n_] := IntegerQ[Sqrt[1+8*n]]; Table[k = n+1; s = k^2; While[! triQ[s], k++; s = s + k*(k+1)/2]; k - n + 1, {n, 0, 55}] (* T. D. Noe, Jul 26 2012 *)
  • Python
    for n in range(77):
        i = ti = n
        sum = 0
        tn_gte_sum = 0  # least oblong  number >= sum
        while i-n<=1 or tn_gte_sum!=sum:
            sum += i*(i+1)
            i+=1
            while tn_gte_sum
    				
  • Python
    from math import sqrt
    def A214697(n):
        k, a1, a2, m = 2, 36*n, 36*n**2 - 12, n*(72*n + 144) + 81
        while int(round(sqrt(m)))**2 != m:
            k += 1
            m = k*(k*(12*k + a1) + a2) + 9
        return k # Chai Wah Wu, Mar 01 2016
Showing 1-2 of 2 results.