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: David Roggeveen Byrne

David Roggeveen Byrne's wiki page.

David Roggeveen Byrne has authored 2 sequences.

A374263 Number of distinct primitive Pythagorean triples (j^2 - k^2, 2*j*k, j^2 + k^2) where 1 <= k < j <= n.

Original entry on oeis.org

1, 2, 4, 6, 8, 11, 15, 18, 22, 27, 31, 37, 43, 47, 55, 63, 69, 78, 86, 92, 102, 113, 121, 131, 143, 152, 164, 178, 186, 201, 217, 227, 243, 255, 267, 285, 303, 315, 331, 351, 363, 384, 404, 416, 438, 461, 477, 498
Offset: 2

Author

David Roggeveen Byrne, Jul 01 2024

Keywords

Comments

Triples of this form are primitive and distinct when j,k are coprime (i.e., gcd(j,k) = 1) and of opposite parity (i.e., j+k == 0 (mod 2)).

Examples

			For n=5, the possible pairs for j,k are
              Generated  Primitive      As it's included on
               triple     triple        the list, is it new?
  j=2, k=1 ->  3, 4, 5    3, 4, 5            Yes
  j=3, k=1 ->  8, 6,10    3, 4, 5            No
  j=3, k=2 ->  5,12,13    5,12,13            Yes
  j=4, k=1 -> 15, 8,17    8,15,17            Yes
  j=4, k=2 -> 12,16,20    3, 4, 5            No
  j=4, k=3 ->  7,24,25    7,24,25            Yes
  j=5, k=1 -> 24,10,26    5,12,13            No
  j=5, k=2 -> 21,20,29   20,21,29            Yes
  j=5, k=3 -> 16,30,34    8,15,17            No
  j=5, k=4 ->  9,40,41    9,40,41            Yes
Among these there are a(5) = 6 distinct primitive triples.
		

Crossrefs

Programs

  • Python
    from sympy import totient
    def A374263(n): return (sum(totient(n) for n in range(1,n+1,2))>>1) + sum(totient(n) for n in range(2,n+1,2)) # Chai Wah Wu, Aug 04 2024

Formula

a(n) = Sum_{i=2..n} A055034(i).
a(n) = (A049690(n) - 1)/2. - Hugo Pfoertner, Jul 16 2024

A160255 The sum of all the entries in an n X n Cayley table for multiplication in Z_n.

Original entry on oeis.org

0, 1, 6, 16, 40, 63, 126, 176, 270, 365, 550, 624, 936, 1099, 1350, 1664, 2176, 2349, 3078, 3280, 3948, 4631, 5566, 5712, 7000, 7813, 8748, 9520, 11368, 11475, 13950, 14592, 16236, 17969, 19390, 20304, 23976, 25327, 27222, 28400, 32800, 32949, 37926, 38896
Offset: 1

Author

David Byrne (david.roggeveen.byrne(AT)gmail.com), May 06 2009

Keywords

Comments

Thanks to David Miller.

Examples

			For n=4:
   | 0 1 2 3
  -+--------
  0| 0 0 0 0
  1| 0 1 2 3
  2| 0 2 0 2
  3| 0 3 2 1
Sum becomes 6+4+6 = 16.
		

Crossrefs

Programs

Formula

a(p) = (p-1)*(p^2-p)/2, for p prime.
a(n) = (n/2)*Sum_{i=1..n-1} gcd(n,i)*(n/gcd(n,i)-1). [Edited by Richard L. Ollerton, May 06 2021]
a(n) = (n^2/2)*Sum_{d|n} phi(d)*(d-1)/d, where phi = A000010. - Richard L. Ollerton, May 06 2021
From Ridouane Oudra, Aug 24 2022: (Start)
a(n) = Sum_{i=1..n} Sum_{j=1..n} (i*j mod n);
a(n) = n^3/2 - (n/2)*Sum_{i=1..n} gcd(n,i);
a(n) = n^3/2 - (n/2)*Sum_{d|n} d*tau(d)*moebius(n/d);
a(n) = (A000578(n) - n*A018804(n))/2. (End)

Extensions

More terms from Carl Najafi, Sep 29 2011