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

A082183 Smallest k > 0 such that T(n) + T(k) = T(m), for some m, T(i) being the triangular numbers, n > 1.

Original entry on oeis.org

2, 5, 9, 3, 5, 27, 10, 4, 8, 14, 17, 9, 5, 21, 135, 12, 14, 35, 6, 9, 17, 30, 12, 18, 10, 7, 54, 21, 23, 495, 42, 14, 26, 8, 49, 27, 15, 20, 98, 30, 32, 80, 9, 19, 35, 62, 45, 17, 20, 14, 99, 39, 10, 18, 54, 24, 44, 78, 81, 45, 25, 85, 153, 11, 50, 125, 20, 29, 53, 94, 97
Offset: 2

Views

Author

Ralf Stephan, Apr 06 2003

Keywords

Comments

For 16 years this entry stood with no upper bound, and indeed with no proof that a(n) always existed. In February 2020 the following three bounds and formulas arrived. They are listed in chronological order. Here k = k(n) denotes the smallest number such that T(n)+T(k) is a triangular number T(m) for some m = m(n). - N. J. A. Sloane, Feb 22 2020
k = T(n) - 1 is an upper bound on k(n) = a(n). For T(k) makes a huge triangle; all the elements of the T(n) triangle can be thinly plated onto the side of the big one as a single additional row, producing T(k+1) with m = k+1. - Allan C. Wechsler, Feb 19 2020
Let Q be the largest odd number < n dividing T(n). Then T(n) is the sum of Q consecutive integers, the last Q rows of the triangle T(m) with m = T(n)/Q + (Q-1)/2, giving the upper bound k <= T(n)/Q - (Q+1)/2. [This bound is now A332554, the values of Q are in A332547.] This bound is not tight: for n=9 it gives a(9) <= 6 when in fact a(9) = 4. - Michael J. Collins, Feb 19 2020
Comments from Richard C. Schroeppel, Feb 19 2020: (Start)
2T(n) = 2T(m) - 2T(k) = m^2 + m - k^2 - k = (m-k) (m + k + 1). Now (m-k) and (m+k+1) are of opposite parity. Factor 2T(n) into the product of an odd number times an even number. We can take one of these to be m-k, and the other to be m+k+1.
The factorization 2T(n) = n^2 + n gives two obvious solutions, n * (n+1) and 1 * (n^2+n). Equating these to (m-k) * (m+k+1) gives the two "trivial" solutions k=0, m=n and k=T(n)-1, m=T(n).
Unless n is a Mersenne prime, or n+1 is a Fermat prime [these are the n such that Q=1, see A068194] there will be a nontrivial odd divisor of n(n+1) other than 1, n, or n+1. Select the odd divisor d logarithmicly closest to n + 1/2 that isn't n or n+1.
Let q be the quotient n(n+1)/q. Then m-k = min(d,q) and m+k+1 = max(d,q). Solve for k, which is the required minimum k(n) = a(n).
Example: n=5, T(n)=15, 2T(n)=30 = 3*10, d=3, q=10, k=3, m=6, 15+6 = 21. (End)

Crossrefs

Cf. A000217, A072522, values of m are in A082184, A332547.
A332554 is an upper bound on a(n).
See A055527 for a very similar sequence involving Pythagorean triples. - Bradley Klee, Feb 20 2020
See also A309332 (number of ways to write a triangular number as a sum of two triangular numbers), A309507 (... as a difference ...).

Programs

  • Maple
    f:= proc(n) local e,t,te;
         t:= n*(n+1);
         e:= padic:-ordp(t,2);
         te:= 2^e;
         min(map(d -> (abs(te*d-t/(te*d))-1)/2, numtheory:-divisors(t/te)) minus {0}):
    map(f, [$2..100]); # Robert Israel, Sep 15 2017
  • Mathematica
    Table[SelectFirst[Range[10^3], Function[m, PolygonalNumber@ Floor@ Sqrt[2 m] == m][PolygonalNumber[n] + PolygonalNumber[#]] &], {n, 2, 72}] (* Michael De Vlieger, Sep 19 2017, after Maple by Robert Israel *)
  • PARI
    for(n=2, 100, t=n*(n+1)/2; for(k=1, 10^9, u=t+k*(k+1)/2; v=floor(sqrt(2*u)); if(v*(v+1)/2==u, print1(k", "); break)))
    
  • Python
    from _future_ import division
    from sympy import divisors
    def A082183(n):
        t = n*(n+1)
        ds = divisors(t)
        for i in range(len(ds)//2-2,-1,-1):
            x = ds[i]
            y = t//x
            a, b = divmod(y-x,2)
            if b:
                return a
        return -1 # Chai Wah Wu, Sep 12 2017

Extensions

Entry updated by N. J. A. Sloane, Feb 22 2020

A082184 The a(n)-th triangular number is the sum of the n-th triangular number and the smallest triangular number possible.

Original entry on oeis.org

3, 6, 10, 6, 8, 28, 13, 10, 13, 18, 21, 16, 15, 26, 136, 21, 23, 40, 21, 23, 28, 38, 27, 31, 28, 28, 61, 36, 38, 496, 53, 36, 43, 36, 61, 46, 41, 44, 106, 51, 53, 91, 45, 49, 58, 78, 66, 52, 54, 53, 112, 66, 55, 58, 78, 62, 73, 98, 101, 76, 67, 106, 166, 66, 83, 142, 71
Offset: 2

Views

Author

Ralf Stephan, Apr 06 2003

Keywords

Comments

a(n) is triangular if n+1 is triangular. Conjectures: partial maxima of sequence are at index i with value from A068195 and also a(i) - A082183(i) = 1, where i is in A068194.

Crossrefs

Cf. A000217, A080824, index of second term is in A082183.
Partial maxima have index in A068194.

Programs

  • Maple
    a:= proc(n) local h, j; h:= n*(n+1); for j from n+1 do
          if issqr(1+4*(j*(j+1)-h)) then return j fi od
        end:
    seq(a(n), n=2..70);  # Alois P. Heinz, Jul 31 2019
  • Mathematica
    a[n_] := Module[{h = n(n+1), j}, For[j = n+1, True, j++, If[IntegerQ[ Sqrt[1 + 4 (j(j+1) - h)]], Return[j]]]];
    a /@ Range[2, 70] (* Jean-François Alcover, Jun 05 2020, after Maple *)
  • PARI
    for(n=2, 100, t=n*(n+1)/2; for(k=1, 10^9, u=t+k*(k+1)/2; v=floor(sqrt(2*u)); if(v*(v+1)/2==u, print1(v", "); break)))

A309507 Number of ways the n-th triangular number T(n) = A000217(n) can be written as the difference of two positive triangular numbers.

Original entry on oeis.org

0, 1, 1, 1, 3, 3, 1, 2, 5, 3, 3, 3, 3, 7, 3, 1, 5, 5, 3, 7, 7, 3, 3, 5, 5, 7, 7, 3, 7, 7, 1, 3, 7, 7, 11, 5, 3, 7, 7, 3, 7, 7, 3, 11, 11, 3, 3, 5, 8, 11, 7, 3, 7, 15, 7, 7, 7, 3, 7, 7, 3, 11, 5, 3, 15, 7, 3, 7, 15, 7, 5, 5, 3, 11, 11, 7, 15, 7, 3, 9, 9, 3, 7
Offset: 1

Views

Author

Alois P. Heinz, Aug 05 2019

Keywords

Comments

Equivalently, a(n) is the number of triples [n,k,m] with k>0 satisfying the Diophantine equation n*(n+1) + k*(k+1) - m*(m+1) = 0. Any such triple satisfies a triangle inequality, n+k > m. The n for which there is a triple [n,n,m] are listed in A053141. - Bradley Klee, Mar 01 2020; edited by N. J. A. Sloane, Mar 31 2020

Examples

			a(5) = 3: T(5) = T(6)-T(3) = T(8)-T(6) = T(15)-T(14).
a(7) = 1: T(7) = T(28)-T(27).
a(8) = 2: T(8) = T(13)-T(10) = T(36)-T(35).
a(9) = 5: T(9) = T(10)-T(4) = T(11)-T(6) = T(16)-T(13) = T(23)-T(21) = T(45)-T(44).
a(49) = 8: T(49) = T(52)-T(17) = T(61)-T(36) = T(94)-T(80) = T(127)-T(117) = T(178)-T(171) = T(247)-T(242) = T(613)-T(611) = T(1225)-T(1224).
The triples with n <= 16 are:
2, 2, 3
3, 5, 6
4, 9, 10
5, 3, 6
5, 6, 8
5, 14, 15
6, 5, 8
6, 9, 11
6, 20, 21
7, 27, 28
8, 10, 13
8, 35, 36
9, 4, 10
9, 6, 11
9, 13, 16
9, 21, 23
9, 44, 45
10, 8, 13
10, 26, 28
10, 54, 55
11, 14, 18
11, 20, 23
11, 65, 66
12, 17, 21
12, 24, 27
12, 77, 78
13, 9, 16
13, 44, 46
13, 90, 91
14, 5, 15
14, 11, 18
14, 14, 20
14, 18, 23
14, 33, 36
14, 51, 53
14, 104, 105
15, 21, 26
15, 38, 41
15, 119, 120
16, 135, 136. - _N. J. A. Sloane_, Mar 31 2020
		

Crossrefs

Cf. A000217, A001108, A046079 (the same for squares), A068194, A100821 (the same for primes for n>1), A309332.
See also A053141. The monotonic triples [n,k,m] with n <= k <= m are counted in A333529.

Programs

  • Maple
    with(numtheory): seq(tau(n*(n+1))-tau(n*(n+1)/2)-1, n=1..80); # Ridouane Oudra, Dec 08 2023
  • Mathematica
    TriTriples[TNn_] := Sort[Select[{TNn, (TNn + TNn^2 - # - #^2)/(2 #),
          (TNn + TNn^2 - # + #^2)/(2 #)} & /@
        Complement[Divisors[TNn (TNn + 1)], {TNn}],
       And[And @@ (IntegerQ /@ #), And @@ (# > 0 & /@ #)] &]]
    Length[TriTriples[#]] & /@ Range[100]
    (* Bradley Klee, Mar 01 2020 *)

Formula

a(n) = 1 <=> n in { A068194 } \ { 1 }.
a(n) is even <=> n in { A001108 } \ { 0 }.
a(n) = number of odd divisors of n*(n+1) (or, equally, of T(n)) that are greater than 1. - N. J. A. Sloane, Apr 03 2020
a(n) = A092517(n) - A063440(n) - 1. - Ridouane Oudra, Dec 08 2023

A332547 a(n) = largest odd divisor d < n of n*(n+1)/2.

Original entry on oeis.org

1, 1, 1, 1, 3, 3, 1, 3, 5, 5, 3, 3, 7, 7, 5, 1, 9, 9, 5, 15, 11, 11, 3, 15, 13, 13, 21, 7, 15, 15, 1, 11, 17, 17, 21, 9, 19, 19, 15, 5, 21, 21, 11, 33, 23, 23, 3, 21, 35, 25, 39, 13, 27, 45, 35, 21, 29, 29, 15, 15, 31, 31, 21, 13, 55, 33, 17, 51, 35, 35
Offset: 1

Views

Author

N. J. A. Sloane, Feb 21 2020

Keywords

Comments

Used by Michael J. Collins in the analysis of A082183 and A082184.

Crossrefs

Cf. A000217, A068194 (where a(n)=1), A082183, A082184, A332548, A332549 (where a(n)=3).

Programs

  • Mathematica
    Join[{1},Table[Select[Divisors[(n(n+1))/2],OddQ[#]&&#Harvey P. Dale, Jul 16 2024 *)

A333529 Number of triples [n,k,m] with n <= k <= m satisfying T_n + T_k = T_m, where T_i = i*(i+1)/2 are the triangular numbers.

Original entry on oeis.org

0, 1, 1, 1, 2, 2, 1, 2, 3, 2, 3, 3, 2, 5, 3, 1, 4, 4, 3, 5, 5, 2, 3, 4, 4, 5, 5, 3, 6, 6, 1, 3, 5, 6, 7, 5, 2, 5, 6, 3, 6, 6, 3, 8, 9, 2, 3, 4, 6, 8, 6, 3, 6, 11, 5, 6, 5, 2, 7, 7, 2, 9, 5, 3, 11, 6, 3, 6, 11, 6, 5, 5, 2, 9, 9, 6, 11, 6, 3, 7, 7, 2, 7, 12, 6, 5, 7, 3, 10, 16, 6, 6, 5, 6, 6, 3, 4, 12, 12, 5, 6, 6, 3, 12
Offset: 1

Views

Author

N. J. A. Sloane, Mar 31 2020

Keywords

Comments

a(n)=1 if n is in A068194. - Robert Israel, Apr 03 2020

Examples

			There is a list of all triples (including those with 0 < k < n) with n <= 16 in A309507.
		

Crossrefs

A309507 counts all triples with k>0.

Programs

  • Maple
    with(numtheory):
    A:=[]; M:=150; ct:=Array(0..M,0):
    for n from 1 to M do
    TT:=n*(n+1);
    dlis:=divisors(TT);
      for d in dlis do
    if (d mod 2) = 1 then e := TT/d;
    mi:=min(d,e); ma:=max(d,e);
    k:=(ma-mi-1)/2; m:=(ma+mi-1)/2;
    # skip if k=n then
        ct[n]:=ct[n]+1;
        lprint(n,k,m);
        fi;
    fi;
    od:
    od:
    [seq(ct[n],n=1..M)];
    # alternative:
    f:= proc(n) local t,t0, r, dmax, divs;
        t:= n*(n+1);
        r:= padic:-ordp(t,2);
        t0:= t/2^r;
        dmax:= floor((sqrt(8*t+1)-1)/2-n);
        divs:= numtheory:-divisors(t0);
        nops(select(`<=`,divs,dmax)) + nops(select(`<=`,divs,dmax/2^r))
    end proc:
    map(f, [$1..200]); # Robert Israel, Apr 03 2020
  • Mathematica
    T[n_] := n(n+1)/2;
    r[n_] := Reduce[n <= k <= m && T[n] + T[k] == T[m], {k, m}, Integers];
    a[n_] := Module[{rn = r[n], r0}, r0 = rn[[0]]; Which[r0 === Or, Length[rn], r0 === And, 1, rn === False, 0, True, Print["error ", n, " ", rn]]];
    Array[a, 100] (* Jean-François Alcover, Jun 08 2020 *)

A068195 Numbers of the form n(n+1)/2 whose only representation as a sum of 2 or more consecutive positive integers is 1+2+...+n.

Original entry on oeis.org

1, 3, 6, 10, 28, 136, 496, 8128, 32896, 33550336, 2147516416, 8589869056, 137438691328, 2305843008139952128, 2658455991569831744654692615953842176
Offset: 1

Views

Author

Jon Perry, Feb 19 2002

Keywords

Comments

Consists of 1, even perfect numbers and numbers of the form n(n+1)/2 where n+1 is a Fermat prime. (See A068194 for proof.)

Crossrefs

Record values in A082184.

Extensions

Edited by Dean Hickerson, Feb 22 2002

A134459 Numbers n such that lcm(1,...,n-1) < lcm(1,...,n) < lcm(1,...,n+1).

Original entry on oeis.org

2, 3, 4, 7, 8, 16, 31, 127, 256, 8191, 65536, 131071, 524287, 2147483647, 2305843009213693951, 618970019642690137449562111, 162259276829213363391578010288127, 170141183460469231731687303715884105727
Offset: 1

Views

Author

Zak Seidov, Jan 18 2008

Keywords

Comments

Or, numbers n such that A003418(n-1) < A003418(n) < A003418(n+1). Sequence is the union(A019434 - 1, A000668).
lcm(1..n-1) < lcm(1..n) iff n is a prime power. So the sequence consists of those n for which both n and n+1 are prime powers. By Catalan's conjecture (proved by Mihailescu), the only case where n and n+1 are both powers > 1 is n=8. Otherwise, whichever of n and n+1 is even must be a power of 2 and the other must be a prime: either a Mersenne prime if n+1 is the power of 2, or a Fermat prime if n is the power of 2. - Robert Israel

Crossrefs

Cf. A000668, A003418, A006549, A019434. Essentially a duplicate of A068194.

Formula

a(n) = A006549(n+1) for n >= 1 (cf. Robert Israel's comment). - Georg Fischer, Nov 02 2018

Extensions

Missing entry 8 added by N. J. A. Sloane, Jan 22 2018, following a suggestion from Jon E. Schoenfield.

A332549 Numbers k such that A332547(k) = 3.

Original entry on oeis.org

5, 6, 8, 11, 12, 23, 47, 96, 191, 192, 383, 768, 6143, 12288, 786431, 786432, 3221225472, 51539607551, 206158430208, 824633720831, 6597069766656, 26388279066623, 108086391056891903, 55340232221128654847, 221360928884514619392, 226673591177742970257407
Offset: 1

Views

Author

N. J. A. Sloane, Feb 21 2020

Keywords

Comments

The numbers k such that A332547(k) = 1 are given by A068194, a sequence of interest to Mersenne and Fermat, so this sequence may also be interesting.
The factors of the initial terms are 5, 2*3, 2^3, 11, 2^2*3, 23, 47, 2^5*3, 191, 2^6*3, 383, 2^8*3, 6143, 2^12*3, 786431, 2^18*3, ...
There are essentially two cases. Firstly n can be an odd prime and n+1 of the form 3*2^k. These are the terms of A007505 with 2 excluded. Otherwise n can be of the form 3*2^k and n+1 a prime. These are 1 less than the terms of A039687. In addition, 8 is a term which is a special case. - Andrew Howroyd, Feb 21 2020

Crossrefs

Programs

  • PARI
    upto(n)={Set(concat([if(n<8,[],[8]), select(isprime, [3*2^k-1 |k<-[1..logint((n+1)\3, 2)]]), select(p->isprime(p+1), [3*2^k |k<-[1..logint(n\3, 2)]])]))} \\ Andrew Howroyd, Feb 21 2020

Extensions

Terms a(17) and beyond from Andrew Howroyd, Feb 21 2020
Showing 1-8 of 8 results.