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

A342491 a(n) = f(x)+f(y)+f(z), where (x,y,h) is the n-th Pythagorean triple listed in (A046083, A046084, A009000), and f(m)=A176774(m) is the smallest polygonality of m.

Original entry on oeis.org

12, 14, 23, 12, 28, 29, 27, 20, 38, 52, 27, 22, 11, 47, 20, 49, 53, 16, 69, 81, 17, 47, 59, 59, 34, 41, 93, 32, 76, 33, 34, 121, 76, 93, 88, 33, 37, 39, 101, 102, 83, 27, 90, 52, 73, 183, 75, 37, 45, 130, 105, 15, 155, 83, 120, 54, 106, 133, 129, 15, 123, 42, 225
Offset: 1

Views

Author

Michel Marcus, Mar 14 2021

Keywords

Comments

Inspired by (A245646, A245647, A245648), for which a(n) = 12.
Examples of lower terms: 11 for (21, 28, 35), 10 for (64, 120, 136) and 9 for (8778, 10296, 13530).

Examples

			a(1) = 12 because (3, 4, 5) are (3-, 4-, 5-) gonal numbers, and 3+4+5=12.
		

Crossrefs

Cf. A213188 (see 2nd comment).

Programs

  • PARI
    tp(n) = my(k=3); while( !ispolygonal(n,k), k++); k; \\ A176774
    f(v) = vecsum(apply(tp, v));
    list(lim) = {my(v=List(), m2, s2, h2, h); for(middle=4, lim-1, m2=middle^2; for(small=1, middle, s2=small^2; if(issquare(h2=m2+s2, &h), if(h>lim, break); listput(v, [h, middle, small]);););); v = vecsort(Vec(v)); apply(f, v);} \\ adapted from A009000

Formula

a(n) = f(A046083(n)) + f(A046084(n)) + f(A009000(n)) where f is A176774.

A382931 Numbers k for which the Pythagorean triangle (A046083(k), A046084(k), A009000(k)) has an integer altitude.

Original entry on oeis.org

7, 19, 36, 51, 69, 88, 99, 106, 126, 147, 163, 187, 196, 208, 227, 240, 250, 273, 293, 314, 342, 361, 384, 392, 409, 434, 455, 459, 483, 504, 507, 525, 549, 552, 579, 599, 627, 649, 679, 702, 711, 718, 724, 744, 752, 775, 802, 829, 854, 879, 894, 908, 935, 960
Offset: 1

Views

Author

Felix Huber, Apr 11 2025

Keywords

Comments

Let (a, b, c) be a primitive Pythagorean triple. Since gcd(a, b, c) = 1, all and only the Pythagorean triples (k*c*a, k*c*b, k*c^2) have an integer altitude h = (k*c*a*k*c*b)/(k*c^2) = k*a*b, where k is a positive integer.

Examples

			7 is in the sequence because the pythagorean triangle (A046083(7), A046084(7), A009000(7)) = (15, 20, 25) has the integer altitude 15*20/25 = 12.
		

Crossrefs

Programs

  • Maple
    A382931:=proc(H) # All hypotenuses <= H.
        local a,b,c,k,p,q,L,M;
        L:=[];
        M:=[];
        for p from 2 to floor(sqrt(H-1)) do
            for q to min(p-1,floor(sqrt(H-p^2))) do
                if gcd(p,q)=1 and is(p-q,odd) then
                    a:=p^2-q^2;
                    b:=2*p*q;
                    c:=p^2+q^2;
                    for k to iquo(H,c) do
                        L:=[op(L),[k*c,k*max(a,b),k*a*b/c]]
                    od
                fi
            od
        od;
        L:=sort(L);
        for k to nops(L) do
            if is(L[k,3],integer) then
               M:=[op(M),k]
            fi
        od;
        return op(M)
    end proc;
    A382931(1075);

A382932 a(n) is the altitude of the Pythagorean triangle (A046083(A382931(n)), A046084(A382931(n)), A009000(A382931(n))).

Original entry on oeis.org

12, 24, 36, 48, 60, 72, 60, 84, 96, 108, 120, 132, 120, 144, 156, 120, 168, 180, 192, 204, 216, 228, 240, 180, 252, 264, 276, 240, 288, 300, 168, 312, 324, 240, 336, 348, 360, 372, 384, 396, 420, 300, 408, 360, 420, 432, 444, 456, 468, 480, 360, 492, 504, 516
Offset: 1

Views

Author

Felix Huber, Apr 13 2025

Keywords

Comments

All terms are divisible by 12. Proof: (Start)
Let (a, b, c) be a primitive Pythagorean triple. Since gcd(a, b, c) = 1, all and only the Pythagorean triples (k*c*a, k*c*b, k*c^2) have an integer altitude h = (k*c*a*k*c*b)/(k*c^2) = k*a*b, where k is a positive integer.
With a = p^2 - q^2 and b = 2*p*q follows h = 2*k*p*q*(p^2 - q^2) = k*2*p*q*(p + q)*(p - q), where p > q > 0, gcd(p,q) = 1 and p or q is even.
It is to show that p*q*(p + q)*(p - q) is divisible by 6. Since p or q is divisible by 2, it remains to show that p*q*(p + q)*(p - q) is divisible by 3.
If 3 is a divisor of p or q, p*q is divisible by 3. If p mod 3 = 1 and q mod 3 = 2 or p mod 3 = 2 and q mod 3 = 1, then p + q is divisible by 3. If p mod 3 = q mod 3 = 1 or p mod 3 = q mod 3 = 2, then p - q is divisible by 3.
It follows that all terms are divisible by 12. (End)

Examples

			a(1) = 12 because the Pythagorean triangle (A046083(A382931(1)), A046084(A382931(1)), A009000(A382931(1))) = (A046083(7), A046084(7), A009000(7)) = (15, 20, 25) has the integer altitude 15*20/25 = 12.
		

Crossrefs

Programs

  • Maple
    A382932:=proc(H) # All hypotenuses <= H.
        local a,b,c,k,p,q,L,M;
        L:=[];
        M:=[];
        for p from 2 to floor(sqrt(H-1)) do
            for q to min(p-1,floor(sqrt(H-p^2))) do
                if gcd(p,q)=1 and is(p-q,odd) then
                    a:=p^2-q^2;
                    b:=2*p*q;
                    c:=p^2+q^2;
                    for k to iquo(H,c) do
                        L:=[op(L),[k*c,k*max(a,b),k*a*b/c]]
                    od
                fi
            od
        od;
        L:=sort(L);
        for k to nops(L) do
            if is(L[k,3],integer) then
               M:=[op(M),L[k,3]]
            fi
        od;
        return op(M)
    end proc;
    A382932(1075);

Formula

A057228 a(n) = u * v = x * y with (u - v) = (x + y) = A009000(n) (u>v, y>0, v>0, x>0, y>0).

Original entry on oeis.org

6, 24, 30, 54, 60, 96, 84, 150, 120, 210, 216, 240, 294, 210, 270, 384, 180, 486, 336, 600, 540, 480, 630, 726, 840, 864, 330, 504, 750, 924, 1014, 960, 1176, 1320, 840, 756, 1350, 1080, 1536, 720, 546, 1386, 1500, 1734, 1890, 1560, 1944, 1470, 2166
Offset: 1

Views

Author

Naohiro Nomoto, Sep 19 2000

Keywords

Comments

Areas of Pythagorean triangles.

Examples

			a(1) = 6 = 6 * 1 = 3 * 2, (6 - 1)=(3 + 2) = 5 = A009000(1).
		

Crossrefs

Programs

  • PARI
    list(lim) = {my(lh = List()); for(u = 2, sqrtint(lim), for(v = 1, u, if (u^2+v^2 > lim, break); if ((gcd(u, v) == 1) && (0 != (u-v)%2), for (i = 1, lim, if (i*(u^2+v^2) > lim, break); /* if (u^2 - v^2 < 2*u*v, w = [i*(u^2 - v^2), i*2*u*v, i*(u^2+v^2)], w = [i*2*u*v, i*(u^2 - v^2), i*(u^2+v^2)]); */ listput(lh, [i*(u^2+v^2), i^2*(u^2 - v^2)*u*v]); ); ); ); ); lh = vecsort(Vec(lh)); vector(#lh, i, lh[i][2])} \\ David A. Corneth, Apr 10 2021, adapted from A009000

Extensions

Offset changed to 1 by David A. Corneth, Apr 10 2021

A344083 a(n) = f(x)+f(y)+f(z), where (x,y,h) is the n-th Pythagorean triple listed in (A046083, A046084, A009000), and f(m)=A176775(m) is the index of m as k-gonal number for the smallest possible k.

Original entry on oeis.org

6, 9, 7, 11, 9, 9, 12, 10, 9, 10, 9, 11, 18, 10, 16, 9, 9, 20, 9, 7, 18, 9, 18, 15, 11, 14, 7, 12, 10, 13, 12, 7, 12, 15, 12, 17, 14, 18, 13, 9, 13, 14, 15, 10, 9, 7, 9, 21, 12, 10, 15, 23, 7, 9, 12, 20, 9, 18, 17, 28, 14, 16, 7, 21, 18, 24, 21, 21, 20, 16, 25
Offset: 1

Views

Author

Michel Marcus, May 09 2021

Keywords

Comments

6 is the minimum possible value, and A176775(3,4,5) gives this minimum.
Conjecture: there are no other Pythagorean triples that give this minimum. In other words, it is the only triple with 3 A090467 terms.

Crossrefs

Programs

  • PARI
    tp(n) = my(k=3); while( !ispolygonal(n,k), k++); k; \\ A176774
    itp(n) = my(m=tp(n)); (m-4+sqrtint((m-4)^2+8*(m-2)*n)) / (2*m-4); \\ A176775
    f(v) = vecsum(apply(itp, v));
    list(lim) = {my(v=List(), m2, s2, h2, h); for(middle=4, lim-1, m2=middle^2; for(small=1, middle, s2=small^2; if(issquare(h2=m2+s2, &h), if(h>lim, break); listput(v, [h, middle, small]);););); v = vecsort(Vec(v)); apply(f, v);}

A009003 Hypotenuse numbers (squares are sums of 2 nonzero squares).

Original entry on oeis.org

5, 10, 13, 15, 17, 20, 25, 26, 29, 30, 34, 35, 37, 39, 40, 41, 45, 50, 51, 52, 53, 55, 58, 60, 61, 65, 68, 70, 73, 74, 75, 78, 80, 82, 85, 87, 89, 90, 91, 95, 97, 100, 101, 102, 104, 105, 106, 109, 110, 111, 113, 115, 116, 117, 119, 120, 122, 123, 125, 130, 135, 136, 137, 140
Offset: 1

Views

Author

Keywords

Comments

Multiples of Pythagorean primes A002144 or of primitive Pythagorean triangles' hypotenuses A008846. - Lekraj Beedassy, Nov 12 2003
This is exactly the sequence of positive integers with at least one prime divisor of the form 4k + 1. Compare A072592. - John W. Layman, Mar 12 2008 and Franklin T. Adams-Watters, Apr 26 2009
Circumradius R of the triangles such that the area, the sides and R are integers. - Michel Lagneau, Mar 03 2012
The 2 squares summing to a(n)^2 cannot be equal because sqrt(2) is not rational. - Jean-Christophe Hervé, Nov 10 2013
Closed under multiplication. The primitive elements are those with exactly one prime divisor of the form 4k + 1 with multiplicity one, which are also those for which there exists a unique integer triangle = A084645. - Jean-Christophe Hervé, Nov 11 2013
a(n) are numbers whose square is the mean of two distinct nonzero squares. This creates 1-to-1 mapping between a Pythagorean triple and a "Mean" triple. If the Pythagorean triple is written, abnormally, as {j, k, h} where j^2 +(j+k)^2 = h^2, and h = a(n), then the corresponding "Mean" triple with the same h is {k, 2j, h} where (k^2 + (k+2j)^2)/2 = h^2. For example for h = 5, the Pythagorean triple is {3, 1, 5} and the Mean triple is {1, 6, 5}. - Richard R. Forberg, Mar 01 2015
Integral side lengths of rhombuses with integral diagonals p and q (therefore also with integral areas A because A = pq/2 is some multiple of 24). No such rhombuses are squares. - Rick L. Shepherd, Apr 09 2017
Conjecture: these are bases n in which exists an n-adic integer x satisfying x^5 = x, and 5 is the smallest k>1 such that x^k =x (so x^2, x^3 and x^4 are not x). Example: the 10-adic integer x = ...499879186432 (A120817) satisfies x^5 = x, and x^2, x^3, and x^4 are not x, so 10 is in this sequence. See also A120817, A210850 and A331548. - Patrick A. Thomas, Mar 01 2020
Didactic comment: When students solve a quadratic equation a*x^2 + b*x + c = 0 (a, b, c: integers) with the solution formula, they often make the mistake of calculating b^2 + 4*a*c instead of b^2 - 4*a*c (especially if a or c is negative). If the root then turns out to be an integer, they feel safe. This sequence lists the absolute values of b for which this error can happen. Reasoning: With p^2 = b^2 - 4*a*c and q^2 = b^2 + 4*a*c it follows by addition immediately that p^2 + q^2 = 2*b^2. If 4*a*c < 0, let p = x + y and q = x - y. If 4*a*c > 0, let p = x - y and q = x + y. In both cases follows that y^2 + x^2 = b^2. So every Pythagorean triple gives an absolute value of b for which this error can occur. Example: From (y, x, b) = (3, 4, 5) follows (q^2, b^2, p^2) = (1, 25, 49) or (p^2, b^2, q^2) = (1, 25, 49) with abs(4*a*c) = 24. - Felix Huber, Jul 22 2023
Conjecture: Numbers m such that the limit: Limit_{s->1} zeta(s)*Sum_{k=1..m} [k|m]*A008683(k)*(i^k)/(k^(s - 1)) exists, which is equivalent to numbers m such that abs(Sum_{k=1..m} [k|m]*A008683(k)*(i^k)) = 0. - Mats Granvik, Jul 06 2024

References

  • Steven R. Finch, Mathematical Constants, Cambridge, 2003, pp. 98-104.

Crossrefs

Cf. A000404 (sums of 2 squares), A004431 (sums of 2 distinct squares), A009000 (hypotenuse numbers with repetition), A072592, A004613, A187811.
Complement of A004144. Primes in this sequence give A002144. Same as A146984 (integer contraharmonic means) as sets - see Pahikkala 2010, Theorem 5.
Cf. A083025, A084645 (primitive elements), A084646, A084647, A084648, A084649, A006339.

Programs

  • Haskell
    import Data.List (findIndices)
    a009003 n = a009003_list !! (n-1)
    a009003_list = map (+ 1) $ findIndices (> 0) a005089_list
    -- Reinhard Zumkeller, Jan 07 2013
    
  • Maple
    isA009003 := proc(n)
        local p;
        for p in numtheory[factorset](n) do
            if modp(p,4) = 1 then
                return true;
            end if;
        end do:
        false;
    end proc:
    for n from 1 to 200 do
        if isA009003(n) then
            printf("%d,",n) ;
        end if;
    end do: # R. J. Mathar, Nov 17 2014
  • Mathematica
    f[n_] := Module[{k = 1}, While[(n - k^2)^(1/2) != IntegerPart[(n - k^2)^(1/2)], k++; If[2 * k^2 >= n, k = 0; Break[]]]; k]; A009003 = {}; Do[If[f[n^2] > 0, AppendTo[A009003, n]], {n, 3, 100}]; A009003 (* Vladimir Joseph Stephan Orlovsky, Jun 15 2009 *)
    Select[Range[200], Length[PowersRepresentations[#^2, 2, 2]] > 1 &] (* Alonso del Arte, Feb 11 2014 *)
  • PARI
    is_A009003(n)=setsearch(Set(factor(n)[,1]%4),1)  \\ M. F. Hasler, May 27 2012
    
  • PARI
    list(lim)=my(v=List(),u=vectorsmall(lim\=1)); forprimestep(p=5,lim,4, forstep(n=p,lim,p, u[n]=1)); for(i=5,lim, if(u[i], listput(v,i))); u=0; Vec(v) \\ Charles R Greathouse IV, Jan 13 2022
    
  • Python
    from itertools import count, islice
    from sympy import primefactors
    def A009003_gen(): # generator of terms
        return filter(lambda n:any(map(lambda p: p % 4 == 1,primefactors(n))),count(1))
    A009003_list = list(islice(A009003_gen(),20)) # Chai Wah Wu, Jun 22 2022

Formula

A005089(a(n)) > 0. - Reinhard Zumkeller, Jan 07 2013
a(n) ~ n. - Charles R Greathouse IV, Jan 13 2022
a(n) = sqrt(n-th square in A000404), where A000404 lists the sums of two nonzero squares. - M. F. Hasler, Jun 20 2025

Extensions

Definition edited by Jean-Christophe Hervé, Nov 10 2013

A004431 Numbers that are the sum of 2 distinct nonzero squares.

Original entry on oeis.org

5, 10, 13, 17, 20, 25, 26, 29, 34, 37, 40, 41, 45, 50, 52, 53, 58, 61, 65, 68, 73, 74, 80, 82, 85, 89, 90, 97, 100, 101, 104, 106, 109, 113, 116, 117, 122, 125, 130, 136, 137, 145, 146, 148, 149, 153, 157, 160, 164, 169, 170, 173, 178, 180, 181, 185, 193, 194, 197
Offset: 1

Views

Author

Keywords

Comments

Numbers whose prime factorization includes at least one prime congruent to 1 mod 4 and any prime factor congruent to 3 mod 4 has even multiplicity. - Franklin T. Adams-Watters, May 03 2006
Reordering of A055096 by increasing values and without repetition. - Paul Curtz, Sep 08 2008
A063725(a(n)) > 1. - Reinhard Zumkeller, Aug 16 2011
The square of these numbers is also the sum of two nonzero squares, so this sequence is a subsequence of A009003. - Jean-Christophe Hervé, Nov 10 2013
Closed under multiplication. Primitive elements are those with exactly one prime factor congruent to 1 mod 4 with multiplicity one (A230779). - Jean-Christophe Hervé, Nov 10 2013
From Bob Selcoe, Mar 23 2016: (Start)
Numbers c such that there is d < c, d >= 1 where c + d and c - d are square. For example, 53 + 28 = 81, 53 - 28 = 25.
Given a prime p == 1 mod 4, a term appears if and only if it is of the form p^i, p*2^j or p*k^2 {i,j,k >= 1}, or a product of any combination of these forms. Therefore, the products of any terms to any powers also are terms. For example, p(1) = 5 and p(2) = 13 so term 45 appears because 5*3^2 = 45 and term 416 appears because 13*2^5 = 416; therefore 45 * 416 = 18720 appears, as does 45^3 * 416^11 = 18720^3 * 416^8.
Numbers of the form j^2 + 2*j*k + 2*k^2 {j,k >= 1}. (End)
Suppose we have a term t = x^2 + y^2. Then s^2*t = (s*x)^2 + (s*y)^2 is a term for any s > 0. Also 2*t = (y+x)^2 + (x-y)^2 is a term. It follows that q*s^2*t is a term for any s > 0 and q=1 or 2. Examples: 2*7^2*26 = 28^2 + 42^2; 6^2*17 = 6^2 + 24^2. - Jerzy R Borysowicz, Aug 11 2017
To find terms up to some upper bound u, we can search for x^2 + y^2 = t where x is odd and y is even. Then we add all numbers of the form 2^m * t <= u and then remove duplicates. - David A. Corneth, Oct 04 2017
From Bernard Schott, Apr 13 2022: (Start)
The 5th comment "Closed under multiplication" can be proved with Brahmagupta's identity: (a^2+b^2) * (c^2+d^2) = (ac + bd)^2 + (ad - bc)^2.
The subsequence of primes is A002144. (End)

Examples

			53 = 7^2 + 2^2, so 53 is in the sequence.
		

Crossrefs

Programs

  • Haskell
    import Data.List (findIndices)
    a004431 n = a004431_list !! (n-1)
    a004431_list = findIndices (> 1) a063725_list
    -- Reinhard Zumkeller, Aug 16 2011
    
  • Maple
    isA004431 := proc(n)
        local a,b ;
        for a from 2 do
            if a^2>= n then
                return false;
            end if;
            b := n -a^2 ;
            if b < 1 then
                return false ;
            end if;
            if issqr(b) then
                if ( sqrt(b) <> a ) then
                    return true;
                end if;
            end if;
        end do:
        return false;
    end proc:
    A004431 := proc(n)
        option remember ;
        local a;
        if n = 1 then
            5;
        else
            for a from procname(n-1)+1 do
                if isA004431(a) then
                    return a;
                end if;
            end do:
        end if;
    end proc: # R. J. Mathar, Jan 29 2013
  • Mathematica
    A004431 = {}; Do[a = 2 m * n; b = m^2 - n^2; c = m^2 + n^2; AppendTo[A004431, c], {m, 100}, {n, m - 1}]; Take[Union@A004431, 63] (* Robert G. Wilson v, May 02 2009 *)
    Select[Range@ 200, Length[PowersRepresentations[#, 2, 2] /. {{0, } -> Nothing, {a, b_} /; a == b -> Nothing}] > 0 &] (* Michael De Vlieger, Mar 24 2016 *)
  • PARI
    select( isA004431(n)={n>1 && vecmin((n=factor(n)%4)[,1])==1 && ![f[1]>2 && f[2]%2 | f<-n~]}, [1..199]) \\ M. F. Hasler, Feb 06 2009, updated Nov 24 2019
    
  • PARI
    is(n)=if(n<5, return(0)); my(f=factor(n)%4); if(vecmin(f[, 1])>1, return(0)); for(i=1, #f[, 1], if(f[i, 1]==3 && f[i, 2]%2, return(0))); 1
    for(n=1, 1e3, if(is(n), print1(n, ", "))) \\ Altug Alkan, Dec 06 2015
    
  • PARI
    upto(n) = {my(res = List(), s); forstep(i=1, sqrtint(n), 2, forstep(j = 2, sqrtint(n - i^2), 2, listput(res, i^2 + j^2))); s = #res; for(i = 1, s, t = res[i]; for(e = 1, logint(n \ res[i], 2), listput(res, t<<=1))); listsort(res, 1); res} \\ David A. Corneth, Oct 04 2017
    
  • Python
    def aupto(limit):
      s = [i*i for i in range(1, int(limit**.5)+2) if i*i < limit]
      s2 = set(a+b for i, a in enumerate(s) for b in s[i+1:] if a+b <= limit)
      return sorted(s2)
    print(aupto(197)) # Michael S. Branicky, May 10 2021

A046080 a(n) is the number of integer-sided right triangles with hypotenuse n.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Or number of ways n^2 can be written as the sum of two positive squares: a(5) = 1: 3^2 + 4^2 = 5^2; a(25) = 2: 7^2 + 24^2 = 15^2 + 20^2 = 25^2. - Alois P. Heinz, Aug 01 2019

References

  • A. H. Beiler, Recreations in the Theory of Numbers, New York: Dover, pp. 116-117, 1966.

Crossrefs

First differs from A083025 at n=65.
A088111 gives records; A088959 gives where records occur.
Partial sums: A224921.

Programs

  • Maple
    f:= proc(n) local F,t;
      F:= select(t -> t[1] mod 4 = 1, ifactors(n)[2]);
      1/2*(mul(2*t[2]+1, t=F)-1)
    end proc:
    map(f, [$1..100]); # Robert Israel, Jul 18 2016
  • Mathematica
    a[1] = 0; a[n_] := With[{fi = Select[ FactorInteger[n], Mod[#[[1]], 4] == 1 & ][[All, 2]]}, (Times @@ (2*fi+1)-1)/2]; Table[a[n], {n, 1, 99}] (* Jean-François Alcover, Feb 06 2012, after first formula *)
  • PARI
    a(n)={my(m=0,k=n,n2=n*n,k2,l2);
    while(1,k=k-1;k2=k*k;l2=n2-k2;if(l2>k2,break);if(issquare(l2),m++));return(m)} \\ brute force, Stanislav Sykora, Mar 18 2015
    
  • PARI
    {a(n) = if( n<1, 0, sum(k=1, sqrtint(n^2 \ 2), issquare(n^2 - k^2)))}; /* Michael Somos, Mar 29 2015 */
    
  • PARI
    a(n) = {my(f = factor(n/(2^valuation(n, 2)))); (prod(k=1, #f~, if ((f[k,1] % 4) == 1, 2*f[k,2] + 1, 1)) - 1)/2;} \\ Michel Marcus, Mar 08 2016
    
  • Python
    from math import prod
    from sympy import factorint
    def A046080(n): return prod((e<<1)+1 for p,e in factorint(n).items() if p&3==1)>>1 # Chai Wah Wu, Sep 06 2022

Formula

Let n = 2^e_2 * product_i p_i^f_i * product_j q_j^g_j where p_i == 1 mod 4, q_j == 3 mod 4; then a(n) = (1/2)*(product_i (2*f_i + 1) - 1). - Beiler, corrected
8*a(n) + 4 = A046109(n) for n > 0. - Ralf Stephan, Mar 14 2004
a(n) = 0 for n in A004144. - Lekraj Beedassy, May 14 2004
a(A084645(k)) = 1. - Ruediger Jehn, Jan 14 2022
a(A084646(k)) = 2. - Ruediger Jehn, Jan 14 2022
a(A084647(k)) = 3. - Jean-Christophe Hervé, Dec 01 2013
a(A084648(k)) = 4. - Jean-Christophe Hervé, Dec 01 2013
a(A084649(k)) = 5. - Jean-Christophe Hervé, Dec 01 2013
a(n) = A063725(n^2) / 2. - Michael Somos, Mar 29 2015
a(n) = Sum_{k=1..n} Sum_{i=1..k} [i^2 + k^2 = n^2], where [ ] is the Iverson bracket. - Wesley Ivan Hurt, Dec 10 2021
a(A002144(k)^n) = n. - Ruediger Jehn, Jan 14 2022

A046084 The middle member 'b' of the Pythagorean triples (a,b,c) ordered by increasing c.

Original entry on oeis.org

4, 8, 12, 12, 15, 16, 20, 24, 24, 21, 24, 30, 28, 35, 36, 32, 40, 36, 40, 48, 45, 48, 45, 44, 42, 48, 60, 52, 56, 60, 63, 60, 56, 55, 70, 60, 72, 72, 64, 80, 68, 75, 77, 84, 63, 80, 72, 84, 76, 72, 80, 96, 99, 90, 96, 84, 90, 91, 88, 105, 112, 92, 84, 108, 105, 96, 120
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    maxHypo = 122; hypotenuseQ[n_] := For[k = 1, True, k++, p = Prime[k]; Which[Mod[p, 4] == 1 && Divisible[n, p], Return[True], p > n, Return[False]]]; hypotenuses = Select[Range[maxHypo], hypotenuseQ]; red[c_] := {a, b, c} /. {ToRules[ Reduce[0 < a <= b && a^2 + b^2 == c^2, {a, b}, Integers]]}; Sort[Flatten[red /@ hypotenuses , 1], Last[#1] < Last[#2] &][[All, 2]] (* Jean-François Alcover, Oct 23 2012 *)

A046083 The smallest member 'a' of the Pythagorean triples (a,b,c) ordered by increasing c.

Original entry on oeis.org

3, 6, 5, 9, 8, 12, 15, 7, 10, 20, 18, 16, 21, 12, 15, 24, 9, 27, 30, 14, 24, 20, 28, 33, 40, 36, 11, 39, 33, 25, 16, 32, 42, 48, 24, 45, 21, 30, 48, 18, 51, 40, 36, 13, 60, 39, 54, 35, 57, 65, 60, 28, 20, 48, 40, 63, 56, 60, 66, 36, 15, 69, 80, 45, 56, 72, 22, 27, 75, 44, 35
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    maxHypo = 125; hypotenuseQ[n_] := For[k = 1, True, k++, p = Prime[k]; Which[Mod[p, 4] == 1 && Divisible[n, p], Return[True], p > n, Return[False]]]; hypotenuses = Select[Range[maxHypo], hypotenuseQ]; red[c_] := {a, b, c} /. {ToRules[ Reduce[0 < a <= b && a^2 + b^2 == c^2, {a, b}, Integers]]}; Sort[Flatten[red /@ hypotenuses , 1], Last[#1] < Last[#2] &][[All, 1]] (* Jean-François Alcover, Oct 23 2012 *)
Showing 1-10 of 40 results. Next