A289559
Number of modulo n residues among sums of two fourth powers.
Original entry on oeis.org
1, 2, 3, 3, 3, 6, 7, 3, 7, 6, 11, 9, 10, 14, 9, 3, 13, 14, 19, 9, 21, 22, 23, 9, 11, 20, 19, 21, 22, 18, 31, 6, 33, 26, 21, 21, 37, 38, 30, 9, 41, 42, 43, 33, 21, 46, 47, 9, 43, 22, 39, 30, 53, 38, 33, 21, 57, 44, 59, 27, 61, 62, 49, 11, 30, 66, 67
Offset: 1
a(7) = 7 because (j^4 + k^4) mod 7, where j and k are integers, can take on all 7 values 0..6; e.g.:
(0^4 + 0^4) mod 7 = ( 0 + 0) mod 7 = 0 mod 7 = 0;
(0^4 + 1^4) mod 7 = ( 0 + 1) mod 7 = 1 mod 7 = 1;
(1^4 + 1^4) mod 7 = ( 1 + 1) mod 7 = 2 mod 7 = 2;
(1^4 + 2^4) mod 7 = ( 1 + 16) mod 7 = 17 mod 7 = 3;
(2^4 + 2^4) mod 7 = (16 + 16) mod 7 = 32 mod 7 = 4;
(1^4 + 3^4) mod 7 = ( 1 + 81) mod 7 = 82 mod 7 = 5;
(2^4 + 3^4) mod 7 = (16 + 81) mod 7 = 97 mod 7 = 6.
a(16) = 3 because (j^4 + k^4) mod 16 can take on only the three values 0, 1, and 2. (This is because j^4 mod 16 = 0 for all even j and 1 for all odd j.)
Cf.
A155918 (gives number of modulo n residues among sums of two squares).
-
f1:= proc(n) option remember; local S;
S:= {seq(x^4 mod n, x=0..n-1)};
nops({seq(seq(S[i]+S[j] mod n,i=1..j),j=1..nops(S))});
end proc:
f:= proc(n) local t;
mul(f1(t[1]^t[2]), t = ifactors(n)[2])
end proc:
map(f, [$1..100]); # Robert Israel, Jul 09 2017
-
f1[n_] := f1[n] = Module[{S = Table[Mod[x^4, n], {x, 0, n-1}] // Union}, Table[Mod[S[[i]] + S[[j]], n], {j, 1, Length[S]}, {i, 1, j}] // Flatten // Union // Length];
f[n_] := Module[{p, e}, Product[{p, e} = pe; f1[p^e], {pe, FactorInteger[n]}]];
Array[f, 100] (* Jean-François Alcover, Jul 30 2020, after Maple *)
-
a(n) = #Set(vector(n^2, i, ((i%n)^4 + (i\n)^4) % n)); \\ Michel Marcus, Jul 08 2017
A305211
a(n) is the number of possible values of (x^3 + y^3) mod n, where x and y are any integers.
Original entry on oeis.org
1, 2, 3, 4, 5, 6, 5, 8, 5, 10, 11, 12, 13, 10, 15, 16, 17, 10, 19, 20, 15, 22, 23, 24, 25, 26, 15, 20, 29, 30, 31, 32, 33, 34, 25, 20, 37, 38, 39, 40, 41, 30, 43, 44, 25, 46, 47, 48, 35, 50, 51, 52, 53, 30, 55, 40, 57, 58, 59, 60, 61, 62, 25, 64, 65, 66, 67
Offset: 1
Cf.
A155918 (with squares instead of cubes).
-
a(n) = my(v=[]); for (x=1, n, for (y=1, n, v = concat(v, Mod(x, n)^3 + Mod(y, n)^3))); #Set(v); \\ Michel Marcus, Jul 10 2018
-
a(n) = {my(v = Set(vector(n, i, i^3%n)), l); if(#v == n, return(n) , res = vector(n); for(i = 1, #v, for(j = i, #v, res[1 + (v[i] + v[j]) % n] = 1 ) ); vecsum(res) ) } \\ David A. Corneth, May 22 2020
-
[len(set((pow(x,3,n)+pow(y,3,n))%n for x in range(n) for y in range(x+1))) for n in range(1,51)]
A289630
Number of modulo n residues among sums of two sixth powers.
Original entry on oeis.org
1, 2, 3, 3, 5, 6, 3, 3, 3, 10, 11, 9, 5, 6, 15, 5, 17, 6, 10, 15, 9, 22, 23, 9, 25, 10, 7, 9, 29, 30, 16, 9, 33, 34, 15, 9, 19, 20, 15, 15, 41, 18, 29, 33, 15, 46, 47, 15, 15, 50, 51, 15, 53, 14, 55, 9, 30, 58, 59, 45, 51, 32, 9, 17, 25, 66, 56, 51, 69, 30, 71
Offset: 1
a(5) = 5 because (j^6 + k^6) mod 5, where j and k are integers, can take on all 5 values 0..4; e.g.:
(1^6 + 2^6) mod 5 = ( 1 + 64) mod 5 = 65 mod 5 = 0;
(0^6 + 1^6) mod 5 = ( 0 + 1) mod 5 = 1 mod 5 = 1;
(1^6 + 1^6) mod 5 = ( 1 + 1) mod 5 = 2 mod 5 = 2;
(2^6 + 2^6) mod 5 = (64 + 64) mod 5 = 128 mod 5 = 3;
(0^6 + 2^6) mod 5 = ( 0 + 64) mod 5 = 64 mod 5 = 4.
a(7) = 3 because (j^6 + k^6) mod 7 can take on only the three values 0, 1, and 2. (This is because j^6 mod 7 = 0 for all j divisible by 7, 1 otherwise.)
Cf.
A057760,
A155918 (gives number of modulo n residues among sums of two squares),
A289559 (Number of modulo n residues among sums of two fourth powers).
A305191
Table read by rows: T(n,k) is the number of pairs (x,y) mod n such that x^2 + y^2 == k (mod n), for k from 0 to n-1.
Original entry on oeis.org
1, 2, 2, 1, 4, 4, 4, 8, 4, 0, 9, 4, 4, 4, 4, 2, 8, 8, 2, 8, 8, 1, 8, 8, 8, 8, 8, 8, 8, 16, 16, 0, 8, 16, 0, 0, 9, 12, 12, 0, 12, 12, 0, 12, 12, 18, 8, 8, 8, 8, 18, 8, 8, 8, 8, 1, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 4, 32, 16, 0, 16, 32, 4, 0, 16, 8, 16, 0, 25, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12
Offset: 1
Table begins:
1;
2, 2;
1, 4, 4;
4, 8, 4, 0;
9, 4, 4, 4, 4;
2, 8, 8, 2, 8, 8;
1, 8, 8, 8, 8, 8, 8;
8, 16, 16, 0, 8, 16, 0, 0;
9, 12, 12, 0, 12, 12, 0, 12, 12;
E.g., for n = 4:
4 pairs satisfy x^2 + y^2 = 4k: (0, 0), (0, 2), (2, 0), (2, 2)
8 pairs satisfy x^2 + y^2 = 4k+1: (0, 1), (0, 3), (1, 0), (1, 2), (2, 1), (2, 3), (3, 0), (3, 2)
4 pairs satisfy x^2 + y^2 = 4k+2: (1, 1), (1, 3), (3, 1), (3, 3)
0 pairs satisfy x^2 + y^2 = 4k+3
Cf.
A155918 (number of nonzeros in row n).
-
row(n) = {v = vector(n); for (x=0, n-1, for (y=0, n-1, k = (x^2 + y^2) % n; v[k+1]++;);); v;} \\ Michel Marcus, Jun 08 2018
-
T(n,k)=
{
my(r=1, f=factor(n));
for(j=1, #f[, 1], my(p=f[j, 1], e=f[j, 2], b=valuation(k,p));
if(p==2, r*=if(b>=e-1, 2^e, if((k/2^b)%4==1, 2^(e+1), 0)));
if(p%4==1, r*=if(b>=e, ((p-1)*e+p)*p^(e-1), (b+1)*(p-1)*p^(e-1)));
if(p%4==3, r*=if(b>=e, p^(e-(e%2)), if(b%2, 0, (p+1)*p^(e-1))));
);
return(r);
}
tabl(nn) = for(n=1, nn, for(k=0, n-1, print1(T(n, k), ", ")); print()) \\ Jianing Song, Apr 20 2019
-
[[len([(x, y) for x in range(n) for y in range(n) if (pow(x,2,n)+pow(y,2,n))%n==d]) for d in range(n)] for n in range(1,10)]
A367484
Number of integers of the form (x^4 + y^4) mod 3^n; a(n) = A289559(3^n).
Original entry on oeis.org
1, 3, 7, 19, 55, 165, 493, 1477, 4429, 13287, 39859, 119575, 358723, 1076169, 3228505, 9685513, 29056537
Offset: 0
-
a(n) = #setbinop((x, y)->Mod(x,3^n)^4+Mod(y,3^n)^4, [0..3^n-1]);
-
def A367484(n):
m = 3**n
return len({(pow(x,4,m)+pow(y,4,m))%m for x in range(m) for y in range(x+1)}) # Chai Wah Wu, Jan 23 2024
Showing 1-5 of 5 results.
Comments