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-10 of 17 results. Next

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

A084921 a(n) = lcm(p-1, p+1) where p is the n-th prime.

Original entry on oeis.org

3, 4, 12, 24, 60, 84, 144, 180, 264, 420, 480, 684, 840, 924, 1104, 1404, 1740, 1860, 2244, 2520, 2664, 3120, 3444, 3960, 4704, 5100, 5304, 5724, 5940, 6384, 8064, 8580, 9384, 9660, 11100, 11400, 12324, 13284, 13944, 14964, 16020, 16380
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 11 2003

Keywords

Comments

This sequence consists of terms of sequences A055523 and A055527 for prime n > 2. - Toni Lassila (tlassila(AT)cc.hut.fi), Feb 02 2004

Crossrefs

Programs

  • Haskell
    a084921 n = lcm (p - 1) (p + 1)  where p = a000040 n
    -- Reinhard Zumkeller, Jun 01 2013
    
  • Magma
    [3] cat [(p^2-1)/2: p in PrimesInInterval(3,300)]; // G. C. Greubel, May 03 2024
    
  • Mathematica
    LCM[#-1,#+1]&/@Prime[Range[50]] (* Harvey P. Dale, Oct 09 2018 *)
  • PARI
    a(n)=if(n<2,3,(prime(n)^2-1)/2) \\ Charles R Greathouse IV, May 15 2013
    
  • SageMath
    [3]+[(n^2-1)/2 for n in prime_range(3,301)] # G. C. Greubel, May 03 2024

Formula

a(n) = A084920(n)/2 for n > 1.
a(n) = 3*A084922(n) for n > 2.
a(n) = A009286(A000040(n)). - Enrique Pérez Herrero, May 17 2012
a(n) ~ 0.5 n^2 log^2 n. - Charles R Greathouse IV, May 15 2013
Product_{n>=1} (1 + 1/a(n)) = 2. - Amiram Eldar, Jan 23 2021
a(n) = (A000040(n)^2 - 1) / 2 for n > 1. - Christian Krause, Mar 27 2021
a(n) = (3/2)*A024700(n-2), for n > 1. - G. C. Greubel, May 03 2024

A055523 Longest other leg of a Pythagorean triangle with n as length of a leg.

Original entry on oeis.org

4, 3, 12, 8, 24, 15, 40, 24, 60, 35, 84, 48, 112, 63, 144, 80, 180, 99, 220, 120, 264, 143, 312, 168, 364, 195, 420, 224, 480, 255, 544, 288, 612, 323, 684, 360, 760, 399, 840, 440, 924, 483, 1012, 528, 1104, 575, 1200, 624, 1300, 675, 1404, 728, 1512, 783
Offset: 3

Views

Author

Henry Bottomley, May 22 2000

Keywords

Crossrefs

Programs

  • Maple
    seq(`if`(n::even, (n/2-1)*(n/2+1), (n-1)*(n+1)/2), n=3..100); # Robert Israel, Dec 16 2014
  • Mathematica
    a[n_Integer/;n>=3]:=(3 (n^2-2)+(-1)^(n+1) (n^2+2))/8 (* Todd Silvestri, Dec 16 2014 *)
  • PARI
    Vec(x^3*(x^3-3*x-4)/((x-1)^3*(x+1)^3) + O(x^100)) \\ Colin Barker, Sep 15 2014

Formula

a(n) = 2*A055522(n)/n = sqrt(A055524(n)^2-n^2).
a(2k) = (k-1)*(k+1), a(2k+1) = 2k*(k+1).
a(n) = 3*a(n-2)-3*a(n-4)+a(n-6). G.f.: x^3*(x^3-3*x-4) / ((x-1)^3*(x+1)^3). - Colin Barker, Sep 15 2014
a(n) = (3*(n^2-2)+(-1)^(n+1)*(n^2+2))/8. - Todd Silvestri, Dec 16 2014
E.g.f.: 1 + (3*x^2/8 + 3*x/8 - 3/4)*exp(x) + (-x^2/8 + x/8 - 1/4)*exp(-x). - Robert Israel, Dec 16 2014

A055524 Longest other side of a Pythagorean triangle with n as length of one of the three sides (in fact n is a leg and a(n) the hypotenuse).

Original entry on oeis.org

5, 5, 13, 10, 25, 17, 41, 26, 61, 37, 85, 50, 113, 65, 145, 82, 181, 101, 221, 122, 265, 145, 313, 170, 365, 197, 421, 226, 481, 257, 545, 290, 613, 325, 685, 362, 761, 401, 841, 442, 925, 485, 1013, 530, 1105, 577, 1201, 626, 1301, 677, 1405, 730, 1513, 785
Offset: 3

Views

Author

Henry Bottomley, May 22 2000

Keywords

Crossrefs

Programs

  • Mathematica
    A055524[n_] := (3*n^2-(-1)^n*(n^2-2)+6)/8; Array[A055524, 100, 3] (* or *)
    LinearRecurrence[{0, 3, 0, -3, 0, 1}, {5, 5, 13, 10, 25, 17}, 100] (* Paolo Xausa, Feb 29 2024 *)
  • PARI
    Vec(-x^3*(2*x^5+x^4-5*x^3-2*x^2+5*x+5)/((x-1)^3*(x+1)^3) + O(x^100)) \\ Colin Barker, Sep 15 2014

Formula

a(n) = sqrt(n^2+A055523(n)^2). a(2k) = k^2+1, a(2k+1) = k^2+(k+1)^2.
a(n) = 3*a(n-2)-3*a(n-4)+a(n-6). G.f.: -x^3*(2*x^5+x^4-5*x^3-2*x^2+5*x+5) / ((x-1)^3*(x+1)^3). - Colin Barker, Sep 15 2014
a(n) = (3*n^2+6-(n^2-2)*(-1)^n)/8. - Luce ETIENNE, Jul 11 2015

A055525 Shortest other side of a Pythagorean triangle having n as length of one of the three sides.

Original entry on oeis.org

4, 3, 3, 8, 24, 6, 12, 6, 60, 5, 5, 48, 8, 12, 8, 24, 180, 12, 20, 120, 264, 7, 7, 10, 36, 21, 20, 16, 480, 24, 44, 16, 12, 15, 12, 360, 15, 9, 9, 40, 924, 33, 24, 528, 1104, 14, 168, 14, 24, 20, 28, 72, 33, 33, 76, 40, 1740, 11, 11, 960, 16, 48, 16, 88, 2244, 32, 92, 24
Offset: 3

Views

Author

Henry Bottomley, May 22 2000

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := Block[{a, c, k = 1, n2 = n^2}, While[ If[ k > n, !IntegerQ[c = Sqrt[n2 + k^2]], !IntegerQ[c = Sqrt[n2 + k^2]] && !IntegerQ[a = Sqrt[n2 - k^2]]], k++; If[k == n, k++]]; If[ IntegerQ@ c, k, Sqrt[n2 - a^2]]]; (* Robert G. Wilson v, Feb 23 2024 *)

Formula

From Robert G. Wilson v, Feb 23 2024: (Start)
sqrt(2*(n-1)) < a(n) < n^2/2.
If n = k*m, then a(n) <= k*a(m). (End)

A055522 Largest area of a Pythagorean triangle with n as length of one of the three sides (in fact as a leg).

Original entry on oeis.org

6, 6, 30, 24, 84, 60, 180, 120, 330, 210, 546, 336, 840, 504, 1224, 720, 1710, 990, 2310, 1320, 3036, 1716, 3900, 2184, 4914, 2730, 6090, 3360, 7440, 4080, 8976, 4896, 10710, 5814, 12654, 6840, 14820, 7980, 17220, 9240, 19866, 10626, 22770, 12144, 25944
Offset: 3

Views

Author

Henry Bottomley, May 22 2000

Keywords

Crossrefs

Programs

  • Maple
    seq(piecewise(n mod 2 = 0,n*(n^2-4)/8,n*(n^2-1)/4),n=3..60); # C. Ronaldo
  • Mathematica
    Table[n*(3*(n^2 - 2) - (n^2 + 2)*(-1)^n)/16, {n, 3, 50}] (* Wesley Ivan Hurt, Apr 27 2017 *)

Formula

a(n) = n*A055523(n)/2.
a(2k) = k*(k+1)*(k-1), a(2k+1) = k*(k+1)*(2k+1).
O.g.f.: 6*x^3*(x+1+x^2)/((1-x)^4*(1+x)^4). a(2k+1)=A055112(k). a(2k)=A007531(k+1). [R. J. Mathar, Aug 06 2008]
a(n) = n*(3*(n^2-2)-(n^2+2)*(-1)^n)/16. - Luce ETIENNE, Jul 17 2015

A055526 Shortest hypotenuse of a Pythagorean triangle with n as length of a leg.

Original entry on oeis.org

5, 5, 13, 10, 25, 10, 15, 26, 61, 13, 85, 50, 17, 20, 145, 30, 181, 25, 29, 122, 265, 25, 65, 170, 45, 35, 421, 34, 481, 40, 55, 290, 37, 39, 685, 362, 65, 41, 841, 58, 925, 55, 51, 530, 1105, 50, 175, 130, 85, 65, 1405, 90, 73, 65, 95, 842, 1741, 61, 1861, 962, 65
Offset: 3

Views

Author

Henry Bottomley, May 22 2000

Keywords

Comments

Smallest k>n such that the squarefree part of k+n equals the squarefree part of k-n - Benoit Cloitre, May 26 2002

Crossrefs

Programs

  • Mathematica
    core[n_] := core[n] = Times @@ Map[#[[1]]^Mod[#[[2]], 2] &, FactorInteger[n]];
    A055526[n_] := Block[{k = n}, While[core[++k+n] != core[k-n]]; k];
    Array[A055526, 100, 3] (* Paolo Xausa, Feb 29 2024 *)
  • PARI
    for(n=3,105,s=n+1; while(abs(core(s+n)-core(s-n))>0,s++); print1(s,","))

Formula

a(n) = sqrt(n^2+A055527(n)^2).

A054435 Smallest area of a Pythagorean triangle with n as length of one of the three sides.

Original entry on oeis.org

6, 6, 6, 24, 84, 24, 54, 24, 330, 30, 30, 336, 54, 96, 60, 216, 1710, 96, 210, 1320, 3036, 84, 84, 120, 486, 294, 210, 216, 7440, 384, 726, 240, 210, 270, 210, 6840, 270, 180, 180, 840, 19866, 726, 486, 12144, 25944, 336, 4116, 336, 540, 480, 630, 1944, 726
Offset: 3

Views

Author

Henry Bottomley, May 22 2000

Keywords

Crossrefs

A054436 Smallest area of a Pythagorean triangle with n as length of a leg.

Original entry on oeis.org

6, 6, 30, 24, 84, 24, 54, 120, 330, 30, 546, 336, 60, 96, 1224, 216, 1710, 150, 210, 1320, 3036, 84, 750, 2184, 486, 294, 6090, 240, 7440, 384, 726, 4896, 210, 270, 12654, 6840, 1014, 180, 17220, 840, 19866, 726, 540, 12144, 25944, 336, 4116, 3000, 1734, 1014
Offset: 3

Views

Author

Henry Bottomley, May 22 2000

Keywords

Crossrefs

Programs

  • Maple
    readlib(issqr): for a from 3 to 80 do for b from 1 by 1 while not issqr(a^2+b^2) do od: printf("%d, ",a*b/2) od: # C. Ronaldo
  • Mathematica
    a[n_] := For[k = 1, True, k++, If[IntegerQ[Sqrt[n^2+k^2]], Return[n k/2]]];
    a /@ Range[3, 100] (* Jean-François Alcover, Feb 14 2020 *)

Formula

a(n) = n*A055527(n)/2.

A232176 Least positive k such that n^2 + triangular(k) is a square.

Original entry on oeis.org

1, 2, 6, 10, 14, 18, 7, 5, 8, 34, 6, 42, 46, 15, 54, 16, 14, 66, 70, 74, 23, 82, 9, 90, 17, 98, 102, 10, 110, 15, 25, 122, 126, 16, 39, 48, 40, 21, 150, 34, 158, 29, 54, 48, 30, 13, 182, 63, 55, 194, 56, 202, 14, 45, 214, 63, 222, 26, 41, 234, 31, 42, 39, 250, 32, 63
Offset: 0

Views

Author

Alex Ratushnyak, Nov 19 2013

Keywords

Comments

Triangular(k) = A000217(k) = k*(k+1)/2.
a(n) <= 4*n - 2, because with k = 4*n-2: n^2 + k*(k+1)/2 = n^2 + (4*n-2)*(4*n-1)/2 = 9*n^2 - 6*n + 1 = (3*n-1)^2.
The sequence of numbers n such that a(n)=n begins: 8, 800, 7683200 ... - a subsequence of A220186.

Crossrefs

Cf. A232179 (least k>=0 such that n^2 + triangular(k) is a triangular number).
Cf. A101157 (least k>0 such that triangular(n) + k^2 is a triangular number).
Cf. A232178 (least k>=0 such that triangular(n) + k^2 is a square).

Programs

  • Mathematica
    lpk[n_]:=Module[{k=1},While[!IntegerQ[Sqrt[n^2+(k(k+1))/2]],k++];k]; Array[ lpk,70,0] (* Harvey P. Dale, May 04 2018 *)
  • PARI
    a(n) = {k = 1; while (! issquare(n^2 + k*(k+1)/2), k++); k;} \\ Michel Marcus, Nov 20 2013
  • Python
    import math
    for n in range(77):
      n2 = n*n
      y=1
      for k in range(1,10000001):
        sum = n2 + k*(k+1)//2
        r = int(math.sqrt(sum))
        if r*r == sum:
          print(str(k), end=',')
          y=0
          break
      if y: print('-', end=',')
    
Showing 1-10 of 17 results. Next