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.

A350459 Number of positive rational points on the unit circle with denominator <= n and numerator >= 1.

Original entry on oeis.org

0, 0, 0, 0, 1, 1, 1, 1, 1, 4, 4, 4, 5, 5, 10, 10, 11, 11, 11, 19, 19, 19, 19, 19, 29, 32, 32, 32, 33, 44, 44, 44, 44, 47, 60, 60, 61, 61, 66, 82, 83, 83, 83, 83, 100, 100, 100, 100, 100, 122, 127, 134, 135, 135, 156, 156, 156, 159, 159, 183, 184, 184, 184, 184, 220, 220, 220, 227, 227, 254
Offset: 1

Views

Author

Benoit Cloitre, Jan 01 2022

Keywords

Comments

A rational point (x,y) is of the form (a/c, b/d) with (a,b,c,d) integers. Sequence gives the number of quadruples (a,b,c,d) satisfying a >= b >= 1, 1 <= c <= n, 1 <= d <= n and such that a^2/c^2 + b^2/d^2 = 1.

Crossrefs

Cf. A046109.

Programs

  • PARI
    a(n)=sum(a=1,n,sum(b=1,a,sum(c=1,n,sum(d=1,n,if(a^2/c^2+b^2/d^2-1,0,1)))))
    
  • Python
    def A350459(n): return sum(1 for d in range(1,n+1) for c in range(1,n+1) for b in range(1,d+1) for a in range(1, b+1) if (a*d)**2 + (b*c)**2 == (c*d)**2) # Chai Wah Wu, Jan 19 2022