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

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

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

Original entry on oeis.org

1, 8, 27, 64, 125, 216, 336, 512, 1296, 1000, 1331, 1728, 1794, 2688, 3375, 4096, 4913, 10368, 7410, 8000, 9072, 10648, 12167, 13824, 15625, 14352, 34992, 21504, 24389, 27000, 30225, 32768, 35937, 39304, 42000, 82944, 48396, 59280, 48438, 64000, 68921, 72576, 77529, 85184, 162000, 97336
Offset: 1

Views

Author

Keywords

Comments

It appears that a(n) = n^3 for n in A088232. See also A066498. - Michel Marcus, Oct 11 2016

Crossrefs

Programs

  • Mathematica
    JJJ[4, n, lam] = Sum[If[Mod[a^3 + b^3 + c^3 + d^3, n] == Mod[lam, n], 1, 0], {d, 0, n - 1}, {a, 0, n - 1}, {b, 0, n - 1}, {c, 0 , n - 1}]; Table[JJJ[4, n, 1], {n, 1, 50}]
  • PARI
    a(n) = sum(x=1, n, sum(y=1, n, sum(z=1, n, sum(t=1, n, Mod(x,n)^3 + Mod(y,n)^3 + Mod(z,n)^3 + Mod(t,n)^3 == 1)))); \\ Michel Marcus, Oct 11 2016
    
  • PARI
    qperms(v) = {my(r=1,t); v = vecsort(v); for(i=1,#v-1, if(v[i]==v[i+1], t++, r*=binomial(i,t+1);t=0));r*=binomial(#v,t+1)}
    a(n) = {my(t=0); forvec(v=vector(4,i,[1,n]), if(sum(i=1, 4, Mod(v[i], n)^3)==1, print1(v", "); t+=qperms(v)),1);t} \\ David A. Corneth, Oct 11 2016
    
  • Python
    def A276919(n):
        ndict = {}
        for i in range(n):
            i3 = pow(i,3,n)
            for j in range(i+1):
                j3 = pow(j,3,n)
                m = (i3+j3) % n
                if m in ndict:
                    if i == j:
                        ndict[m] += 1
                    else:
                        ndict[m] += 2
                else:
                    if i == j:
                        ndict[m] = 1
                    else:
                        ndict[m] = 2
        count = 0
        for i in ndict:
            j = (1-i) % n
            if j in ndict:
                count += ndict[i]*ndict[j]
        return count # Chai Wah Wu, Jun 06 2017

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

Original entry on oeis.org

1, 8, 27, 72, 125, 216, 595, 704, 1539, 1000, 1331, 1944, 3133, 4760, 3375, 5632, 4913, 12312, 8911, 9000, 16065, 10648, 12167, 19008, 16125, 25064, 45927, 42840, 24389, 27000, 35371, 47104, 35937, 39304, 74375, 110808, 58645, 71288, 84591, 88000
Offset: 1

Views

Author

Keywords

Comments

a(n) = n^3 if n is in A074243. - Robert Israel, Oct 13 2016

Examples

			For n = 3, we see that all nondecreasing solutions {x, y, z, t} are in {{1, 1, 1, 3}, {1, 1, 2, 2}, {1, 2, 3, 3}, {2, 2, 2, 3}, {3, 3, 3, 3}}. The numbers in the sets can be ordered in 4, 6, 12, 4 and 1 ways respectively. Therefore, a(3) = 4 + 6 + 12 + 4 + 1 = 27. - _David A. Corneth_, Oct 11 2016
		

Crossrefs

Programs

  • Maple
    CF:= table([[false, false, true] = 12, [true, false, false] = 12, [true, false, true] = 6, [false, false, false] = 24, [true, true, true] = 1, [false, true, true] = 4, [false, true, false] = 12, [true, true, false] = 4]):
    f1:= proc(n)
      option remember;
      local count, t, x,y,z,signature;
      if isprime(n) and n mod 3 = 2 then return n^3 fi;
      count:= 0;
      for t from 1 to n do
        for x from 1 to t do
          for y from 1 to x do
            for z from 1 to y do
              if t^3 + x^3 + y^3 + z^3 mod n = 0 then
                signature:= map(evalb,[z=y,y=x,x=t]);
                count:= count + CF[signature];
              fi
      od od od od;
      count
    end proc:
    f:= proc(n) local t;
        mul(f1(t[1]^t[2]),t=ifactors(n)[2])
    end proc:
    map(f, [$1..40]); # Robert Israel, Oct 13 2016
  • Mathematica
    JJJ[4, n, lam] = Sum[If[Mod[a^3 + b^3 + c^3 + d^3, n] == Mod[lam, n], 1, 0], {d, 0, n - 1}, {a, 0, n - 1}, {b, 0, n - 1}, {c, 0 , n - 1}]; Table[JJJ[4, n, 0], {n, 1, 50}]
  • PARI
    a(n) = sum(x=1, n, sum(y=1, n, sum(z=1, n, sum(t=1, n, Mod(x,n)^3 + Mod(y,n)^3 + Mod(z,n)^3 + Mod(t,n)^3 == 0)))); \\ Michel Marcus, Oct 11 2016
    
  • PARI
    qperms(v) = {my(r=1,t); v = vecsort(v); for(i=1,#v-1, if(v[i]==v[i+1], t++, r*=binomial(i, t+1);t=0));r*=binomial(#v,t+1)}
    a(n) = {my(t=0); forvec(v=vector(4,i,[1,n]), if(sum(i=1,4,Mod(v[i],n)^3)==0, t+=qperms(v)),1);t} \\ David A. Corneth, Oct 11 2016
    
  • Python
    def A276920(n):
        ndict = {}
        for i in range(n):
            i3 = pow(i,3,n)
            for j in range(i+1):
                j3 = pow(j,3,n)
                m = (i3+j3) % n
                if m in ndict:
                    if i == j:
                        ndict[m] += 1
                    else:
                        ndict[m] += 2
                else:
                    if i == j:
                        ndict[m] = 1
                    else:
                        ndict[m] = 2
        count = 0
        for i in ndict:
            j = (-i) % n
            if j in ndict:
                count += ndict[i]*ndict[j]
        return count # Chai Wah Wu, Jun 06 2017
Showing 1-3 of 3 results.