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

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

Views

Author

Jon E. Schoenfield, Jul 08 2017

Keywords

Comments

Conjecture: the only primes p for which a(p) < p are 5, 13, 17, 29. - Robert Israel, Jul 09 2017
Conjecture is true: see Math Overflow link. - Robert Israel, Apr 01 2020

Examples

			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.)
		

Crossrefs

Cf. A155918 (gives number of modulo n residues among sums of two squares).

Programs

  • Maple
    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
  • Mathematica
    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 *)
  • PARI
    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

Views

Author

Jack Zhang, May 27 2018

Keywords

Comments

Conjecture: keyword mult applies. Furthermore a procedure to find a(n) is as follows: if n = 7k then n -> 5*n/7. if n = 9k then n-> 5*n/9. return(n). - David A. Corneth, May 22 2020

Crossrefs

Cf. A155918 (with squares instead of cubes).

Programs

  • PARI
    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
    
  • PARI
    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
  • Python
    [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)]
    

Extensions

a(50)-a(67) from Jon E. Schoenfield, May 28 2018

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

Views

Author

Jon E. Schoenfield, Jul 08 2017

Keywords

Comments

This sequence appears to be multiplicative (verified through n = 10000).
This sequence is multiplicative. In general, by the Chinese remainder theorem, the number of distinct residues modulo n among the values of any multivariate polynomial with integer coefficients will be multiplicative. - Andrew Howroyd, Aug 01 2018

Examples

			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.)
		

Crossrefs

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).

Programs

  • PARI
    a(n) = #Set(vector(n^2, i, ((i%n)^6 + (i\n)^6) % n)); \\ Michel Marcus, Jul 10 2017

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

Views

Author

Jack Zhang, May 27 2018

Keywords

Examples

			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
		

Crossrefs

Cf. A155918 (number of nonzeros in row n).
Cf. A086933 (1st column), A060968 (2nd column), A086932 (right diagonal).

Programs

  • PARI
    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
    
  • PARI
    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
  • Python
    [[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)]
    

Formula

T(n,k) is multiplicative with respect to n, that is, if gcd(n,m)=1 then T(n*m,k) = T(n,k mod n)*T(m,k mod m).
T(n,0) = A086933(n). Let n = p^e and k = r*p^b (0 <= b < e, gcd(r,p) = 1, 0 < k < n). For p == 1 (mod 4), T(n,k) = (b+1)*(p-1)*p^(e-1). For p == 3 (mod 4), T(n,k) = (p+1)*p^(e-1) if b even; 0 if b odd. For p = 2, T(n,k) = 2^e if k = 2^(e-1); 2^(e+1) if b <= e-2 and r == 1 (mod 4); 0 if r == 3 (mod 4). [Corrected by Jianing Song, Apr 20 2019]
If p is an odd prime then T(p,k) = p - (-1)^(p-1)/2 if k > 0, otherwise p + (p-1)*(-1)^(p-1)/2.

Extensions

Offset corrected by Jianing Song, Apr 20 2019

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

Views

Author

Albert Mukovskiy, Nov 19 2023

Keywords

Comments

It appears that for n > 4: a(n) = 2*3^(n-1) + a(n-4).
For n < 5: a(n) = 2*3^(n-1) + 1.
Conjecture in closed form: a(n) = 2*ceiling(3^(n+3)/80) - 1.

Crossrefs

Subsequence of A289559.

Programs

  • PARI
    a(n) = #setbinop((x, y)->Mod(x,3^n)^4+Mod(y,3^n)^4, [0..3^n-1]);
    
  • Python
    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

Formula

Conjecture: a(n) = 2*ceiling(3^(n+3)/80) - 1.
a(n) = A289559(3^n). - Thomas Scheuerle, Nov 20 2023
Showing 1-5 of 5 results.