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

A366418 Number of distinct integers of the form (x^n + y^n) mod n.

Original entry on oeis.org

1, 2, 3, 3, 5, 6, 7, 3, 5, 10, 11, 9, 13, 14, 15, 3, 17, 6, 19, 9, 15, 22, 23, 9, 13, 26, 5, 21, 29, 30, 31, 3, 33, 34, 35, 9, 37, 38, 39, 9, 41, 18, 43, 33, 25, 46, 47, 9, 19, 10, 51, 30, 53, 6, 25, 21, 57, 58, 59, 27, 61, 62, 25, 3, 65, 66, 67, 39, 69, 70, 71, 9, 73, 74, 39
Offset: 1

Views

Author

Albert Mukovskiy, Oct 11 2023

Keywords

Comments

a(p) = p when p is prime. It appears that a(n) stabilizes for the subsequences n = k^m for each fixed k > 1 at large enough m.
a(n) = n if there are more than n/2 distinct integers x^n mod n. - David A. Corneth, Oct 16 2023

Crossrefs

Programs

  • PARI
    { a(n) = my(S,t); S=Set(); for(x=0, n-1, for(y=x, n-1, t=lift(Mod(x,n)^n+Mod(y,n)^n); S=setunion(S,[t]); ); ); #S }
    
  • PARI
    a(n) = #setbinop((x,y)->Mod(x,n)^n+Mod(y,n)^n, [0..n-1]); \\ Michel Marcus, Oct 12 2023
    
  • PARI
    See PARI link \\ David A. Corneth, Oct 16 2023

A366420 Number of distinct integers of the form (x^n + y^n) mod n^4.

Original entry on oeis.org

1, 9, 45, 35, 325, 95, 931, 259, 1215, 625, 6171, 627, 12337, 2210, 14625, 2049, 32657, 2435, 58843, 1683, 11025, 12105, 140185, 4883, 40625, 16055, 32805, 14586, 236321, 11875, 375751, 16385, 277695, 59245, 302575, 16071, 789913, 97475, 98865, 13107, 1413721, 9405, 1399693
Offset: 1

Views

Author

Albert Mukovskiy, Oct 11 2023

Keywords

Comments

It is enough to take x,y from {0,1,...,n^3-1}.
It appears that the number of distinct integers of the form x^(p^k) + y^(p^k) (mod (p^k)^m) for a prime p>2 and natural k is A121278(p)*p^(k-1)*p^(k*(m-2)) for m>1. For m=1 see A366418.
It appears that the number of distinct integers of the form x^n + y^n (mod n^m) for an odd n, m>1 is A121278(n)*n^(m-2).

Crossrefs

Programs

  • PARI
    a(n) = #setbinop((x, y)->Mod(x, n^4)^n+Mod(y, n^4)^n, [0..n^3-1]); \\ Michel Marcus, Oct 14 2023
    
  • Python
    def A366420(n):
        m = n**4
        return len({(pow(x,n,m)+pow(y,n,m))%m for x in range(n**3) for y in range(x+1)}) # Chai Wah Wu, Nov 12 2023
Showing 1-2 of 2 results.