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.

Previous Showing 11-15 of 15 results.

A337111 Number of length four 1..n vectors that contain their geometric mean.

Original entry on oeis.org

1, 2, 3, 16, 17, 18, 19, 56, 105, 106, 107, 144, 145, 146, 147, 208, 209, 306, 307, 320, 321, 322, 323, 432, 529, 530, 723, 736, 737, 738, 739, 968, 969, 970, 971, 1176, 1177, 1178, 1179, 1288, 1289, 1290, 1291, 1304, 1401, 1402, 1403, 1608, 1777, 2018, 2019, 2032
Offset: 1

Views

Author

Hywel Normington, Aug 16 2020

Keywords

Comments

From David A. Corneth, Aug 27 2020: (Start)
Let (a, b, g, n) be a tuple where g is the geometric mean of a*b*g*n and a, b, g <= n. Then there are two cases: g < n and g = n.
If g = n then (a, b, g, n) = (n, n, n, n) adding 1 to the number of permutations.
If g < n then a*b = g^4 / (g*n) = g^3 / n. Furthermore let s be the squarefree part of n (Cf. A007947). Then s | g and so candidates for g are (s*i) where 1 <= i < floor(n/s), depending on whether g^3 / n = (s*i)^3 / n is an integer.
It follows that for suitable values of i, (a, b) are a pair of divisors of (s*i)^3 / n where a*b = (s*i)^3 / n and max(a, b) <= n. (End)
Bounds: n + 12*(floor(n/4) + 2*floor(n/8) + 4*floor(n/9) + 2*floor(n/12) + 2*floor(n/16) + 4*floor(n/18)) <= a(n) <= n^4 - 14*(n-1). - Hywel Normington, Jan 25 2021

Examples

			For n = 2 the a(2) = 2 solutions are: (1,1,1,1) and (2,2,2,2).
For n = 4 the a(4) = 16 solutions are:
  (1, 1, 1, 1), (2, 2, 2, 2), (3, 3, 3, 3), (4, 4, 4, 4),
  and the 12 permutations of (1, 2, 2, 4).
For n = 40, the a(40)-a(39) = 109 new solutions are:
  (40,40,40,40),
  the 24 permutations of (1, 10, 25, 40),
  the 12 permutations of (5, 5, 10, 40),
  the 12 permutations of (5, 20, 40, 40),
  the 24 permutations of (8, 20, 25, 40),
  the 12 permutations of (10, 20, 20, 40),
  and the 24 permutations of (25, 27, 30, 40).
		

Crossrefs

Programs

  • PARI
    first(n) = { my(res = vector(n)); s = 0; for(i = 1, n, s += b(i);  res[i] = s; ); res }
    b(n) = {my(resa = 1); my(s = factorback(factor(n)[, 1])); for(i = 1, n \ s - 1, s4 = (s*i)^3; if(s4 % n == 0, c = tuples((s*i)^3/n, s*i, n); for(i = 1, #c, resa+=qperms(c[i]) ) ) ); resa }
    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)}
    tuples(n, s, u) = {my(res = List(), u4n, d, i); d = divisors(n); i = (#d + 1) \ 2; while(i > 0 && d[#d - i + 1] <= u, c = vecsort([d[i], d[#d - i + 1], s, u]); listput(res, c); i--); res} \\ David A. Corneth, Aug 28 2020

Formula

Empirical: if A000189(n) = 1 then a(n) = a(n-1) + 1.
From David A. Corneth, Aug 25 2020: (Start)
The above holds. That is: if x^3 == 0 (mod n) has only one solution then a(n) = a(n-1) + 1. Proof:
Let (a, b, c, n) be such a tuple. Let without loss of generality c be the geometric mean of the tuple. Then a*b*c*n = c^4 and as c is not 0 we have c^3 = a*b*n. So then c^3 == 0 (mod n). If c^3 == 0 (mod n) has only 1 solution then c = n. This gives the tuple (n, n, n, n) which has 1 permutation. So giving a(n) = a(n-1) + 1. (End)
a(n) - a(n-1) == 1 (mod 12). - Hywel Normington, Sep 28 2020

A137401 a(n) is the number of ordered solutions (x,y,z) to x^3 + y^3 == z^3 mod n with 1 <= x,y,z <= n-1.

Original entry on oeis.org

0, 0, 2, 7, 12, 20, 0, 63, 116, 72, 90, 131, 0, 108, 182, 339, 240, 602, 324, 415, 326, 420, 462, 839, 604, 216, 1808, 763, 756, 812, 810, 1735, 992, 1056, 1092, 3311, 648, 1620, 650, 2511, 1560, 1640, 1134, 2227, 4328, 1980, 2070, 3683, 2484, 2644, 2450, 1519
Offset: 1

Views

Author

Neven Juric (neven.juric(AT)apis-it.hr), Apr 11 2008

Keywords

Comments

Record values of A137401: 0, 2, 7, 12, 20, 63, 116, 131, 182, 339, 602, 839, 1808, 3311, 4328, 7964, 8864, 9231, 19583, 21986, 41363, 52676, 81467, 87596, 92087, 112616, 236951, 247940, 378071, 386423, 521135, ... - Robert G. Wilson v

Examples

			a(4)=7 because (1, 2, 1), (1, 3, 2), (2, 1, 1), (2, 2, 2), (2, 3, 3), (3, 1, 2), (3, 2, 3) are solutions for n=4.
		

Crossrefs

Cf. A063454.

Programs

  • Mathematica
    f[n_] := Block[ {c = 0}, Do[ If[ Mod[x^3 + y^3, n] == Mod[z^3, n], c++ ], {x, n - 1}, {y, n - 1}, {z, n - 1}]; c];
    Table[Length[Select[Tuples[Range[n - 1], 3], Mod[ #[[1]]^3 + #[[2]]^3 - #[[3]]^3, n] == 0 &]], {n, 2, 50}] (* Stefan Steinerberger, Apr 12 2008 *)
  • Python
    def A137401(n):
        ndict = {}
        for i in range(1,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 = (i+j) % n
                if k in ndict:
                    count += ni*ndict[j]*ndict[k]
        return count # Chai Wah Wu, Jun 06 2017

Formula

a(n) = A063454(n)-3*A087786(n)+3*A000189(n)-1. - Vladeta Jovovic, Apr 11 2008

Extensions

More terms from Stefan Steinerberger and Robert G. Wilson v, Apr 12 2008

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

A372882 a(n) = Sum_{k=1..n} gcd(k^3,n).

Original entry on oeis.org

1, 3, 5, 10, 9, 15, 13, 36, 33, 27, 21, 50, 25, 39, 45, 104, 33, 99, 37, 90, 65, 63, 45, 180, 145, 75, 261, 130, 57, 135, 61, 336, 105, 99, 117, 330, 73, 111, 125, 324, 81, 195, 85, 210, 297, 135, 93, 520, 385, 435, 165, 250, 105, 783, 189, 468, 185, 171, 117, 450
Offset: 1

Views

Author

Seiichi Manyama, May 15 2024

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := Sum[GCD[k^3, n], {k, 1, n}]; Array[a, 100] (* Amiram Eldar, May 24 2024 *)
  • PARI
    a(n) = sum(k=1, n, gcd(k^3, n));

Formula

From Amiram Eldar, May 24 2024: (Start)
a(n) = n * Sum_{d|n} A000010(d)*A000189(d)/d (Tóth, 2011).
Multiplicative with a(p^e) = p^e * (1 + ((p-1)/p) * Sum_{i=1..e} p^(floor(2*i/3))). (End)
Previous Showing 11-15 of 15 results.