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.

A254073 Number of solutions to x^3 + y^3 + z^3 == 1 (mod n) for 1 <= x, y, z <= n.

Original entry on oeis.org

1, 4, 9, 16, 25, 36, 90, 64, 162, 100, 121, 144, 252, 360, 225, 256, 289, 648, 468, 400, 810, 484, 529, 576, 625, 1008, 1458, 1440, 841, 900, 1143, 1024, 1089, 1156, 2250, 2592, 1602, 1872, 2268, 1600, 1681, 3240, 2115, 1936, 4050, 2116, 2209, 2304, 4410
Offset: 1

Views

Author

Keywords

Comments

It appears that a(n) = n^2 for n in A088232 (numbers n such that 3 does not divide phi(n)) and that a(n) != n^2 for n in A066498 (numbers n such that 3 divides phi(n)). - Michel Marcus, Mar 13 2015
It appears that a(p) != p^2 for primes in A002476 (primes of form 6m + 1). - Michel Marcus, Mar 13 2015

Crossrefs

Cf. A087412.

Programs

  • Mathematica
    a[n_] := Sum[ If[ Mod[x^3 + y^3 + z^3, n] == 1, 1, 0], {x, n}, {y, n}, {z, n}]; a[1]=1; Table[a[n], {n, 2,22}]
  • PARI
    a(n) = {nb = 0; for (x=1, n, for (y=1, n, for (z=1, n, if ((Mod(x^3,n) + Mod(y^3,n) + Mod(z^3,n)) % n == Mod(1, n), nb ++);););); nb;} \\ Michel Marcus, Mar 11 2015
    
  • PARI
    a(n)={my(p=Mod(sum(i=0, n-1, x^(i^3%n)), 1-x^n)^3); polcoeff(lift(p), 1%n)} \\ Andrew Howroyd, Jul 18 2018
    
  • Python
    def A254073(n):
        ndict = {}
        for i in range(n):
            m = pow(i,3,n)
            if m in ndict:
                ndict[m] += 1
            else:
                ndict[m] = 1
        count = 0
        for i in ndict:
            ni = ndict[i]
            for j in ndict:
                k = (1-i-j) % n
                if k in ndict:
                    count += ni*ndict[j]*ndict[k]
        return count # Chai Wah Wu, Jun 06 2017