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: Asif Ahmed

Asif Ahmed's wiki page.

Asif Ahmed has authored 2 sequences.

A379744 Number of primitive Pythagorean quintuples (a, b, c, d, e) with 0 < a <= b <= c <= d <= e <= 10^n.

Original entry on oeis.org

10, 5568, 5302303, 5279762116, 5277410421368, 5277177914347752, 5277147974562930196, 5277145259376056385184, 5277145005746992952994327
Offset: 1

Author

Asif Ahmed, Dec 31 2024

Keywords

Comments

A Pythagorean quintuple (x,y,z,w,u) is a solution to x^2+y^2+z^2+w^2=u^2.

Examples

			a(1) = 10 because there are ten primitive solutions (a, b, c, d, e) as follows: (1, 1, 1, 1, 2), (1, 1, 3, 5, 6), (1, 1, 7, 7, 10), (1, 2, 2, 4, 5), (1, 3, 3, 9, 10), (1, 4, 4, 4, 7), (1, 5, 5, 7, 10), (2, 2, 3, 8, 9), (2, 2, 4, 5, 7), and (2, 4, 5, 6, 9) with e <= 10.
		

Crossrefs

Formula

Limit_{n -> oo} a(n)/ 10^(3*n) = 5/(96*Pi^2) ~ 0.005277144981371758929368722042173314526269...
a(n) ~ 5*10^(3*n)/(96*Pi^2) + (3/A - 1/G)*10^(2*n)/64 + (1/(2*sqrt(3)) - 1/(4*sqrt(2)))*10^n/Pi, where A is the Dirichlet L-function value evaluated at s = 2 for the Dirichlet character with modulus 8 and index 4, and G is the Catalan's constant. (A ~ 1.064734171043503370392827451461668889483, G ~ 0.9159655941772190150546035149323841107741)

A341990 a(n) is the number of primitive solutions to the inverse Pythagorean equation 1/x^2 + 1/y^2 = 1/z^2 such that x <= y and x + y + z <= 10^n.

Original entry on oeis.org

0, 1, 4, 12, 40, 128, 402, 1278, 4040, 12776, 40417, 127803, 404136, 1277995, 4041401, 12779996, 40413886, 127799963
Offset: 1

Author

Asif Ahmed, Feb 25 2021

Keywords

Examples

			For n = 3, the solutions are (20, 15, 12), (156, 65, 60), (136, 255, 120), (600, 175, 168). So a(3) = 4.
		

Programs

  • Mathematica
    a[n_] := Module[{m, l, a, b, s, a2, b2, x, y, z, cnt}, m = 10^n; s = 0; l = 3 * Floor[m^0.25]; cnt = 0; For[a = 1, a <= l, a++, a2 = a * a; For[b = 1, b < a, b++, If[GCD[a, b] == 1 && Mod[a + b, 2] == 1, b2 = b * b; x = 2 * a * b * (a2 + b2); y = a2 * a2 - b2 * b2; z = 2 * a * b * (a2 - b2); If[x + y + z > m, Continue[]]; cnt += 1];]]; cnt];
  • PARI
    a(n) = {my(lim = 3*sqrtnint(10^n, 4), nb = 0); for (x=1, lim, for (y=1, x, if (((x+y) % 2) && (gcd(x,y) == 1), if (2*x*y*(x^2 + y^2) + x^4 - y^4 + 2*x*y*(x^2 - y^2) <= 10^n, nb++);););); nb;} \\ Michel Marcus, Mar 25 2021
  • Python
    from math import gcd
    def fourth_root(n):
        u, s = n, n + 1
        while u < s:
            s = u
            t = 3 * s + n // (s ** 3)
            u = t // 4
        return s
    def a(n):
        N = 10 ** n
        L = fourth_root(N) * 3
        cnt = 0
        for a in range(1, L + 1):
           a2 = a * a
           for b in range(1, a):
               if (a + b) % 2 == 1 and gcd(a, b) == 1:
                   b2 = b * b
                   v = (4 * a * b + a2) * a2 - b2 * b2
                   if v > N:
                       continue
                   cnt += 1
        return cnt
    

Formula

It can be shown that all the primitive solutions are generated from the following parametric form: x = 2*a*b*(a^2+b^2), y = a^4-b^4, z = 2*a*b*(a^2-b^2), where gcd(a, b) = 1 and a + b is odd.
Limit_{n -> oo} a(n)/10^(n/2) = (4/Pi^2)*Integral_{x=sqrt(2)-1..1} 1/sqrt(1+4*x-x^4) ~ 0.1277999513464289283641211182341081978805...