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

A096107 Triangle read by rows: row n lists cubic residues modulo n.

Original entry on oeis.org

1, 1, 2, 1, 3, 1, 2, 3, 4, 1, 5, 1, 6, 1, 3, 5, 7, 1, 8, 1, 3, 7, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 5, 7, 11, 1, 5, 8, 12, 1, 13, 1, 2, 4, 7, 8, 11, 13, 14, 1, 3, 5, 7, 9, 11, 13, 15, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 1, 17, 1, 7, 8, 11, 12, 18, 1, 3, 7, 9, 11, 13, 17, 19, 1, 8
Offset: 2

Views

Author

Cino Hilliard, Jul 22 2004

Keywords

Comments

Row n has A087692(n) terms. - Robert Israel, Jan 04 2015

Examples

			1;
1,2;
1,3;
1,2,3,4;
1,5;
1,6;
1,3,5,7;
1,8;
1,3,7,9;
Row 5 contains 1,2,3,4 because (in mod 5)  1^3 = 1, 3^3 = 2, 2^3 = 3, and 4^3 = 4. - _Geoffrey Critzer_, Jan 07 2015
		

Crossrefs

Programs

  • Maple
    for n from 2 to 30 do
      op({seq(`if`(igcd(i,n)=1,i^3 mod n,NULL),i=1..n-1)})
    # if using Maple 11 or earlier, replace this by
    #   op(sort(convert({seq(`if`(igcd(i,n)=1,i^3 mod n,NULL),i=1..n-1)},list)))
    od; # Robert Israel, Jan 04 2015
  • Mathematica
    Table[Select[Range[n],
       CoprimeQ[#, n] && IntegerQ[PowerMod[#, 1/3, n]] &], {n, 1, 20}] // Grid
    (* Geoffrey Critzer, Jan 04 2015 *)
  • PARI
    maybecubegcd1(n) = { for(x=2,n, b=floor(x-1); a=vector(b+1); for(y=1,b, z=y^3%x; if(z<>0, a[y]=z; ) ); s=vecsort(a); c=1; for(j=2,b+1, if(s[j]<>s[j-1], c++; if(gcd(s[j],x)==1,print1(s[j]",")) ) ); ) }

Extensions

Edited by Don Reble, May 07 2006

A337596 Largest m such that k^n (mod m) is always either 0, +1, or -1.

Original entry on oeis.org

3, 5, 9, 16, 11, 13, 4, 32, 27, 25, 23, 16, 4, 29, 31, 64, 4, 37, 4, 41, 49, 23, 47, 32, 11, 53, 81, 29, 59, 61, 4, 128, 67, 8, 71, 73, 4, 8, 79, 41, 83, 49, 4, 89, 31, 47, 4, 97, 4, 125, 103, 53, 107, 109, 121, 113, 9, 59, 4, 61, 4, 8, 127, 256, 131, 67, 4, 137
Offset: 1

Views

Author

Elliott Line, Sep 02 2020

Keywords

Comments

For a given n, for all k, k^n mod a(n) will always be either 0, 1 or a(n)-1. This will not be true for numbers larger than a(n).
It appears that a(m) = 4 for m in A045979. - Michel Marcus, Sep 04 2020

Examples

			For n = 5 all fifth powers of natural numbers: 1,32,243,1024, etc. are either a multiple of 11, or 1 greater or 1 less than a multiple of 11. There is no greater number than 11 for which all fifth powers are at most 1 different from a multiple. So a(5) = 11.
		

Crossrefs

Cf. residues: A096008 (for n=2), A096087 (for n=3).

Extensions

More terms from Michel Marcus, Sep 04 2020
Showing 1-2 of 2 results.