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 44 results. Next

A156678 Consider primitive Pythagorean triangles (A^2 + B^2 = C^2, gcd (A, B) = 1, A < BA020884(n)).

Original entry on oeis.org

4, 12, 24, 15, 40, 60, 35, 84, 112, 63, 144, 180, 21, 99, 220, 264, 143, 312, 364, 45, 195, 420, 480, 255, 56, 544, 612, 77, 323, 684, 80, 760, 399, 840, 924, 117, 483, 1012, 1104, 55, 575, 1200, 140, 1300, 165, 675, 1404, 1512, 783, 176, 1624, 1740, 91, 221, 899
Offset: 1

Views

Author

Ant King, Feb 15 2009

Keywords

Comments

The ordered sequence of A values is A020884(n) and the ordered sequence of B values is A020883(n) (allowing repetitions) and A024354(n) (excluding repetitions)

Examples

			As the first four primitive Pythagorean triples (ordered by increasing A) are (3,4,5), (5,12,13), (7,24,25) and (8,15,17), then a(1)=4, a(2)=12, a(3)=24 and a(4)=15.
		

References

  • Beiler, Albert H.: Recreations In The Theory Of Numbers, Chapter XIV, The Eternal Triangle, Dover Publications Inc., New York, 1964, pp. 104-134.
  • Sierpinski, W.; Pythagorean Triangles, Dover Publications, Inc., Mineola, New York, 2003.

Crossrefs

Programs

  • Haskell
    a156678 n = a156678_list !! (n-1)
    a156678_list = f 1 1 where
       f u v | v > uu `div` 2        = f (u + 1) (u + 2)
             | gcd u v > 1 || w == 0 = f u (v + 2)
             | otherwise             = v : f u (v + 2)
             where uu = u ^ 2; w = a037213 (uu + v ^ 2)
    -- Reinhard Zumkeller, Nov 09 2012
  • Mathematica
    PrimitivePythagoreanTriplets[n_]:=Module[{t={{3,4,5}},i=4,j=5},While[i
    				

Formula

a(n) = A020884(n) + A156680(n).

A156679 Consider primitive Pythagorean triangles (A^2 + B^2 = C^2, gcd (A, B) = 1, A < BA020884(n)).

Original entry on oeis.org

5, 13, 25, 17, 41, 61, 37, 85, 113, 65, 145, 181, 29, 101, 221, 265, 145, 313, 365, 53, 197, 421, 481, 257, 65, 545, 613, 85, 325, 685, 89, 761, 401, 841, 925, 125, 485, 1013, 1105, 73, 577, 1201, 149, 1301, 173, 677, 1405, 1513, 785, 185, 1625, 1741, 109, 229
Offset: 1

Views

Author

Ant King, Feb 15 2009

Keywords

Comments

The ordered sequence of A values is A020884(n) and the ordered sequence of C values is A020882(n) (allowing repetitions) and A008846(n) (excluding repetitions).

Examples

			As the first four primitive Pythagorean triples (ordered by increasing A) are (3,4,5), (5,12,13), (7,24,25) and (8,15,17), then a(1)=5, a(2)=13, a(3)=25 and a(4)=17.
		

References

  • Beiler, Albert H.: Recreations In The Theory Of Numbers, Chapter XIV, The Eternal Triangle, Dover Publications Inc., New York, 1964, pp. 104-134.
  • Sierpinski, W.; Pythagorean Triangles, Dover Publications, Inc., Mineola, New York, 2003.

Crossrefs

Programs

  • Haskell
    a156679 n = a156679_list !! (n-1)
    a156679_list = f 1 1 where
       f u v | v > uu `div` 2        = f (u + 1) (u + 2)
             | gcd u v > 1 || w == 0 = f u (v + 2)
             | otherwise             = w : f u (v + 2)
             where uu = u ^ 2; w = a037213 (uu + v ^ 2)
    -- Reinhard Zumkeller, Nov 09 2012
  • Mathematica
    PrimitivePythagoreanTriplets[n_]:=Module[{t={{3,4,5}},i=4,j=5},While[iHarvey P. Dale, May 10 2020 *)

A156680 Consider primitive Pythagorean triangles (A^2 + B^2 = C^2, gcd (A, B) = 1, A < BA020884(n)).

Original entry on oeis.org

1, 7, 17, 7, 31, 49, 23, 71, 97, 47, 127, 161, 1, 79, 199, 241, 119, 287, 337, 17, 167, 391, 449, 223, 23, 511, 577, 41, 287, 647, 41, 721, 359, 799, 881, 73, 439, 967, 1057, 7, 527, 1151, 89, 1249, 113, 623, 1351, 1457, 727, 119, 1567, 1681, 31, 161, 839, 1799, 1921
Offset: 1

Views

Author

Ant King, Feb 15 2009

Keywords

Comments

This sequence contains the differences in the legs of the primitive Pythagorean triples, sorted by shortest side (A020884). If a difference appears once then it must appear infinitely often, for if (m,n) generates a primitive triple with Abs(b-a)=d then so too does (2m+n,m). This corresponds to applying Hall's A matrix, and hence all horizontal lines in the Pythagorean family tree will contain families of primitive triples whose legs differ by the same amount. The sorted differences that can occur are in A058529.

Examples

			As the first four primitive Pythagorean triples (ordered by increasing A) are (3,4,5), (5,12,13), (7,24,25) and (8,15,17), then a(1)=4-3=1, a(2)=12-5=7, a(3)=24-7=17 and a(4)=15-8=7.
		

References

  • Barning, F. J. M.; On Pythagorean and quasi-Pythagorean triangles and a generation process with the help of unimodular matrices. (Dutch), Math. Centrum Amsterdam Afd. Zuivere Wisk. ZW-001 (1963).

Crossrefs

Programs

  • Mathematica
    PrimitivePythagoreanTriplets[n_]:=Module[{t={{3,4,5}},i=4,j=5},While[i
    				

Formula

a(n) = A156678(n) - A020884(n).

A156689 Inradii of primitive Pythagorean triples a^2+b^2=c^2, 0A020884).

Original entry on oeis.org

1, 2, 3, 3, 4, 5, 5, 6, 7, 7, 8, 9, 6, 9, 10, 11, 11, 12, 13, 10, 13, 14, 15, 15, 12, 16, 17, 14, 17, 18, 15, 19, 19, 20, 21, 18, 21, 22, 23, 15, 23, 24, 21, 25, 22, 25, 26, 27, 27, 24, 28, 29, 21, 26, 29, 30
Offset: 1

Views

Author

Ant King, Feb 18 2009

Keywords

Comments

The inradius is given by r=1/2 (a+b-c)=ab/(a+b+c)=area/semiperimeter, and the inradii ordered by increasing r are in A020888.

Examples

			The eighth primitive Pythagorean triple ordered by increasing a is (13,84,85). As this has inradius 1/2 (13+84-85)=6, we have a(8)=6.
		

References

  • Mohammad K. Azarian, Circumradius and Inradius, Problem S125, Math Horizons, Vol. 15, Issue 4, April 2008, p. 32. Solution published in Vol. 16, Issue 2, November 2008, p. 32.
  • D. G. Rogers, Putting Pythagoras in the frame, Mathematics Today, The Institute of Mathematics and its Applications, Vol. 44, No. 3, June 2008, pp. 123-125.

Crossrefs

Programs

  • Haskell
    a156689 n = a156689_list !! (n-1)
    a156689_list = f 1 1 where
       f u v | v > uu `div` 2        = f (u + 1) (u + 2)
             | gcd u v > 1 || w == 0 = f u (v + 2)
             | otherwise             = (u + v - w) `div` 2 : f u (v + 2)
             where uu = u ^ 2; w = a037213 (uu + v ^ 2)
    -- Reinhard Zumkeller, Nov 09 2012
  • Mathematica
    PrimitivePythagoreanTriplets[n_]:=Module[{t={{3,4,5}},i=4,j=5},While[i
    				

Formula

A156689(n)=1/2 (A020884(n)+A156678(n)-A156679(n))

A195770 Positive integer a is repeated m times, where m is the number of 1-Pythagorean triples (a,b,c) satisfying a<=b.

Original entry on oeis.org

3, 5, 6, 7, 7, 9, 9, 10, 11, 11, 12, 13, 13, 14, 14, 15, 15, 15, 16, 17, 17, 18, 18, 19, 19, 20, 21, 21, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 25, 26, 26, 27, 27, 27, 28, 28, 29, 29, 30, 30, 30, 31, 31, 32, 32, 32, 33, 33, 33, 33
Offset: 1

Views

Author

Clark Kimberling, Sep 25 2011

Keywords

Comments

In case the number k=-cos(C) is a rational number, the law of cosines, c^2=a^2+b^2+k*a*b, can be regarded as a Diophantine equation having positive integer solutions a,b,c satisfying a<=b. The terms "k-Pythagorean triple" and "primitive k-Pythagorean triple" generalize the classical terms corresponding to the case k=0.
Example: the first five (3/2)-Pythagorean triples are
(5,18,22),(6,11,16),(9,11,71),(10,36,44),(12,22,32);
the first five primitive (3/2)-Pythagorean triples are
(5,18,22),(6,11,16),(9,64,71),(13,138,148),(14,75,86).
...
If |k|>2, there is no triangle with sidelengths a,b,c satisfying c^2=a^2+b^2+k*a*b, but this equation is, nevertheless, a Diophantine equation for rational k.
...
Related sequences (k-Pythagorean triples):
k...(a(1),b(1),c(1))........a(n).....b(n).....c(n)
0.......(3,4,5).............A009004..A156681..A156682
1.......(3,5,7).............A195770..A195866..A195867
3.......(3,7,11)............A196112..A196113..A196114
4.......(3,8,13)............A196119..A196120..A196121
5.......(1,3,5).............A196155..A196156..A196157
6.......(2,3,7).............A196162..A196163..A196164
7.......(1,1,3).............A196169..A196170..A196171
8.......(1,4,7).............A196176..A196177..A196178
9.......(1,15,19)...........A196183..A196184..A196185
10......(1,2,5).............A196238..A196239..A196240
1/2.....(2,3,4).............A195879..A195880..A195881
3/2.....(5,18,22)...........A195925..A195926..A195927
1/3.....(3,8,9).............A195939..A195940..A195941
2/3.....(4,9,11)............A196001..A196002..A196003
4/3.....(7,36,41)...........A196040..A196041..A196042
5/3.....(7,39,45)...........A196088..A196089..A196090
5/2.....(5,22,28)...........A196026..A196027..A196028
1/4.....(2,2,3).............A196259..A196260..A196261
3/4.....(2,6,7).............A196252..A196253..A196254
5/4.....(3,20,22)...........A196098..A196099..A196100
7/4.....(9,68,76)...........A196105..A196106..A196107
1/5.....(5,7,9).............A196348..A196349..A196350
1/8.....(4,10,11)...........A196355..A196356..A196357
-1......(1,1,1).............A195778..A195794..A195795
-3......(1,3,1).............A196369..A196370..A196371
-4......(1,4,1).............A196376..A196377..A196378
-5......(1,5,1).............A196383..A196384..A196385
-6......(1,6,1).............A196390..A196391..A196392
-1/2....(1,2,2).............A195872..A195873..A195874
-3/2....(2,3,2).............A195918..A195919..A195920
-5/2....(2,5,2).............A196362..A196363..A196364
-1/3....(1,3,3).............A195932..A195933..A195934
-2/3....(2,3,3).............A195994..A195995..A195996
-4/3....(3,4,3).............A196033..A196034..A196035
-5/3....(3,5,3).............A196008..A196009..A196083
-1/4....(1,4,4).............A196266..A196267..A196268
-3/4....(3,4,4).............A196245..A196247..A196248
...
Related sequences (primitive k-Pythagorean triples):
k...(a(1),b(1),c(1))........a(n).....b(n).....c(n)
0.......(3,4,5).............A020884..A156678..A156679
1.......(3,5,7).............A195868..A195869..A195870
3.......(3,7,11)............A196115..A196116..A196117
4.......(3,8,13)............A196122..A196123..A196124
5.......(1,3,5).............A196158..A196159..A196160
6.......(2,3,7).............A196165..A196166..A196167
7.......(1,1,3).............A196172..A196173..A196174
8.......(1,4,7).............A196179..A196180..A196181
9.......(1,15,19)...........A196186..A196187..A196188
10......(1,2,5).............A196241..A196242..A196243
1/2.....(2,3,4).............A195882..A195883..A195884
3/2.....(5,18,22)...........A195928..A195929..A195930
1/3.....(3,8,9).............A195990..A195991..A195992
2/3.....(4,9,11)............A196004..A196005..A196006
4/3.....(7,36,41)...........A196043..A196044..A196045
5/3.....(7,39,45)...........A196091..A196092..A196093
5/2.....(5,22,28)...........A196029..A196030..A196031
1/4.....(2,2,3).............A196262..A196263..A196264
3/4.....(2,6,7).............A196255..A196256..A196257
5/4.....(3,20,22)...........A196101..A196102..A196103
7/4.....(9,68,76)...........A196108..A196109..A196110
1/5.....(5,7,9).............A196351..A196352..A196353
1/8.....(4,10,11)...........A196358..A196359..A196360
-1......(1,1,1).............A195796..A195862..A195863
-3......(1,3,1).............A196372..A196373..A196374
-4......(1,4,1).............A196379..A196380..A196381
-5......(1,5,1).............A196386..A196387..A196388
-6......(1,6,1).............A196393..A196394..A196395
-1/2....(1,2,2).............A195875..A195876..A195877
-3/2....(2,3,2).............A195921..A195922..A195923
-5/2....(2,5,2).............A196365..A196366..A196367
-1/3....(1,3,3).............A195935..A195936..A195937
-2/3....(2,3,3).............A195997..A195998..A195999
-4/3....(3,4,3).............A196036..A196037..A196038
-5/3....(3,5,3).............A196084..A196085..A196086
-1/4....(1,4,4).............A196269..A196270..A196271
-3/4....(3,4,4).............A196249..A196250..A196246
From Georg Fischer, Oct 26 2020: (Start)
The Mathematica program below has fixed limits (z7, z8, z9). Therefore, it misses higher values of b. For example, the following triples are do not show up in the corresponding sequences:
A196112 A196113 A196114 - non-primitive 3-Pythagorean
49: 29 1008 1051
A196241 A196242 A196243 - primitive 10-Pythagorean
31: 13 950 1013
This problem affects 62 of the 74 parameter combinations. (End)

Examples

			The first seven 1-Pythagorean triples (a,b,c), ordered as
described above, are as follows:
3,5,7........7^2 = 3^2 + 5^2 + 3*5
5,16,19.....19^2 = 5^2 + 16^2 + 5*16
6,10,14.....14^2 = 6^2 + 10^2 + 6*10
7,8,13
7,33,37
9,15,21
9,56,61
10,32,38
		

Crossrefs

Programs

  • Maple
    f:= proc(a) local F,r,u,b;
        r:= 3*a^2;
        nops(select(proc(t) local b; b:= (r/t - t - 2*a)/4;
    (t + r/t) mod 4 = 0 and b::integer and b >= a end proc, numtheory:-divisors(3*a^2)));
    end proc:
    seq(a$f(a),a=1..100); # Robert Israel, Jul 04 2024
  • Mathematica
    z8 = 2000; z9 = 400; z7 = 100;
    k = 1; c[a_, b_] := Sqrt[a^2 + b^2 + k*a*b];
    d[a_, b_] := If[IntegerQ[c[a, b]], {a, b, c[a, b]}, 0]
    t[a_] := Table[d[a, b], {b, a, z8}]
    u[n_] := Delete[t[n], Position[t[n], 0]]
    Table[u[n], {n, 1, 15}]
    t = Table[u[n], {n, 1, z8}];
    Flatten[Position[t, {}]]
    u = Flatten[Delete[t, Position[t, {}]]];
    x[n_] := u[[3 n - 2]];
    Table[x[n], {n, 1, z7}]  (* this sequence *)
    y[n_] := u[[3 n - 1]];
    Table[y[n], {n, 1, z7}]  (* A195866 *)
    z[n_] := u[[3 n]];
    Table[z[n], {n, 1, z7}]  (* A195867 *)
    x1[n_] := If[GCD[x[n], y[n], z[n]] == 1, x[n], 0]
    y1[n_] := If[GCD[x[n], y[n], z[n]] == 1, y[n], 0]
    z1[n_] := If[GCD[x[n], y[n], z[n]] == 1, z[n], 0]
    f = Table[x1[n], {n, 1, z9}];
    x2 = Delete[f, Position[f, 0]]  (* A195868 *)
    g = Table[y1[n], {n, 1, z9}];
    y2 = Delete[g, Position[g, 0]]  (* A195869 *)
    h = Table[z1[n], {n, 1, z9}];
    z2 = Delete[h, Position[h, 0]]  (* A195870 *)

Extensions

Name corrected by Robert Israel, Jul 04 2024

A042965 Nonnegative integers not congruent to 2 mod 4.

Original entry on oeis.org

0, 1, 3, 4, 5, 7, 8, 9, 11, 12, 13, 15, 16, 17, 19, 20, 21, 23, 24, 25, 27, 28, 29, 31, 32, 33, 35, 36, 37, 39, 40, 41, 43, 44, 45, 47, 48, 49, 51, 52, 53, 55, 56, 57, 59, 60, 61, 63, 64, 65, 67, 68, 69, 71, 72, 73, 75, 76, 77, 79, 80, 81, 83, 84, 85, 87, 88, 89, 91, 92
Offset: 1

Views

Author

Keywords

Comments

Consider primitive Pythagorean triangles (A^2 + B^2 = C^2, (A, B) = 1, A <= B); sequence (starting at 3) gives values of AUB, sorted and duplicates removed. Values of AUBUC give same sequence. - David W. Wilson
These are the nonnegative integers that can be written as a difference of two squares, i.e., n = x^2 - y^2 for integers x,y. - Sharon Sela (sharonsela(AT)hotmail.com), Jan 25 2002. Equivalently, nonnegative numbers represented by the quadratic form x^2-y^2 of discriminant 4. The primes in this sequence are all the odd primes. - N. J. A. Sloane, May 30 2014
Numbers n such that Kronecker(4,n) == mu(gcd(4,n)). - Jon Perry, Sep 17 2002
Count, sieving out numbers of the form 2*(2*n+1) (A016825, "nombres pair-impairs"). A generalized Chebyshev transform of the Jacobsthal numbers: apply the transform g(x) -> (1/(1+x^2)) g(x/(1+x^2)) to the g.f. of A001045(n+2). Partial sums of 1,2,1,1,2,1,.... - Paul Barry, Apr 26 2005
For n>1, equals union of A020883 and A020884. - Lekraj Beedassy, Sep 28 2004
The sequence 1,1,3,4,5,... is the image of A001045(n+1) under the mapping g(x) -> g(x/(1+x^2)). - Paul Barry, Jan 16 2005
With offset 0 starting (1, 3, 4,...) = INVERT transform of A009531 starting (1, 2, -1, -4, 1, 6,...) with offset 0.
Apparently these are the regular numbers modulo 4 [Haukkanan & Toth]. - R. J. Mathar, Oct 07 2011
Numbers of the form x*y in nonnegative integers x,y with x+y even. - Michael Somos, May 18 2013
Convolution of A106510 with A000027. - L. Edson Jeffery, Jan 24 2015
Numbers that are the sum of zero or more consecutive odd positive numbers. - Gionata Neri, Sep 01 2015
Numbers that are congruent to {0, 1, 3} mod 4. - Wesley Ivan Hurt, Jun 10 2016
Nonnegative integers of the form (2+(3*m-2)/4^j)/3, j,m >= 0. - L. Edson Jeffery, Jan 02 2017
This is { x^2 - y^2; x >= y >= 0 }; with the restriction x > y one gets the same set without zero; with the restriction x > 0 (i.e., differences of two nonzero squares) one gets the set without 1. An odd number 2n-1 = n^2 - (n-1)^2, a number 4n = (n+1)^2 - (n-1)^2. - M. F. Hasler, May 08 2018

Examples

			G.f. = x^2 + 3*x^3 + 4*x^4 + 5*x^5 + 7*x^6 + 8*x^7 + 9*x^8 + 11*x^9 + 12*x^10 + ...
		

References

  • R. K. Guy, Unsolved Problems in Number Theory, Springer, 1st edition, 1981. See section D9.
  • J. V. Uspensky and M. A. Heaslet, Elementary Number Theory, McGraw-Hill, NY, 1939, p. 83.

Crossrefs

Essentially the complement of A016825.
See A267958 for these numbers multiplied by 4.

Programs

  • Haskell
    a042965 =  (`div` 3) . (subtract 3) . (* 4)
    a042965_list = 0 : 1 : 3 : map (+ 4) a042965_list
    -- Reinhard Zumkeller, Nov 09 2012
    
  • Magma
    [n: n in [0..100] | not n mod 4 in [2]]; // Vincenzo Librandi, Sep 03 2015
    
  • Maple
    a_list := proc(len) local rec; rec := proc(n) option remember;
    ifelse(n <= 4, [0, 1, 3, 4][n], rec(n-1) + rec(n-3) - rec(n-4)) end:
    seq(rec(n), n=1..len) end: a_list(76); # Peter Luschny, Aug 06 2022
  • Mathematica
    nn=100; Complement[Range[0,nn], Range[2,nn,4]] (* Harvey P. Dale, May 21 2011 *)
    f[n_]:=Floor[(4*n-3)/3]; Array[f,70] (* Robert G. Wilson v, Jun 26 2012 *)
    LinearRecurrence[{1, 0, 1, -1}, {0, 1, 3, 4}, 70] (* L. Edson Jeffery, Jan 21 2015 *)
    Select[Range[0, 100], ! MemberQ[{2}, Mod[#, 4]] &] (* Vincenzo Librandi, Sep 03 2015 *)
  • PARI
    a(n)=(4*n-3)\3 \\ Charles R Greathouse IV, Jul 25 2011
    
  • Python
    def A042965(n): return (n<<2)//3-1 # Chai Wah Wu, Feb 10 2025

Formula

Recurrence: a(n) = a(n-1) + a(n-3) - a(n-4) for n>4.
a(n) = n - 1 + (3n-3-sqrt(3)*(1-2*cos(2*Pi*(n-1)/3))*sin(2*Pi*(n-1)/3))/9. Partial sums of the period-3 sequence 0, 1, 1, 2, 1, 1, 2, 1, 1, 2, ... (A101825). - Ralf Stephan, May 19 2013
G.f.: A(x) = x^2*(1+x)^2/((1-x)^2*(1+x+x^2)); a(n)=Sum{k=0..floor(n/2)}, binomial(n-k-1, k)*A001045(n-2*k), n>0. - Paul Barry, Jan 16 2005, R. J. Mathar, Dec 09 2009
a(n) = floor((4*n-3)/3). - Gary Detlefs, May 14 2011
A214546(a(n)) != 0. - Reinhard Zumkeller, Jul 20 2012
From Michael Somos, May 18 2013: (Start)
Euler transform of length 3 sequence [3, -2, 1].
a(2-n) = -a(n). (End)
From Wesley Ivan Hurt, Jun 10 2016: (Start)
a(n) = (12*n-12+3*cos(2*n*Pi/3)+sqrt(3)*sin(2*n*Pi/3))/9.
a(3k) = 4k-1, a(3k-1) = 4k-3, a(3k-2) = 4k-4. (End)
a(n) = round((4*n-4)/3). - Mats Granvik, Sep 24 2016
The g.f. A(x) satisfies (A(x)/x)^2 + A(x)/x = x*B(x)^2, where B(x) is the o.g.f. of A042968. - Peter Bala, Apr 12 2017
Sum_{n>=2} (-1)^n/a(n) = log(sqrt(2)+2)/sqrt(2) - (sqrt(2)-1)*log(2)/4. - Amiram Eldar, Dec 05 2021
From Peter Bala, Aug 03 2022: (Start)
a(n) = a(floor(n/2)) + a(1 + ceiling(n/2)) for n >= 2, with a(2) = 1 and a(3) = 3.
a(2*n) = a(n) + a(n+1); a(2*n+1) = a(n) + a(n+2). Cf. A047222 and A006165. (End)
E.g.f.: (9 + 12*exp(x)*(x - 1) + exp(-x/2)*(3*cos(sqrt(3)*x/2) + sqrt(3)*sin(sqrt(3)*x/2)))/9. - Stefano Spezia, Apr 05 2023

Extensions

Edited by N. J. A. Sloane at the suggestion of Andrew S. Plewe, Peter Pein and Ralf Stephan, Jun 17 2007
Typos fixed in Gary Detlefs's formula and in PARI program by Reinhard Zumkeller, Nov 09 2012

A020883 Ordered long legs of primitive Pythagorean triangles.

Original entry on oeis.org

4, 12, 15, 21, 24, 35, 40, 45, 55, 56, 60, 63, 72, 77, 80, 84, 91, 99, 105, 112, 117, 120, 132, 140, 143, 144, 153, 156, 165, 168, 171, 176, 180, 187, 195, 208, 209, 220, 221, 224, 231, 240, 247, 252, 253, 255, 260, 264, 272, 273, 275, 285, 288, 299, 304, 308, 312, 323
Offset: 1

Views

Author

Keywords

Comments

Consider primitive Pythagorean triangles (A^2 + B^2 = C^2, (A, B) = 1, A < B); sequence gives values of B, sorted.
Any term in this sequence is given by f(m,n) = 2*m*n or g(m,n) = m^2 - n^2 where m and n are any two positive integers, m > 1, n < m, the greatest common divisor of m and n is 1, m and n are not both odd; e.g., f(m,n) = f(2,1) = 2*2*1 = 4. - Agola Kisira Odero, Apr 29 2016
All terms are composite. - Thomas Ordowski, Mar 12 2017
a(1) is the only power of 2. - Torlach Rush, Nov 08 2019
The first term appearing twice is 420 = a(75) = a(76) = A024410(1). - Giovanni Resta, Nov 11 2019
From Bernard Schott, May 05 2021: (Start)
Also, ordered sides a of primitive triples (a, b, c) for integer-sided triangles where side a is the harmonic mean of the 2 other sides b and c, i.e., 2/a = 1/b + 1/c with b < a < c.
Example: a(2) = 12, because the second triple is (12, 10, 15) with side a = 12, satisfying 2/12 = 1/10 + 1/15 and 15-12 < 10 < 15+12.
The first term appearing twice 420 corresponds to triples (420, 310, 651) and (420, 406, 435), the second one is 572 = a(101) = a(102) = A024410(2) and corresponds to triples (572, 407, 962) and (572, 455, 770). The terms that appear more than once in this sequence are in A024410.
For the corresponding primitive triples and miscellaneous properties and references, see A343891. (End)

References

  • V. Lespinard & R. Pernet, Trigonométrie, Classe de Mathématiques élémentaires, programme 1962, problème B-337 p. 179, André Desvigne.

Crossrefs

Triangles with 2/a = 1/b + 1/c: A343891 (triples), A020883 (side a), A343892 (side b), A343893 (side c), A343894 (perimeter).

Programs

  • Maple
    for a from 4 to 325 do
    for b from floor(a/2)+1 to a-1 do
    c := a*b/(2*b-a);
    if c=floor(c) and igcd(a,b,c)=1 and c-bBernard Schott, May 05 2021

Extensions

Extended and corrected by David W. Wilson

A020886 Ordered semiperimeters of primitive Pythagorean triangles.

Original entry on oeis.org

6, 15, 20, 28, 35, 42, 45, 63, 66, 72, 77, 88, 91, 99, 104, 110, 117, 120, 130, 143, 153, 156, 165, 170, 187, 190, 195, 204, 209, 210, 221, 228, 231, 238, 247, 255, 266, 272, 273, 276, 285, 299, 304, 322, 323, 325, 336, 342, 345, 350, 357, 368, 378, 391, 399
Offset: 1

Views

Author

Keywords

Comments

k is in this sequence iff A078926(k) > 0.
Also, ordered sides c of primitive triples (a, b, c) for integer-sided triangles where side a is the harmonic mean of the 2 other sides b and c, i.e., 2/a = 1/b + 1/c with b < a < c (A343893). - Bernard Schott, May 06 2021
a(n) are the ordered radii of inscribed circles in squares, from which the tangents to the circles are cut off by primitive Pythagorean triangles. - Alexander M. Domashenko, Oct 17 2024

Crossrefs

Subsequence of A005279.
Triangles with 2/a = 1/b + 1/c: A343891 (triples), A020883 (side a), A343892 (side b), A343893 (side c), A343894 (perimeter).

Programs

  • Maple
    isA020886 := proc(an) local r::integer,s::integer ; for r from floor((an/2)^(1/2)) to floor(an^(1/2)) do for s from r-1 to 1 by -2 do if r*(r+s) = an and gcd(r,s) < 2 then RETURN(true) ; fi ; if r*(r+s) < an then break ; fi ; od ; od : RETURN(false) ; end : for n from 2 to 400 do if isA020886(n) then printf("%d,",n) ; fi ; od ; # R. J. Mathar, Jun 08 2006
  • Mathematica
    A078926[n_] := Sum[Boole[n < d^2 < 2n && CoprimeQ[d, n/d]], {d, Divisors[ n/2^IntegerExponent[n, 2]]}];
    Select[Range[1000], A078926[#]>0&] (* Jean-François Alcover, Mar 23 2020 *)
  • PARI
    is(n,f=factor(n))=my(P=apply(i->f[i,1]^f[i,2],[2-n%2..#f~]),nn=2*n); forvec(v=vector(#P,i,[0,1]), my(d=prod(i=1,#v,P[i]^v[i]),d2=d^2); if(d2n, return(1))); 0
    list(lim)=my(v=List()); forfactored(n=6,lim\1, if(is(n[1],n[2]), listput(v,n[1]))); Vec(v) \\ Charles R Greathouse IV, Feb 03 2023

Formula

a(n) = A024364(n)/2.

A024352 Numbers which are the difference of two positive squares, c^2 - b^2 with 1 <= b < c.

Original entry on oeis.org

3, 5, 7, 8, 9, 11, 12, 13, 15, 16, 17, 19, 20, 21, 23, 24, 25, 27, 28, 29, 31, 32, 33, 35, 36, 37, 39, 40, 41, 43, 44, 45, 47, 48, 49, 51, 52, 53, 55, 56, 57, 59, 60, 61, 63, 64, 65, 67, 68, 69, 71, 72, 73, 75, 76, 77, 79, 80, 81, 83, 84, 85, 87, 88, 89, 91, 92, 93, 95, 96
Offset: 1

Views

Author

Keywords

Comments

These are the solutions to the equation x^2 + xy = n where y mod 2 = 0, y is positive and x is any positive integer. - Andrew S. Plewe, Oct 19 2007
Ordered different terms of A120070 = 3, 8, 5, 15, 12, 7, ... (which contains two 15's, two 40's, and two 48's). Complement: A139544. (See A139491.) - Paul Curtz, Sep 01 2009
A024359(a(n)) > 0. - Reinhard Zumkeller, Nov 09 2012
If a(n) mod 6 = 3, n > 1, then a(n) = c^2 - f(a(n))^2 where f(n) = (floor(4*n/3) - 3 - n)/2. For example, 171 = 30^2 - 27^2 and f(171) = 27. - Gary Detlefs, Jul 15 2014

Crossrefs

Same as A042965 except for initial terms. - Michael Somos, Jun 08 2000
Different from A020884.

Programs

  • Haskell
    a024352 n = a024352_list !! (n-1)
    a024352_list = 3 : drop 4 a042965_list
    -- Reinhard Zumkeller, Nov 09 2012
    
  • Magma
    [3] cat [4 +Floor((4*n-3)/3): n in [2..100]]; // G. C. Greubel, Apr 22 2023
    
  • Mathematica
    Union[Flatten[Table[Select[Table[b^2 - c^2, {c, b-1}], # < 100 &], {b, 100}]]] (* Robert G. Wilson v, Jun 05 2004 *)
    LinearRecurrence[{1,0,1,-1},{3,5,7,8,9},70] (* Harvey P. Dale, Dec 20 2021 *)
  • PARI
    is(n)=(n%4!=2 && n>4) || n==3 \\ Charles R Greathouse IV, May 31 2013
    
  • Python
    def A024352(n): return 3 if n==1 else 3+(n<<2)//3 # Chai Wah Wu, Feb 10 2025
  • SageMath
    def A024352(n): return 4 + ((4*n-3)//3) - int(n==1)
    [A024352(n) for n in range(1,101)] # G. C. Greubel, Apr 22 2023
    

Formula

Consists of all positive integers except 1, 4 and numbers == 2 (mod 4).
a(n) = a(n-3) + 4, n > 4.
G.f.: (3 + 2*x + 2*x^2 - 2*x^3 - x^4)/(1 - x - x^3 + x^4). - Ralf Stephan, before May 13 2008
a(n) = a(n-1) + a(n-3) - a(n-4), for n > 5. - Ant King, Oct 03 2011
a(n) = 4 + floor((4*n-3)/3), n > 1. - Gary Detlefs, Jul 15 2014

Extensions

Edited by N. J. A. Sloane, Sep 19 2008

A024361 Number of primitive Pythagorean triangles with leg n.

Original entry on oeis.org

0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 2, 1, 0, 2, 1, 1, 0, 1, 2, 2, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 1, 2, 0, 2, 2, 1, 0, 2, 2, 1, 0, 1, 2, 2, 0, 1, 2, 1, 0, 2, 2, 1, 0, 2, 2, 2, 0, 1, 4, 1, 0, 2, 1, 2, 0, 1, 2, 2, 0, 1, 2, 1, 0, 2, 2, 2, 0, 1, 2, 1, 0, 1, 4, 2, 0, 2, 2, 1, 0, 2, 2, 2, 0, 2, 2, 1, 0, 2, 2, 1, 0, 1, 2, 4
Offset: 1

Views

Author

Keywords

Comments

Consider primitive Pythagorean triangles (A^2 + B^2 = C^2, (A, B) = 1, A <= B); sequence gives number of times A or B takes value n.
For n > 1, a(n) = 0 for n == 2 (mod 4) (n in A016825).
From Jianing Song, Apr 23 2019: (Start)
Note that all the primitive Pythagorean triangles are given by A = min{2*u*v, u^2 - v^2}, B = max{2*u*v, u^2 - v^2}, C = u^2 + v^2, where u, v are coprime positive integers, u > v and u - v is odd. As a result:
(a) if n is odd, then a(n) is the number of representations of n to the form n = u^2 - v^2, where u, v are coprime positive integers (note that this guarantees that u - v is odd) and u > v. Let s = u + v, t = u - v, then n = s*t, where s and t are unitary divisors of n and s > t, so the number of representations is A034444(n)/2 if n > 1 and 0 if n = 1;
(b) if n is divisible by 4, then a(n) is the number of representations of n to the form n = 2*u*v, where u, v are coprime positive integers (note that this also guarantees that u - v is odd because n/2 is even) and u > v. So u and v must be unitary divisors of n/2, so the number of representations is A034444(n/2)/2. Since n is divisible by 4, A034444(n/2) = A034444(n) so a(n) = A034444(n)/2.
(c) if n == 2 (mod 4), then n/2 is odd, so n = 2*u*v implies that u and v are both odd, which is not acceptable, so a(n) = 0.
a(n) = 0 if n = 1 or n == 2 (mod 4), otherwise a(n) is a power of 2.
The earliest occurrence of 2^k is 2*A002110(k+1) for k > 0. (End)

Examples

			a(12) = 2 because 12 appears twice, in (A,B,C) = (5,12,13) and (12,35,37).
		

Crossrefs

Programs

  • Mathematica
    Table[If[n == 1 || Mod[n, 4] == 2, 0, 2^(Length[FactorInteger[n]] - 1)], {n, 100}]
  • PARI
    A024361(n) = if(1==n||(2==(n%4)),0,2^(omega(n)-1)); \\ (after the Mathematica program) - Antti Karttunen, Nov 10 2018

Formula

a(n) = A034444(n)/2 = 2^(A001221(n)-1) if n != 2 (mod 4) and n > 1, a(n) = 0 otherwise. - Jianing Song, Apr 23 2019
a(n) = A024359(n) + A024360(n). - Ray Chandler, Feb 03 2020

Extensions

Incorrect comment removed by Ant King, Jan 28 2011
More terms from Antti Karttunen, Nov 10 2018
Showing 1-10 of 44 results. Next