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.

User: Herbert Kociemba

Herbert Kociemba's wiki page.

Herbert Kociemba has authored 67 sequences. Here are the ten most recent ones:

A354672 Numbers x with property that x is not the smallest possible value in the Pellian equation x^2 - D*y^2 = 1 with D = squarefree part of (x^2 - 1).

Original entry on oeis.org

7, 17, 26, 31, 49, 71, 97, 99, 127, 161, 199, 241, 244, 287, 337, 362, 391, 449, 485, 511, 577, 647, 721, 799, 846, 881, 967, 1057, 1151, 1249, 1351, 1457, 1567, 1681, 1799, 1921, 2024, 2047, 2177, 2311, 2449, 2591, 2737, 2887, 2889, 3041, 3199, 3361, 3363
Offset: 1

Author

Herbert Kociemba, Jun 02 2022

Keywords

Comments

Alternatively numbers k such that A033314(k) <> A068310(k).
Conjecture: this sequence is equivalent to the sorted distinct values of cos(m*arccos(k)), where m and k are integers greater than 1. - Jennifer Buckley, Apr 23 2024

Examples

			a(2)=17. The squarefree part of 17^2 - 1 = 288 is D = 2. But the smallest possible solution to x^2 - 2*y^2 = 1 is not x = 17 but x = 3 (with y = 2).
15 is not a term: the squarefree part of 15^2 - 1 = 224 is D = 14 and x^2 - 14*y^2 = 1 has indeed the minimal solution x = 15 (and y = 4).
		

Programs

  • Mathematica
    squarefreepart[n_] :=
      Times @@ Power @@@ ({#[[1]], Mod[#[[2]], 2]} & /@ FactorInteger[n]);
    a = {}; NMAX = 3400; dict // Clear;
    For[n = 2, n <= NMAX, n++, s = squarefreepart[n^2 - 1];
    If[ ! IntegerQ[dict[s]], dict[s] = 1, AppendTo[a, n]]]; a

A354713 Number of solutions (n, D) for Pell equation n^2 - D*y^2 = 1 with fixed n.

Original entry on oeis.org

1, 2, 1, 2, 1, 3, 2, 3, 2, 2, 1, 2, 1, 3, 1, 6, 1, 4, 1, 2, 1, 3, 2, 3, 4, 2, 2, 2, 1, 4, 1, 4, 1, 4, 1, 4, 1, 3, 1, 3, 1, 2, 2, 2, 2, 3, 2, 6, 2, 4, 1, 4, 1, 6, 1, 3, 1, 2, 1, 2, 2, 4, 2, 4, 1, 2, 1, 2, 1, 6, 1, 6, 2, 2, 2, 2, 1, 3, 3, 3, 3, 2, 1, 2
Offset: 2

Author

Herbert Kociemba, Jun 04 2022

Keywords

Comments

a(n) can be computed as the number of divisors of the square root of the largest square dividing n^2 - 1.
A067874 gives n with a(n) = 1.

Examples

			a(17) = 6 because there are 6 possible solutions to 17^2 - D*y^2 = 1: 17^2 - 2*12^2 = 1, 17^2 - 8*6^2 = 1, 17^2 - 18*4^2 = 1, 17^2 - 32*3^2 = 1, 17^2 - 72*2^2 = 1 and 17^2 - 288*1^2 = 1. D = 18 is the smallest of the 6 D values, where the (17,y) pair is minimal and hence A033314(17) = 18.
		

Crossrefs

Programs

  • Mathematica
    squarefreepart[n_] := Times @@ Power @@@ ({#[[1]], Mod[#[[2]], 2]} & /@ FactorInteger[n]);
    a[n_] :=  Divisors[Sqrt[(n^2 - 1)/squarefreepart[n^2 - 1]]] // Length; Table[a[n], {n, 2, 85}]
  • PARI
    f(n) = sqrtint(n/core(n)) \\ A000188
    a(n) = numdiv(f(n^2-1)); \\ Michel Marcus, Jun 05 2022

Formula

a(n) = A000005(A000188(n^2-1)).

A344528 a(n) is the number of integer quadrilaterals (up to congruence) with integer side lengths a,b,c,d with n = Max(a,b,c,d) and integer diagonals e,f.

Original entry on oeis.org

0, 0, 0, 2, 2, 1, 5, 7, 8, 5, 7, 13, 14, 11, 16, 31, 20, 14, 19, 33, 26, 26, 24, 67, 43, 39, 53, 62, 36, 53, 40, 94, 72, 48, 73, 77, 64, 60, 94, 122, 58, 75, 68, 106, 109, 81, 62, 195, 114, 113, 140, 151, 87, 129, 143, 235, 154, 97, 92, 266
Offset: 1

Author

Herbert Kociemba, May 22 2021

Keywords

Comments

This sequence is the sum of the sequences A342720 and A342722 which deal with concave and convex quadrilaterals respectively.

Examples

			a(6)=1 because the only integer quadrilateral with longest edge length 6 is a trapezoid with sides a=6, b=5, c=4, d=5 and diagonals e=f=7.
		

Crossrefs

Formula

a(n) = A342720(n) + A342722(n).

A344529 a(n) is the number of integer quadrilaterals (up to congruence) with integer side lengths a,b,c,d with n = Max(a,b,c,d), integer diagonals e,f and integer area.

Original entry on oeis.org

0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 2, 1, 1, 4, 1, 4, 0, 0, 6, 3, 0, 0, 7, 8, 3, 0, 5, 3, 8, 0, 1, 0, 5, 5, 3, 10, 0, 10, 11, 5, 5, 0, 3, 5, 0, 0, 11, 0, 11, 18, 15, 5, 0, 6, 10, 0, 6, 0, 26, 4, 0, 11, 1, 32, 3, 0, 10, 2, 10, 0, 10, 12, 17, 34
Offset: 1

Author

Herbert Kociemba, May 22 2021

Keywords

Comments

This sequence is the sum of the sequences A342721 and A342723 which deal with concave and convex quadrilaterals respectively.

Examples

			a(4)=1 because the smallest possible quadrilateral is a rectangle with a=c=4, b=d=3, e=f=5 and area 12.
		

Crossrefs

Formula

a(n) = A342721(n) + A342723(n).

A342722 a(n) is the number of convex integer quadrilaterals (up to congruence) with integer side lengths a,b,c,d with n=Max(a,b,c,d) and integer diagonals e,f.

Original entry on oeis.org

0, 0, 0, 2, 2, 1, 5, 7, 8, 5, 7, 13, 14, 11, 15, 31, 18, 14, 18, 30, 25, 24, 22, 64, 42, 35, 51, 58, 34, 48, 37, 87, 71, 46, 69, 74, 51, 53, 74, 110, 53, 72, 61, 96, 106, 73, 60, 181, 102, 103, 125, 134, 79, 118, 133, 215, 141, 82, 82, 221
Offset: 1

Author

Herbert Kociemba, Apr 25 2021

Keywords

Comments

Without loss of generality we assume that a is the largest side length and that the diagonal e divides the convex quadrilateral into two triangles with sides a,b,e and c,d,e. The triangle inequality implies e > a-b and abs(e-c) < d < e+c.

Examples

			a(6)=1 because the only convex integer quadrilateral with longest edge length 6 is a trapezoid with sides a=6, b=5, c=4, d=5 and diagonals e=f=7.
		

Crossrefs

Cf. A340858 for trapezoids, A342720 and A342721 for concave integer quadrilaterals, A342723 for convex integer quadrilaterals with integer area.

Programs

  • Mathematica
    an={};
    he[a_,b_,e_]:=1/(2 e) Sqrt[-(a-b-e) (a+b-e) (a-b+e) (a+b+e)];
    paX[e_]:={e,0} (*vertex A coordinate*)
    pbX[a_,b_,e_]:={(-a^2+b^2+e^2)/(2 e),he[a,b,e]}(*vertex B coordinate*)
    pc={0,0};(*vertex C coordinate*)
    pdX[c_,d_,e_]:={(c^2-d^2+e^2)/(2 e),-he[c,d,e]}(*vertex D coordinate*)
    convexQ[{bx_,by_},{dx_,dy_},e_]:=If[(by-dy) e>by dx-bx dy>0,True,False]
    (*define order on tuples*)
    gQ[x_,y_]:=Module[{z=x-y,res=False},Do[If[z[[i]]>0,res=True;Break[],If[z[[i]]<0,Break[]]],{i,1,6}];res]
    (*check if tuple is canonical*)
    canonicalQ[{a_,b_,c_,d_,e_,f_}]:=Module[{x={a,b,c,d,e,f}},If[(gQ[{b,a,d,c,e,f},x]||gQ[{d,c,b,a,e,f},x]||gQ[{c,d,a,b,e,f},x]||gQ[{b,c,d,a,f,e},x]||gQ[{a,d,c,b,f,e},x]||gQ[{c,b,a,d,f,e},x]||gQ[{d,a,b,c,f,e},x]),False,True]]
    Do[cnt=0;
    Do[pa=paX[e];pb=pbX[a,b,e];pd=pdX[c,d,e];
    If[(f=Sqrt[(pb-pd).(pb-pd)];IntegerQ[f])&&convexQ[pb,pd,e]&&canonicalQ[{a,b,c,d,e,f}],cnt++
    (*;Print[{{a,b,c,d,e,f},Graphics[Line[{pa,pb,pc,pd,pa}]]}]*)],
    {b,1,a},{e,a-b+1,a+b-1},{c,1,a},{d,Abs[e-c]+1,Min[a,e+c-1]}];
    AppendTo[an,cnt],{a,1 ,60}
    ]
    an

A342723 a(n) is the number of convex integer quadrilaterals (up to congruence) with integer side lengths a,b,c,d with n=Max(a,b,c,d), integer diagonals e,f and integer area.

Original entry on oeis.org

0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 2, 1, 1, 3, 1, 2, 0, 0, 4, 3, 0, 0, 4, 7, 2, 0, 5, 2, 5, 0, 1, 0, 3, 4, 3, 4, 0, 6, 7, 3, 4, 0, 3, 4, 0, 0, 5, 0, 9, 10, 9, 3, 0, 5, 8, 0, 4, 0, 17, 4, 0, 9, 1, 19, 2, 0, 6, 2, 7, 0, 7, 7, 7, 23, 2, 8, 12, 0, 10, 0, 5, 0, 15, 27
Offset: 1

Author

Herbert Kociemba, Apr 25 2021

Keywords

Comments

Without loss of generality we assume that a is the largest side length and that the diagonal e divides the convex quadrilateral into two triangles with sides a,b,e and c,d,e. The triangle inequality implies e > a-b and abs(e-c) < d < e+c.

Examples

			a(4)=1 is the smallest possible solution and is a rectangle with a=c=4, b=d=3, e=f=5 and area 12. a(24)=4 includes the smallest possible solution with all sides a,b,c,d different and a=24, b=20, c=15, d=7, e=20, f=25 and area 234. Furthermore there are three rectangles with a=24,b=7, a=24,b=10 and a=24,b=18.
		

Crossrefs

Cf. A340858 for trapezoids, A342720 and A342721 for concave integer quadrilaterals, A342722 for convex integer quadrilaterals with arbitrary area.

Programs

  • Mathematica
    an={};
    area[a_,b_,c_,d_,e_,f_]:=1/4 Sqrt[4e^2 f^2-(a^2+c^2-b^2-d^2)^2];
    he[a_,b_,e_]:=1/(2 e) Sqrt[-(a-b-e) (a+b-e) (a-b+e) (a+b+e)];
    paX[e_]:={e,0} (*vertex A coordinate*)
    pbX[a_,b_,e_]:={(-a^2+b^2+e^2)/(2 e),he[a,b,e]}(*vertex B coordinate*)
    pc={0,0};(*vertex C coordinate*)pdX[c_,d_,e_]:={(c^2-d^2+e^2)/(2 e),-he[c,d,e]}(*vertex D coordinate*)
    convexQ[{bx_,by_},{dx_,dy_},e_]:=If[(by-dy) e>by dx-bx dy>0,True,False]
    (*define order on tuples*)
    gQ[x_,y_]:=Module[{z=x-y,res=False},Do[If[z[[i]]>0,res=True;Break[],If[z[[i]]<0,Break[]]],{i,1,6}];res]
    (*check if tuple is canonical*)
    canonicalQ[{a_,b_,c_,d_,e_,f_}]:=Module[{x={a,b,c,d,e,f}},If[(gQ[{b,a,d,c,e,f},x]||gQ[{d,c,b,a,e,f},x]||gQ[{c,d,a,b,e,f},x]||gQ[{b,c,d,a,f,e},x]||gQ[{a,d,c,b,f,e},x]||gQ[{c,b,a,d,f,e},x]||gQ[{d,a,b,c,f,e},x]),False,True]]
    Do[cnt=0;
    Do[pa=paX[e];pb=pbX[a,b,e];pd=pdX[c,d,e];
    If[(f=Sqrt[(pb-pd).(pb-pd)];IntegerQ[f])&&(ar=area[a,b,c,d,e,f]; IntegerQ[ar])&&convexQ[pb,pd,e]&&canonicalQ[{a,b,c,d,e,f}],cnt++
    (*;Print[{{a,b,c,d,e,f,ar},Graphics[Line[{pa,pb,pc,pd,pa}]]}]*)],{b,1,a},{e,a-b+1,a+b-1},{c,1,a},{d,Abs[e-c]+1,Min[a,e+c-1]}];
    AppendTo[an,cnt],{a,1,85}]
    an

A342721 a(n) is the number of concave integer quadrilaterals (up to congruence) with integer side lengths a,b,c,d with n=Max(a,b,c,d), integer diagonals e,f and integer area.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 2, 0, 0, 0, 3, 1, 1, 0, 0, 1, 3, 0, 0, 0, 2, 1, 0, 6, 0, 4, 4, 2, 1, 0, 0, 1, 0, 0, 6, 0, 2, 8, 6, 2, 0, 1, 2, 0, 2, 0, 9, 0, 0, 2, 0, 13, 1, 0, 4, 0, 3, 0, 3, 5, 10, 11
Offset: 1

Author

Herbert Kociemba, Mar 19 2021

Keywords

Comments

Without loss of generality we assume that a is the largest side length and that the diagonal e divides the concave quadrilateral into two triangles with sides a,b,e and c,d,e. Then e < a is a necessary condition for concavity. The triangle inequality further implies e > a-b and abs(e-c) < d < e+c.

Examples

			a(66)=1 because the only concave integer quadrilateral with longest edge length 66 and integer area has sides a=66, b=55, c=12, d=65, diagonals e=55, f=65 and area 1650.
		

Crossrefs

Cf. A340858 for trapezoids, A342720 for concave integer quadrilaterals with arbitrary area.

Programs

  • Mathematica
    an={};
    area[a_,b_,c_,d_,e_,f_]:=(1/4)Sqrt[(4e^2 f^2-(a^2+c^2-b^2-d^2)^2)]
    he[a_,b_,e_]:=(1/(2 e))Sqrt[(-((a-b-e) (a+b-e) (a-b+e) (a+b+e)))];
    paX[e_]:={e,0} (*vertex A coordinate*)
    pbX[a_,b_,e_]:={(-a^2+b^2+e^2)/(2 e),he[a,b,e]}(*vertex B coordinate*)
    pc={0,0};(*vertex C coordinate*)
    pdX[c_,d_,e_]:={(c^2-d^2+e^2)/(2 e),-he[c,d,e]}(*vertex D coordinate*)
    concaveQ[{bx_,by_},{dx_,dy_},e_]:=If[by dx-bx dy<0||by dx-bx dy>(by-dy) e,True,False]
    gQ[x_,y_]:=Module[{z=x-y,res=False},Do[If[z[[i]]>0,res=True;Break[],If[z[[i]]<0,Break[]]],{i,1,4}];res]
    canonicalQ[{a_,b_,c_,d_}]:=Module[{m={a,b,c,d}},If[(gQ[{b,a,d,c},m]||gQ[{d,c,b,a},m]||gQ[{c,d,a,b},m]),False,True]]
    Do[cnt=0;
    Do[pa=paX[e];pb=pbX[a,b,e];pd=pdX[c,d,e];
    If[(f=Sqrt[(pb-pd).(pb-pd)];IntegerQ[f])&&(ar=area[a,b,c,d,e,f]; IntegerQ[ar])&&concaveQ[pb,pd,e]&&canonicalQ[{a,b,c,d}],cnt++
    (*;Print[{{a,b,c,d,e,f,ar},Graphics[Line[{pa,pb,pc,pd,pa}]]}]*)],
    {b,1,a},{e,a-b+1,a-1},{c,1,a},{d,Abs[e-c]+1,Min[a,e+c-1]}];
    AppendTo[an,cnt],{a,1,75}
    ]
    an

A342720 a(n) is the number of concave integer quadrilaterals (up to congruence) with integer side lengths a,b,c,d with n=Max(a,b,c,d) and integer diagonals e,f.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 1, 3, 1, 2, 2, 3, 1, 4, 2, 4, 2, 5, 3, 7, 1, 2, 4, 3, 13, 7, 20, 12, 5, 3, 7, 10, 3, 8, 2, 14, 12, 10, 15, 17, 8, 11, 10, 20, 13, 15, 10, 45, 9, 18, 25, 46, 38, 18, 2, 25, 20, 30, 18, 32, 17, 32, 43
Offset: 1

Author

Herbert Kociemba, Mar 19 2021

Keywords

Comments

Without loss of generality we assume that a is the largest side length and that the diagonal e divides the concave quadrilateral into two triangles with sides a,b,e and c,d,e. Then e < a is a necessary condition for concavity. The triangle inequality further implies e > a-b and abs(e-c) < d < e+c.

Examples

			a(15)=1 because the only concave integer quadrilateral with longest edge length 15 has a=15, b=13, c=13, d=15 and diagonals e=4 and f=24. a(20)=3 because there are three solutions (a,b,c,d,e,f): (20,13,15,18,9,26), (20,13,13,20,11,24) and {20,15,15,20,7,24}.
		

Crossrefs

Cf. A340858 for trapezoids, A342721 for concave integer quadrilaterals with integer area.

Programs

  • Mathematica
    an={};
    he[a_,b_,e_]:=1/(2 e) Sqrt[(-((a-b-e) (a+b-e) (a-b+e) (a+b+e)))]
    paX[e_]:={e,0} (*vertex A coordinate*)
    pbX[a_,b_,e_]:={(-a^2+b^2+e^2)/(2 e),he[a,b,e]}(*vertex B coordinate*)
    pc={0,0};(*vertex C coordinate*)
    pdX[c_,d_,e_]:={(c^2-d^2+e^2)/(2 e),-he[c,d,e]}(*vertex D coordinate*)
    concaveQ[{bx_,by_},{dx_,dy_},e_]:=If[by dx-bx dy<0||by dx-bx dy>(by-dy) e,True,False]
    gQ[x_,y_]:=Module[{z=x-y,res=False},Do[If[z[[i]]>0,res=True;Break[],
      If[z[[i]]<0,Break[]]],{i,1,4}];res]
    canonicalQ[{a_,b_,c_,d_}]:=Module[{m={a,b,c,d}},If[(gQ[{b,a,d,c},m]||gQ[{d,c,b,a},m]||gQ[{c,d,a,b},m]),False,True]]
    Do[cnt=0;
    Do[pa=paX[e];pb=pbX[a,b,e];pd=pdX[c,d,e];
    If[(f=Sqrt[(pb-pd).(pb-pd)];IntegerQ[f])&&concaveQ[pb,pd,e]&&canonicalQ[{a,b,c,d}],cnt++
    (*;Print[{{a,b,c,d,e,f},Graphics[Line[{pa,pb,pc,pd,pa}]]}]*)],
    {b,1,a},{e,a-b+1,a-1},{c,1,a},{d,Abs[e-c]+1,Min[a,e+c-1]}];
    AppendTo[an,cnt],
    {a,1,75}
    ]
    an

A340858 a(n) is the number of integer trapezoids (up to congruence) with integer side lengths a,b,c,d with n=Max(a,b,c,d) and integer diagonals e,f.

Original entry on oeis.org

0, 0, 0, 1, 1, 1, 2, 5, 6, 3, 4, 9, 9, 7, 10, 22, 10, 10, 9, 22, 18, 14, 14, 46, 26, 21, 35, 38, 18, 31, 20, 66, 45, 22, 43, 57, 25, 25, 48, 82, 27, 46, 35, 70, 69, 43, 34, 136, 63, 57, 72, 90, 46, 76, 80, 143, 91, 42, 46, 149, 54, 47, 115, 204, 105
Offset: 1

Author

Herbert Kociemba, Jan 24 2021

Keywords

Comments

By "trapezoid" here is meant a quadrilateral with exactly one pair of parallel sides.
Without loss of generality we assume for the parallel sides c < a and for the diagonals f <= e. e and f are uniquely determined by e = sqrt((c(a^2-b^2) + a(d^2-c^2))/(a-c)) and f = sqrt((c(a^2-d^2) + a(b^2-c^2))/(a-c)).
The smallest possible trapezoid has side lengths a=4, c=3, b=d=2 and diagonals e=f=4. The smallest possible trapezoid which is not isosceles has side lengths a=8, b=9, c=3, d=11 and diagonals e=13 and f=9.

Examples

			a(7)=2 because there are two possible trapezoids: a=5, c=3, b=d=7, e=f=8 and a=7, c=4, b=d=6, e=f=8.
		

Crossrefs

Cf. A224931 for parallelograms, A340859 and A340860 for isosceles and non-isosceles trapezoids.

Programs

  • Mathematica
    n=65;list={};
    For[a=1,a<=n,a++,
    For[c=1,cse,Break[]];If[sf<=0,Continue[]];
    e=Sqrt[se/(a-c)];f=Sqrt[sf/(a-c)];
    If[IntegerQ[e]&&IntegerQ[f]&&a+d>f&&d+f>a&&f+a>d&&e+b>a&&b+a>e&&a+e>b,AppendTo[list,{a,b,c,d,e,f}]]]]]]
    Table[Select[list,Max[#[[1]],#[[2]],#[[3]],#[[4]]]==n&]//Length,{n,1,65}]

A340859 a(n) is the number of isosceles integer trapezoids (up to congruence) with integer side lengths a,c,b=d with n=Max(a,b,c) and integer diagonals e=f.

Original entry on oeis.org

0, 0, 0, 1, 1, 1, 2, 5, 6, 3, 3, 9, 6, 5, 10, 20, 9, 10, 8, 21, 18, 10, 10, 37, 21, 12, 24, 31, 14, 26, 17, 55, 32, 20, 36, 54, 22, 20, 39, 74, 24, 40, 26, 58, 59, 24, 26, 113, 47, 41, 54, 69, 33, 51, 61, 111, 65, 35, 39, 124, 38, 39, 88, 145, 79
Offset: 1

Author

Herbert Kociemba, Jan 24 2021

Keywords

Comments

By "trapezoid" here is meant a quadrilateral with exactly one pair of parallel sides.
Without loss of generality we assume b=d and for the parallel sides c < a. e and f are uniquely determined by e = f = sqrt((c(a^2-b^2) + a(b^2-c^2))/(a-c)). The smallest possible isosceles trapezoid has side lengths a=4, c=3, b=d=2 and diagonals e=f=4.

Examples

			a(7)=2 because there are two possible trapezoids: a=5, c=3, b=d=7, e=f=8 and a=7, c=4, b=d=6, e=f=8.
		

Crossrefs

Cf. A224931 for parallelograms, A340858 for general trapezoids and A340860 for non-isosceles trapezoids.

Programs

  • Mathematica
    n=65;list={};
    For[a=1,a<=n,a++,
    For[c=1,cse,Break[]];If[sf<=0,Continue[]];
    e=Sqrt[se/(a-c)];f=Sqrt[sf/(a-c)];
    If[IntegerQ[e]&&IntegerQ[f]&&a+d>f&&d+f>a&&f+a>d&&e+b>a&&b+a>e&&a+e>b,AppendTo[list,{a,b,c,d,e,f}]]]]]]
    Table[Select[list,Max[#[[1]],#[[2]],#[[3]],#[[4]]]==n&&#[[2]]==#[[4]]&]//Length,{n,1,65}]