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.

Previous Showing 11-16 of 16 results.

A030194 a(0)=0; a(n) is the smallest m such that m - a(i) is not a triangular number for any i < n.

Original entry on oeis.org

0, 2, 4, 9, 11, 13, 18, 20, 22, 27, 29, 31, 51, 53, 60, 62, 69, 71, 85, 94, 101, 103, 110, 112, 141, 143, 150, 152, 159, 161, 168, 170, 211, 220, 229, 245, 267, 269, 292, 299, 301, 308, 310, 317, 319, 326, 348, 357, 359, 366, 368, 375, 418, 427, 456, 458, 499, 508
Offset: 0

Views

Author

Keywords

References

  • A. Sárközy. On the difference sets of sequences of integers II, Ann. Univ. Sci. Budapest. Eotvos Sect. Math. 21(1978), 45-53.

Crossrefs

Programs

  • PARI
    a030194(upto)={my(a=vector(upto));a[1]=2;for(n=2,upto,for(m=a[n-1]+1,oo,my(f=1);for(j=1,n,if(ispolygonal(m-a[j],3),f=0;break));if(f,a[n]=m;break)));concat([0],a)};
    a030194(57) \\ Hugo Pfoertner, Oct 05 2020

Extensions

Name edited by Michel Marcus, Oct 05 2020
More terms from Hugo Pfoertner, Oct 05 2020

A225785 Numbers n such that triangular(n) + triangular(2*n) is a triangular number.

Original entry on oeis.org

0, 12, 84, 3960, 27144, 1275204, 8740380, 410611824, 2814375312, 132215732220, 906220110180, 42573055163112, 291800061102744, 13708391546789940, 93958713454973484, 4414059505011197664, 30254413932440359200, 1421313452222058857964
Offset: 1

Views

Author

Alex Ratushnyak, May 16 2013

Keywords

Comments

Equivalently, numbers n such that oblong(n) + oblong(2*n) is an oblong number, where oblong(n) = A002378(n) = n*(n+1).
Also, x values in the equation A147875(x) = A000217(y) - see Ralf Stephan in Program lines. - Bruno Berselli, May 18 2013
Also, numbers m such that 2*m+1 and 10*m+1 are both squares. - Bruno Berselli, Mar 03 2016

Examples

			12*13/2 + 24*25/2 = 27*28/2, so 12 is in the sequence.
		

Crossrefs

Cf. A224419 (numbers n such that triangular(n) + triangular(2*n) is a square).
Cf. A011916 (numbers n such that triangular(2*n) - triangular(n) is a triangular number).
Cf. A225786 (numbers n such that oblong(2*n) + oblong(n) is a square).
Cf. A225839 (triangular numbers of the form triangular(x) + triangular(2*x)).

Programs

  • C
    #include 
    #include 
    int main() {
      unsigned long long i, s, t;
      for (i = 0; i< (1ULL<<31); i++) {
        s = 2*i*(2*i+1) + i*(i+1);
        t = sqrt(s);
        if (s==t*(t+1)) printf("%llu, ", i);
      }
      return 0;
    }
    
  • Mathematica
    CoefficientList[Series[12 x (1 + 6 x + x^2)/((1 - x) (1 - 18 x + x^2) (1 + 18 x + x^2)), {x, 0, 20}], x] (* Bruno Berselli, May 18 2013 *)
    LinearRecurrence[{1,322,-322,-1,1},{0,12,84,3960,27144},20] (* Harvey P. Dale, Apr 08 2021 *)
  • PARI
    for(n=1,10^9,t=n*(5*n+3)/2;x=sqrtint(2*t);if(t==x*(x+1)/2,print(n))) /* Ralf Stephan, May 17 2013 */

Formula

G.f.: 12*x*(1+6*x+x^2)/((1-x)*(1-18*x+x^2)(1+18*x+x^2)). [Bruno Berselli, May 18 2013]
a(n) = (1/20)*((3+(-1)^n*sqrt(5))*(2-sqrt(5))^(4*floor(n/2))+(3-(-1)^n*sqrt(5))*(2+sqrt(5))^(4*floor(n/2))-6). [Bruno Berselli, May 18 2013]
a(2*n) = (Fibonacci(6*n-3)^2 + Lucas(6*n-3)*Fibonacci(6*n-1))/2. - Greg Dresden, Sep 24 2023

Extensions

More terms from Bruno Berselli, May 18 2013

A232177 Least positive k such that triangular(n) + triangular(k) is a square.

Original entry on oeis.org

1, 2, 1, 2, 3, 1, 5, 6, 7, 8, 9, 5, 2, 12, 13, 1, 15, 16, 17, 3, 5, 20, 2, 22, 23, 8, 4, 26, 12, 3, 29, 30, 1, 5, 33, 34, 4, 36, 37, 15, 6, 29, 22, 5, 43, 19, 45, 7, 15, 48, 6, 50, 11, 52, 8, 41, 22, 7, 57, 58, 59, 9, 26, 62, 8, 64, 19, 66, 10, 68, 5, 9, 71, 2
Offset: 0

Views

Author

Alex Ratushnyak, Nov 20 2013

Keywords

Comments

Triangular(k) = A000217(k) = k*(k+1)/2.
For n>1, a(n) <= n-1, because with k=n-1: triangular(n) + triangular(k) = n*(n+1)/2 + (n-1)*n/2 = n^2.

Crossrefs

Cf. A082183 (least k>0 such that triangular(n) + triangular(k) is a triangular number).
Cf. A212614 (least k>1 such that triangular(n) * triangular(k) is a triangular number).
Cf. A232176 (least k>0 such that n^2 + triangular(k) is a square).
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
    Table[k = 1; tri = n*(n + 1)/2; While[k <= n+2 && ! IntegerQ[Sqrt[tri + k*(k + 1)/2]], k++]; k, {n, 0, 100}] (* T. D. Noe, Nov 21 2013 *)
  • Python
    import math
    for n in range(77):
      tn = n*(n+1)//2
      for k in range(1, n+9):
        sum = tn + k*(k+1)//2
        r = int(math.sqrt(sum))
        if r*r == sum:
          print(str(k), end=',')
          break

A239969 Least positive k such that triangular(n) + triangular(n+k) is a triangular number (A000217), or -1 if no such k exists.

Original entry on oeis.org

2, 5, 1, 3, 20, 2, 4, 16, 3, 5, 31, 4, 6, 119, 5, 7, 16, 6, 8, 103, 7, 9, 2, 8, 10, 26, 9, 11, 464, 10, 12, 1, 11, 13, 313, 12, 5, 58, 13, 15, 37, 14, 3, 493, 15, 17, 31, 16, 18, 47, 17, 2, 79, 9, 20, 796, 19, 21, 883, 20, 22, 89, 4, 23, 58, 22, 24, 100, 23, 25, 1276
Offset: 3

Views

Author

Alex Ratushnyak, Mar 30 2014

Keywords

Comments

In other words, smallest solution k>0 to 4*k^2 + 8*(k + 1)*n + 8*n^2 + 4*k + 1 = m^2. - Ralf Stephan, Apr 01 2014

Examples

			a(3) = 2 because triangular(3)+triangular(3+2)=21 is a triangular number.
a(5) = 1 because triangular(5)+triangular(5+1)=36 is a triangular number.
In other words, k=a(3)=2 is the smallest positive solution to 4*k^2 + 28*k + 97 = m^2, and k=a(5)=1 is the smallest positive solution to 4*k^2 + 44*k + 241 = m^2.
		

Crossrefs

Programs

  • Haskell
    a239969 n = head [k | k <- [1..],
                          a010054 (a000217 n + a000217 (n + k)) == 1]
    -- Reinhard Zumkeller, Apr 03 2014
  • PARI
    triangular(n) = n*(n+1)/2;
    is_triangular(n) = issquare(8*n+1);
    s=[]; for(n=3, 100, k=1; while(!is_triangular(triangular(n)+triangular(n+k)), k++); s=concat(s, k)); s \\ Colin Barker, Mar 31 2014
    

Extensions

First PROG corrected by Colin Barker, Apr 04 2014

A225844 Least k>0 such that triangular(n) + k*(k+1) is a triangular number.

Original entry on oeis.org

2, 1, 3, 5, 7, 2, 11, 13, 5, 17, 19, 3, 6, 25, 27, 9, 31, 33, 35, 4, 9, 41, 8, 45, 47, 10, 14, 53, 9, 5, 59, 61, 21, 18, 67, 69, 21, 73, 75, 14, 22, 6, 11, 13, 87, 15, 91, 26, 20, 34, 12, 101, 26, 105, 30, 7, 20, 33, 115, 117, 119, 34, 21, 125, 37, 129, 29, 133, 14, 137
Offset: 0

Views

Author

Alex Ratushnyak, May 17 2013

Keywords

Comments

For n>0, a(n) <= 2*n-1, because n*(n+1)/2 + (2*n-1)*2*n = (9*n^2 - 3*n)/2 = 3*n*(3*n-1)/2 = triangular(3*n-1).
The subsequence with terms less than 2*n-1 begins: 2, 5, 3, 6, 9, 4, 9, 8, 10, 14, 9, 5, 21, 18, 21, 14, 22, 6, 11, 13, 15, ...
The sequence of n's such that a(n) < 2*n-1 begins: 5, 8, 11, 12, 15, 19, 20, 22, 25, 26, ...

Crossrefs

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

Programs

  • Maple
    a:= proc(n) option remember; local w, k; w:= n*(n+1)/2;
          for k while not issqr(8*(w+k*(k+1))+1) do od; k
        end:
    seq(a(n), n=0..69);  # Alois P. Heinz, Nov 13 2024
  • Mathematica
    lktrno[n_]:=Module[{t=(n(n+1))/2,k=1},While[!IntegerQ[(Sqrt[ 8(t+k(k+1))+1]-1)/2],k++];k]; Array[lktrno,70,0] (* Harvey P. Dale, Aug 19 2014 *)
  • PARI
    a(n)=for(k=1,2*n,t=n*(n+1)/2+k*(k+1);x=sqrtint(2*t);if(t==x*(x+1)/2,return(k))) /* from Ralf Stephan */
  • Python
    def isTriangular(a):
        sr = 1 << (a.bit_length() >> 1)
        a += a
        while a < sr*(sr+1):  sr>>=1
        b = sr>>1
        while b:
          s = sr+b
          if a >= s*(s+1):  sr = s
          b>>=1
        return (a==sr*(sr+1))
    n = tn = 0
    while 1:
      for m in range(1, 1000000000):
        if isTriangular(tn + m*(m+1)): break
      print(m, end=', ')
      n += 1
      tn += n
    

A332554 a(n) = (n*(n+1)/2)/Q(n) - (Q(n)+1)/2, where Q(n) = A332547(n).

Original entry on oeis.org

2, 5, 9, 3, 5, 27, 10, 6, 8, 20, 24, 9, 11, 21, 135, 12, 14, 35, 6, 15, 17, 90, 12, 18, 20, 7, 54, 21, 23, 495, 42, 24, 26, 19, 69, 27, 29, 44, 161, 30, 32, 80, 13, 33, 35, 374, 45, 17, 38, 14, 99, 39, 10, 26, 65, 42, 44, 110, 114, 45, 47, 85, 153, 11
Offset: 2

Views

Author

N. J. A. Sloane, Feb 21 2020, following a suggestion from Michael J. Collins, Feb 19 2020

Keywords

Comments

Michael J. Collins showed that this is an upper bound on A082183 (see Comments in A082183).
Previous Showing 11-16 of 16 results.