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

A084703 Squares k such that 2*k+1 is also a square.

Original entry on oeis.org

0, 4, 144, 4900, 166464, 5654884, 192099600, 6525731524, 221682772224, 7530688524100, 255821727047184, 8690408031080164, 295218051329678400, 10028723337177985444, 340681375412721826704, 11573138040695364122500, 393146012008229658338304, 13355391270239113019379844
Offset: 0

Views

Author

Amarnath Murthy, Jun 08 2003

Keywords

Comments

With the exception of 0, a subsequence of A075114. - R. J. Mathar, Dec 15 2008
Consequently, A014105(k) is a square if and only if k = a(n). - Bruno Berselli, Oct 14 2011
From M. F. Hasler, Jan 17 2012: (Start)
Bisection of A079291. The squares 2*k+1 are given in A055792.
A204576 is this sequence written in binary. (End)
a(n+1), n >= 0, is the perimeter squared (x(n) + y(n) + z(n))^2 of the ordered primitive Pythagorean triple (x(n), y(n) = x(n) + 1, z(n)). The first two terms are (x(0)=0, y(0)=1, z(0)=1), a(1) = 2^2, and (x(1)=3, y(1)=4, z(1)=5), a(2) = 12^2. - George F. Johnson, Nov 02 2012

Crossrefs

Cf. similar sequences with closed form ((1 + sqrt(2))^(4*r) + (1 - sqrt(2))^(4*r))/8 + k/4: this sequence (k=-1), A076218 (k=3), A278310 (k=-5).

Programs

  • Magma
    [4*Evaluate(ChebyshevU(n), 3)^2: n in [0..30]]; // G. C. Greubel, Aug 18 2022
    
  • Mathematica
    b[n_]:= b[n]= If[n<2, n, 34*b[n-1] -b[n-2] +2]; (* b=A001110 *)
    a[n_]:= 4*b[n]; Table[a[n], {n, 0, 30}]
    4*ChebyshevU[Range[-1,30], 3]^2 (* G. C. Greubel, Aug 18 2022 *)
  • SageMath
    [4*chebyshev_U(n-1, 3)^2 for n in (0..30)] # G. C. Greubel, Aug 18 2022

Formula

a(n) = 4*A001110(n) = A001542(n)^2.
a(n+1) = A001652(n)*A001652(n+1) + A046090(n)*A046090(n+1) = A001542(n+1)^2. - Charlie Marion, Jul 01 2003
a(n) = A001653(k+n)*A001653(k-n) - A001653(k)^2, for k >= n >= 0; e.g. 144 = 5741*5 - 169^2. - Charlie Marion, Jul 16 2003
G.f.: 4*x*(1+x)/((1-x)*(1-34*x+x^2)). - R. J. Mathar, Dec 15 2008
a(n) = A079291(2n). - M. F. Hasler, Jan 16 2012
From George F. Johnson, Nov 02 2012: (Start)
a(n) = ((17+12*sqrt(2))^n + (17-12*sqrt(2))^n - 2)/8.
a(n+1) = 17*a(n) + 4 + 12*sqrt(a(n)*(2*a(n) + 1)).
a(n-1) = 17*a(n) + 4 - 12*sqrt(a(n)*(2*a(n) + 1)).
a(n-1)*a(n+1) = (a(n) - 4)^2.
2*a(n) + 1 = (A001541(n))^2.
a(n+1) = 34*a(n) - a(n-1) + 8 for n>1, a(0)=0, a(1)=4.
a(n+1) = 35*a(n) - 35*a(n-1) + a(n-2) for n>0, a(0)=0, a(1)=4, a(2)=144.
a(n)*a(n+1) = (4*A029549(n))^2.
a(n+1) - a(n) = 4*A046176(n).
a(n) + a(n+1) = 4*(6*A029549(n) + 1).
a(n) = (2*A001333(n)*A000129(n))^2.
Limit_{n -> infinity} a(n)/a(n-r) = (17+12*sqrt(2))^r. (End)
Empirical: a(n) = A089928(4*n-2), for n > 0. - Alex Ratushnyak, Apr 12 2013
a(n) = 4*A001109(n)^2. - G. C. Greubel, Aug 18 2022
Product_{n>=2} (1 - 4/a(n)) = sqrt(2)/3 + 1/2 (Koshy, 2022, section 3, p. 19). - Amiram Eldar, Jan 23 2025

Extensions

Edited and extended by Robert G. Wilson v, Jun 15 2003

A220185 Numbers n such that n^2 + n(n+1) is an oblong number (A002378).

Original entry on oeis.org

0, 10, 348, 11830, 401880, 13652098, 463769460, 15754509550, 535189555248, 18180690368890, 617608282987020, 20980500931189798, 712719423377466120, 24211479893902658290, 822477596969312915748, 27940026817062736477150, 949138434183163727307360
Offset: 1

Views

Author

Alex Ratushnyak, Apr 12 2013

Keywords

Comments

Also numbers n such that the sum of the hexagonal numbers H(n) and H(n+1) is equal to m^2 + (m+1)^2 for some m. - Colin Barker, Dec 10 2014
Also nonnegative integers x in the solutions to 4*x^2-2*y^2+2*x-2*y = 0, the corresponding values of y being A251867. - Colin Barker, Dec 10 2014

Examples

			a(3) = A089928(7) = 348.
		

Crossrefs

Cf. A002378, A014105 (n^2 + n(n+1)), A029546, A084703 (numbers n such that n^2 + n(n+1) is a square).

Programs

  • C
    #include 
    #include 
    typedef unsigned long long U64;
    U64 rootPronic(U64 a) {
        U64 sr = 1L<<31, s, b;
        if (a < sr*(sr+1)) {
              sr>>=1;
              while (a < sr*(sr+1))  sr>>=1;
        }
        for (b = sr>>1; b; b>>=1) {
                s = sr+b;
                if (a >= s*(s+1))  sr = s;
        }
        return sr;
    }
    int main() {
      U64 a, n, r, t;
      for (n=0; n < (1L<<31); n++) {
        a = (n*(n+1)) + n*n;
        t = rootPronic(a);
        if (a == t*(t+1))  printf("%llu\n", n);
      }
    }
    
  • Magma
    [Floor(((1+Sqrt(2))^(4*n-3)+(1-Sqrt(2))^(4*n-3)-2)/8): n in [1..20]]; // Vincenzo Librandi, Sep 08 2015
  • Maple
    f:= gfun:-rectoproc({a(n)=35*(a(n-1)-a(n-2))+a(n-3),a(1)=0,a(2)=10,a(3)=348},a(n),remember):
    map(f, [$1..50]); # Robert Israel, Sep 06 2015
  • Mathematica
    LinearRecurrence[{35, - 35, 1}, {0, 10, 348}, 20] (* Vincenzo Librandi, Sep 06 2015 *)
  • PARI
    concat(0, Vec(2*x^2*(5-x)/((1-x)*(1-34*x+x^2))+O(x^100))) \\ Colin Barker, Dec 10 2014
    

Formula

For n>1, a(n) = A089928(n*4-5).
From Bruno Berselli, Apr 12 2013: (Start)
G.f.: 2*x^2*(5-x)/((1-x)*(1-34*x+x^2)).
a(n) = ((1+sqrt(2))^(4n-3)+(1-sqrt(2))^(4n-3)-2)/8.
a(n+2) = 10*A029546(n)-2*A029546(n-1). (End)
a(n) = 35*a(n-1)-35*a(n-2)+a(n-3). - Colin Barker, Dec 10 2014
a(n) = A251867(n) - A001542(n-1)^2. - Alexander Samokrutov, Sep 05 2015

Extensions

More terms from Bruno Berselli, Apr 12 2013

A215099 a(0)=0, a(1)=1, a(n) = least k>a(n-1) such that k+a(n-2) is prime.

Original entry on oeis.org

0, 1, 2, 4, 5, 7, 8, 10, 11, 13, 18, 24, 25, 29, 34, 38, 39, 41, 44, 48, 53, 55, 56, 58, 71, 73, 78, 84, 85, 89, 94, 102, 103, 109, 120, 124, 131, 133, 138, 144, 145, 149, 162, 164, 169, 173, 178, 180, 181, 187, 192, 196, 197, 201
Offset: 0

Views

Author

Alex Ratushnyak, Aug 03 2012

Keywords

Comments

For n>0 and (n mod 4)<2, a(n) is odd.
Same definition, but k+a(n-2) is a
Fibonacci number: A006498 except first two terms,
Lucas number: A000045 except first two terms,
Pell number: A089928(n-1),
Jacobsthal number: A215095,
factorial: A215096,
square: A194274,
cube: A215097,
triangular number: A011848(n+2),
oblong number: A215098.
Example of a related sequence definition: a(0)=0, a(1)=1, a(n) = least k>a(n-1) such that k+a(n-2) is a cube.

Crossrefs

Cf. A062042: a(1) = 2, a(n) = least k>a(n-1) such that k+a(n-1) is a prime.

Programs

  • PARI
    first(n) = my(res = vector(n, i, i-1), k); for(x=3, n, k=res[x-1]+1; while(!isprime(k+res[x-2]), k++); res[x]=k); res \\ Iain Fox, Apr 22 2019 (corrected by Iain Fox, Apr 25 2019)
  • Python
    from sympy import prime
    prpr = 0
    prev = 1
    for n in range(77):
        print(prpr, end=', ')
        b = c = 0
        while c<=prev:
            c = prime(b+1) - prpr
            b+=1
        prpr = prev
        prev = c
    

A215095 a(0)=0, a(1)=1, a(n) = least k>a(n-1) such that k+a(n-2) is a Jacobsthal number.

Original entry on oeis.org

0, 1, 3, 4, 8, 17, 35, 68, 136, 273, 547, 1092, 2184, 4369, 8739, 17476, 34952, 69905, 139811, 279620, 559240, 1118481, 2236963, 4473924, 8947848, 17895697, 35791395, 71582788, 143165576, 286331153, 572662307, 1145324612, 2290649224, 4581298449, 9162596899
Offset: 0

Views

Author

Alex Ratushnyak, Aug 03 2012

Keywords

Comments

Same definition, but k+a(n-2) is a
Fibonacci number: A006498 except first two terms,
Lucas number: A000045 except first two terms,
Pell number: A089928(n-1),
factorial: A215096,
square: A194274,
cube: A215097,
triangular number: A011848(n+2),
oblong number: A215098,
prime number: A215099.
Example of a related sequence definition: a(0)=0, a(1)=1, a(n) = least k>a(n-1) such that k+a(n-2) is a cube.

Crossrefs

Programs

  • Python
    prpr = 0
    prev = 1
    jac = [0]*10000
    for n in range(10000):
        jac[n] = prpr
        curr = prpr*2 + prev
        prpr = prev
        prev = curr
    prpr, prev = 0, 1
    for n in range(1, 44):
        print(prpr, end=', ')
        b = c = 0
        while c<=prev:
            c = jac[b] - prpr
            b+=1
        prpr = prev
        prev = c

Formula

Conjecture: G.f. (x+2*x^2)/(1-x-x^2-x^3-2*x^4). - David Scambler, Aug 06 2012
Showing 1-4 of 4 results.