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

A338939 a(n) is the number of partitions n = a + b such that a*b is a perfect square.

Original entry on oeis.org

0, 1, 0, 1, 1, 1, 0, 1, 0, 3, 0, 1, 1, 1, 1, 1, 1, 1, 0, 3, 0, 1, 0, 1, 2, 3, 0, 1, 1, 3, 0, 1, 0, 3, 1, 1, 1, 1, 1, 3, 1, 1, 0, 1, 1, 1, 0, 1, 0, 5, 1, 3, 1, 1, 1, 1, 0, 3, 0, 3, 1, 1, 0, 1, 4, 1, 0, 3, 0, 3, 0, 1, 1, 3, 2, 1, 0, 3, 0, 3, 0, 3, 0, 1, 4, 1, 1, 1, 1, 3, 1, 1, 0, 1, 1, 1, 1, 1, 0, 5
Offset: 1

Views

Author

Hein van Winkel, Nov 16 2020

Keywords

Comments

Number of ways to regroup the unit squares of a rectangle with semiperimeter n into a square.
a(n) > 0 for n in A337140.

Examples

			n = 10 = 1 + 9 = 2 + 8 = 5 + 5 with 1*9 = 3^2 and 2*8 = 4^2 and 5*5 = 5^2. Then a(10) = 3. Also 10 = 2^1 * 5^1. So t=1, a_1=1 and a(n) = A = 2*1+1 = 3.
		

Crossrefs

Programs

  • Maple
    A338939:=n->map[fold=(`+`,0)](i->if(issqr(i*(n-i)),1,0),[$1..1/2*n]); seq(A338939(n),n=1..100); # Felix Huber, Oct 02 2024
  • Mathematica
    a[n_] := Count[IntegerPartitions[n, {2}], ?(IntegerQ @ Sqrt[Times @@ #] &)]; Array[a, 100] (* _Amiram Eldar, Nov 22 2020 *)
  • PARI
    a(n)=my(c=0);for(i=1,n-1,if((2*i<=n)&&issquare(i*(n-i)),c++));c
    for(n=1,100,print1(a(n),", ")) \\ Derek Orr, Nov 18 2020
    
  • PARI
    a(n) = sum(i=1, n-1, (2*i<=n) && issquare(i*(n-i))); \\ Michel Marcus, Dec 21 2020
    
  • PARI
    first(n) = {my(res = vector(n)); for(i = 1, n, d = divisors(i^2); for(i = (#d + 1)\2, #d, c = d[i] + d[#d + 1 - i]; if(c <= n, res[c]++ , next(2) ) ) ); res } \\ David A. Corneth, Dec 21 2020
    
  • Python
    from sympy.abc import x,y
    from sympy.solvers.diophantine.diophantine import diop_quadratic
    def A338939(n): return len(diop_quadratic(x*(n-x)-y**2))>>2 # Chai Wah Wu, Aug 21 2024

Formula

Let n = 2^t * p_1^a_1 * p_2^a_2 * ... * p_r^a_r * q_1^b_1 * q_2^b_2 *...* q_s^b_s with t >= 0, a_i >= 0 for i = 1..r, where p_i == 1 (mod 4) and q_j == -1 (mod 4) for j = 1..s. Further, let A = (2a_1 + 1)*(2a_2 + 1)*...*(2a_r + 1). Then a(n) = (A-1)/2 for odd n and a(n) = A for even n.
a(n) = A338940(n) / A115878(n).

A115879 a(n) is the least positive x satisfying the Diophantine equation x^2=y(y+n). a(n)=0 if there are no solutions.

Original entry on oeis.org

0, 0, 2, 0, 6, 4, 12, 3, 6, 12, 30, 8, 42, 24, 4, 6, 72, 12, 90, 24, 10, 60, 132, 5, 30, 84, 18, 48, 210, 8, 240, 12, 22, 144, 6, 24, 342, 180, 26, 15, 420, 20, 462, 120, 12, 264, 552, 7, 84, 60, 34, 168, 702, 36, 24, 21, 38, 420, 870, 16, 930, 480, 8, 24, 36, 44
Offset: 1

Views

Author

Giovanni Resta, Feb 02 2006

Keywords

Examples

			a(15)=4 since the solutions (x,y) to x^2=y(y+15) are (4,1), (10,5), (18, 12) and (56, 49). The least x values is 4, from (x,y)=(4,1).
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local q;
      q:= max(select(t -> t^2 < n^2 and n^2/t - t mod 4 = 0, numtheory:-divisors(n^2)));
      if q = -infinity then 0 else (n^2/q - q)/4 fi;
    end proc:
    map(f, [$1..100]); # Robert Israel, Aug 21 2025
  • Python
    from itertools import takewhile
    from collections import deque
    from sympy import divisors
    def A115879(n): return -(a:=next(iter(deque((d for d in takewhile(lambda d:d>2 # Chai Wah Wu, Aug 21 2024

A115880 Largest positive x satisfying the Diophantine equation x^2 = y*(y+n), a(n)=0 if there are no solutions.

Original entry on oeis.org

0, 0, 2, 0, 6, 4, 12, 3, 20, 12, 30, 8, 42, 24, 56, 15, 72, 40, 90, 24, 110, 60, 132, 35, 156, 84, 182, 48, 210, 112, 240, 63, 272, 144, 306, 80, 342, 180, 380, 99, 420, 220, 462, 120, 506, 264, 552, 143, 600, 312, 650, 168, 702, 364, 756, 195, 812, 420, 870
Offset: 1

Views

Author

Giovanni Resta, Feb 02 2006

Keywords

Comments

Notice that x^2 = y*(y+n) is equivalent to (n+2*y+2*x)*(n+2*y-2*x) = n^2. We take the factorization of n^2 into two factors congruent mod 4 where one is as small as possible and the other is as large as possible. For n == 0 mod 4 the factors are 4 and n^2/4, for n == 2 mod 4 they are 2 and n^2/2, for n odd they are 1 and n^2. - Robert Israel, Jun 27 2014

Examples

			a(15)=56 since the solutions (x,y) to x^2=y(y+15) are (4,1), (10,5), (18, 12) and (56, 49). The largest x is 56, from (x,y)=(56,49).
		

Crossrefs

Programs

  • Mathematica
    Table[Max[x/.Solve[{x^2==y(y+n),x>0},{x,y},Integers]],{n,1,100}]/.x->0 (* Vaclav Kotesovec, Jun 26 2014 *)
  • Python
    def A115880(n):
        a, b = divmod(n,4)
        return (a**2-1,(c:=a<<1)*(c+1),c*(a+1),c*(c+3)+2)[b] # Chai Wah Wu, Aug 21 2024

Formula

Empirical g.f.: x^3*(x^9-2*x^6-3*x^5-6*x^4-4*x^3-6*x^2-2) / ((x-1)^3*(x+1)^3*(x^2+1)^3). - Colin Barker, Jun 26 2014
a(4*j) = j^2 - 1,
a(4*j+1) = 4*j^2+2*j,
a(4*j+2) = 2*j^2+2*j,
a(4*j+3) = 4*j^2+6*j+2. (see Comments) - Robert Israel, Jun 27 2014

A115881 a(n) is the largest positive y satisfying the Diophantine equation x^2=y(y+n). a(n)=0 if there are no solutions.

Original entry on oeis.org

0, 0, 1, 0, 4, 2, 9, 1, 16, 8, 25, 4, 36, 18, 49, 9, 64, 32, 81, 16, 100, 50, 121, 25, 144, 72, 169, 36, 196, 98, 225, 49, 256, 128, 289, 64, 324, 162, 361, 81, 400, 200, 441, 100, 484, 242, 529, 121, 576, 288, 625, 144, 676, 338, 729, 169, 784, 392, 841, 196
Offset: 1

Views

Author

Giovanni Resta, Feb 02 2006

Keywords

Comments

The corresponding least y is given by A067721(n).

Examples

			a(15)=49, since the solutions (x,y) to x^2=y(y+15) are (4,1), (10,5), (18, 12) and (56, 49). The largest y is 49, from (x,y)=(56,49).
		

Crossrefs

Programs

  • Mathematica
    Table[Max[y/.Solve[{x^2==y*(y+n),y>0},{x,y},Integers]],{n,1,100}]/.y->0 (* Vaclav Kotesovec, Jun 26 2014 *)
  • Python
    def A115881(n):
        a, b = divmod(n,4)
        return ((c:=a**2)-(a<<1)+1,(d:=c<<2),c<<1,d+(a<<2)+1)[b] # Chai Wah Wu, Aug 21 2024

Formula

Empirical g.f.: -x^3*(x^9+x^8+2*x^7+4*x^6+x^5+6*x^4+2*x^3+4*x^2+1) / ((x-1)^3*(x+1)^3*(x^2+1)^3). - Colin Barker, Jun 26 2014
From empirical g.f.: a(n) = 1/2 - n/2 + 11*n^2/64 + (1/4 - 1/32*n^2) * (2*floor(n/4) + 2*floor((n+1)/4) - n + 1) + (1/4 - 5/64*n^2)*(-1)^n. - Vaclav Kotesovec, Jun 26 2014
From Chai Wah Wu, Aug 21 2024: (Start)
a(4*j) = j^2 - 2*j + 1,
a(4*j+1) = 4*j^2,
a(4*j+2) = 2*j^2,
a(4*j+3) = 4*j^2+4*j+1 (see A115880).
(End)

A338940 a(n) is the number of solutions to the Diophantine equation p * x * (x + n) = y^2 with p = a*b a perfect square and a+b = n.

Original entry on oeis.org

0, 0, 0, 0, 1, 1, 0, 1, 0, 3, 0, 1, 1, 1, 4, 2, 1, 2, 0, 3, 0, 1, 0, 4, 4, 3, 0, 1, 1, 12, 0, 3, 0, 3, 4, 2, 1, 1, 4, 12, 1, 4, 0, 1, 7, 1, 0, 7, 0, 10, 4, 3, 1, 3, 4, 4, 0, 3, 0, 12, 1, 1, 0, 4, 16, 4, 0, 3, 0, 12, 0, 7, 1, 3, 14, 1, 0, 12, 0, 21, 0, 3, 0, 4, 16, 1, 4, 4, 1, 21, 4, 1, 0, 1, 4, 10, 1, 2, 0, 10
Offset: 1

Views

Author

Hein van Winkel, Nov 16 2020

Keywords

Comments

Related to Heron triangles with a partition point on a side of length n where the incircle is tangent. Some partitions correspond to a finite number of Heron triangles. The numbers a(n) in this sequence are the numbers of Heron triangles that match these 'finite' partitions.

Examples

			n = 25 = 5 + 20 = 9 + 16 gives 100 * x * (x + 25) = y^2 or 144 * x * (x + 25) = y^2 or 144 * x * (x + 25) = y^2. And the solutions are (x,y) = (144,1560) or (20,300) or (144,1872) or (20,360).
		

Crossrefs

Formula

Let n = 2^t * p_1^a_1 * p_2^a_2 *...* p_r^a_r * q_1^b_1 * q_2^b_2 *...* q_s^b_s with t>=0, a_i>=0 for i=1..r, where p_i == 1 (mod 4) for i=1..r and q_j = -1 (mod 4) for j=1..s.
Further let A = (2a_1 + 1) * (2a_2 + 1) *...* (2a_r + 1) and B = A * (2b_1 + 1) * (2b_2 + 1) *...* (2b_s + 1).
Then a(n) = (A-1) * (B-1) / 4 for t = 0 and a(n) = A * (B-1) / 2 for t = 1 AND t = 2 and a(n) = (2*t - 3) * A * (B+1) / 2 for t > 2.
a(n) = A338939(n) * A115878(n).

A181643 a(n) is the smallest value such that a(n)*[a(n)+n]*[a(n)+n+n]=y^2 is a perfect square.

Original entry on oeis.org

0, 0, 0, 0, 40, 6, 18, 0, 0, 0, 0, 0, 0, 4, 10, 0, 0, 0, 0, 5, 7, 0, 0, 1, 0, 0, 0, 72, 0, 15, 0, 0, 0, 128, 0, 0, 0, 0, 936, 0, 800, 0, 0, 0, 360, 196, 0, 0, 0, 0, 0, 0, 0, 54
Offset: 1

Views

Author

Carmine Suriano, Nov 03 2010, corrected Nov 10 2010

Keywords

Comments

For a given n there is more than one solution.

Examples

			a(5)=40 since 40*(40+5)*(40+5+5)=40*45*50=90000=300^2
		

Crossrefs

A181646 y(n) is the corresponding value of a(n) in sequence A181643. For a given n it is the minimum value such that a(n)*[a(n)+n]*[a(n)+n+n]=y*y.

Original entry on oeis.org

0, 0, 0, 300, 36, 120, 0, 0, 0, 0, 0, 0, 48, 100, 0, 0, 0, 0, 75, 98, 0, 0, 35, 0, 0, 0, 960, 0, 225, 0, 0, 0, 2016, 0, 0, 0, 0, 30420, 0, 24360, 0, 0, 0, 8100, 3696, 0, 0, 0, 0, 0, 0, 0, 972
Offset: 1

Views

Author

Carmine Suriano, Nov 03 2010, corrected Nov 10 2010

Keywords

Examples

			y(5)=300 since A181643(5)=40 and 40*(40+5)*(40+5+5)=40*45*50=90000=300*300
		

Crossrefs

A173636 Number of positive solutions of equation x(x+n)=y*y.

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 4, 2, 1, 2, 1, 1, 4, 1, 1, 4, 2, 1, 3, 1, 1, 4, 1, 3, 4, 1, 4, 2, 1, 1, 4, 4, 1, 4, 1, 1, 7, 1, 1, 7, 2, 2, 4, 1, 1, 3, 4, 4, 4, 1, 1, 4, 1, 1, 7, 4, 4, 4, 1, 1, 4, 4, 1, 7, 1, 1, 7, 1, 4, 4
Offset: 0

Views

Author

Carmine Suriano, Nov 23 2010

Keywords

Comments

The solution x=y=0 is not counted.
Same as A115878 except for a(0). - Georg Fischer, Oct 12 2018

Examples

			a(9)=2 since x(x+9)=y*y has 2 solutions: x=3, y=6 and x=16, y=20.
		

Crossrefs

Programs

  • Mathematica
    Join[{0}, Table[Length[{ToRules[Reduce[x (x + n) == y^2 && x > 0 && y > 0, {x, y}, Integers]]}], {n, 100}]]

Formula

a(n) = A176835(n)-1. - R. J. Mathar, Nov 23 2010

A181744 Numbers n such that x(x+n)=y*y has one and only one positive integer solution (x,y).

Original entry on oeis.org

3, 5, 6, 7, 8, 10, 11, 12, 13, 14, 17, 19, 20, 22, 23, 26, 28, 29, 31, 34, 37, 38, 41, 43, 44, 46, 47, 52, 53, 58, 59, 61, 62, 67, 68, 71, 73, 74, 76, 79, 82, 83, 86, 89, 92, 94, 97, 101, 103, 106, 107, 109, 113, 116, 118, 122, 124, 127, 131, 134, 137, 139, 142, 146, 148
Offset: 1

Views

Author

Carmine Suriano, Nov 08 2010

Keywords

Comments

The sequence contains all primes and their doubles and quadruples (except 2 and 4).

Examples

			118 belongs to the sequence since 1682*(1682+118)=1682*1800=1740^2
		

Crossrefs

Extensions

Name corrected by Robert Israel, Mar 04 2016
Showing 1-9 of 9 results.