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-1 of 1 results.

A376691 The number of solutions to x + y == x^2 + y^2 == x^3 + y^3 (mod n) with 0 <= x <= y < n.

Original entry on oeis.org

1, 3, 3, 5, 3, 10, 3, 7, 5, 10, 3, 16, 3, 10, 10, 7, 3, 18, 3, 16, 10, 10, 3, 24, 7, 10, 5, 16, 3, 36, 3, 11, 10, 10, 10, 28, 3, 10, 10, 24, 3, 36, 3, 16, 18, 10, 3, 24, 9, 26, 10, 16, 3, 18, 10, 24, 10, 10, 3, 56, 3, 10, 18, 11, 10, 36, 3, 16, 10, 36
Offset: 1

Views

Author

W. Edwin Clark, Oct 01 2024

Keywords

Comments

This is the same as the number of solutions to x + y == x^2 + y^2 == x^3+y^3 == x^4 + y^4 (mod n) with x <=y. Proved by Sahaj in Math StackExchange link.

Crossrefs

Cf. A376646.

Programs

  • Maple
    a:=proc(n)
     local x,y,count;
      count:=0:
      for x from 0 to n-1 do
       for y from x to n-1 do
         if (x+y) mod n =(x^2+y^2) mod n and (x+y) mod n =(x^3+y^3) mod n then count:=count+1;  fi;
       od:
      od:
      count;
    end:
  • Python
    def A376691(n):
        c = 0
        for x in range(n):
            m = x*(1-x)%n
            c += sum(1 for y in range(x,n) if y*(y-1)%n == m and not m*(x-y)%n)
        return c # Chai Wah Wu, Oct 02 2024
Showing 1-1 of 1 results.