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-10 of 31 results. Next

A123365 Values of k such that A046530(k) = (k+2)/3, where A046530(k) is the number of distinct residues of cubes mod k.

Original entry on oeis.org

1, 7, 13, 19, 31, 37, 43, 61, 67, 73, 79, 97, 103, 109, 127, 139, 151, 157, 163, 181, 193, 199, 211, 223, 229, 241, 271, 277, 283, 307, 313, 331, 337, 349, 367, 373, 379, 397, 409, 421, 433, 439, 457, 463, 487, 499, 523, 541, 547, 571, 577, 601, 607, 613, 619
Offset: 1

Views

Author

John W. Layman, Oct 12 2006

Keywords

Comments

Conjecture: With the exception of the first term a(1)=1, this is exactly the sequence of primes of the form 6k+1 (A002476). This has been verified up to a(n)=2000.

Crossrefs

Programs

  • Maple
    n := 1 :
    a := 1 :
    while n <= 10000 do
        printf("%d %d\n",n,a) ;
        a := a+1 ;
        while A046530(a) <> (a+2)/3 do
            a := a+1 ;
        end do:
        n := n+1 ;
    end do: # creates b-file, R. J. Mathar, Sep 21 2017

A330695 Indices k at which record low values of the ratio A046530(k)/k occur.

Original entry on oeis.org

1, 4, 7, 9, 27, 36, 63, 117, 171, 189, 252, 351, 468, 504, 756, 819, 1197, 1953, 2223, 2457, 3276, 3591, 4788, 5733, 6552, 9576, 9828, 14364, 15561, 25389, 30303, 35217, 37107, 44289, 46683, 62244, 76167, 90909, 101556, 108927, 124488, 186732, 296856, 304668
Offset: 1

Views

Author

Jon E. Schoenfield, Dec 26 2019

Keywords

Comments

A046530(k) is the number of distinct cubic residues mod k.

Examples

			   n  a(n)=k   A046530(k)  ratio A046530(k)/k
  --  ------   ----------  ------------------
   1       1         1     1.0000000000000...
   2       4         3     0.7500000000000...
   3       7         3     0.4285714285714...
   4       9         3     0.3333333333333...
   5      27         7     0.2592592592592...
   6      36         9     0.2500000000000...
   7      63         9     0.1428571428571...
   8     117        15     0.1282051282051...
   9     171        21     0.1228070175438...
  10     189        21     0.1111111111111...
  11     252        27     0.1071428571428...
  12     351        35     0.0997150997150...
  13     468        45     0.0961538461538...
  14     504        45     0.0892857142857...
  15     756        63     0.0833333333333...
  16     819        45     0.0549450549450...
  17    1197        63     0.0526315789473...
  18    1953        99     0.0506912442396...
  19    2223       105     0.0472334682860...
  20    2457       105     0.0427350427350...
  21    3276       135     0.0412087912087...
  22    3591       147     0.0409356725146...
  23    4788       189     0.0394736842105...
  24    5733       225     0.0392464678178...
  25    6552       225     0.0343406593406...
  26    9576       315     0.0328947368421...
  27    9828       315     0.0320512820512...
  28   14364       441     0.0307017543859...
  29   15561       315     0.0202429149797...
  30   25389       495     0.0194966323998...
  31   30303       585     0.0193050193050...
  32   35217       675     0.0191668796319...
  33   37107       693     0.0186757215619...
  34   44289       819     0.0184921763869...
  35   46683       735     0.0157444894286...
  36   62244       945     0.0151821862348...
  37   76167      1155     0.0151640474221...
  38   90909      1365     0.0150150150150...
  39  101556      1485     0.0146224742998...
  40  108927      1575     0.0144592249855...
  41  124488      1575     0.0126518218623...
  42  186732      2205     0.0118083670715...
  43  296856      3465     0.0116723259762...
  44  304668      3465     0.0113730355665...
		

Crossrefs

Cf. A046530.

A000224 Number of squares mod n.

Original entry on oeis.org

1, 2, 2, 2, 3, 4, 4, 3, 4, 6, 6, 4, 7, 8, 6, 4, 9, 8, 10, 6, 8, 12, 12, 6, 11, 14, 11, 8, 15, 12, 16, 7, 12, 18, 12, 8, 19, 20, 14, 9, 21, 16, 22, 12, 12, 24, 24, 8, 22, 22, 18, 14, 27, 22, 18, 12, 20, 30, 30, 12, 31, 32, 16, 12, 21, 24, 34, 18, 24, 24, 36, 12
Offset: 1

Views

Author

Keywords

Comments

For any n > 2, there are quadratic nonresidues mod n, so a(n) < n. - Charles R Greathouse IV, Oct 28 2022
Conjecture: n^2 == 1 (mod a(n)*(a(n)-1)) if and only if n is an odd prime. - Thomas Ordowski, Apr 13 2025
This conjecture holds at least up to n = 10^8. - Michel Marcus, Apr 13 2025

Examples

			The sequence of squares (A000290) modulo 10 reads 0, 1, 4, 9, 6, 5, 6, 9, 4, 1, 0, 1, 4, 9, 6, 5, 6, 9, 4, 1,... and this reduced sequence contains a(10) = 6 different values, {0,1,4,5,6,9}. - _R. J. Mathar_, Oct 10 2014
		

Crossrefs

Cf. A095972, A046530 (cubic residues), A052273 (4th powers), A052274 (5th powers), A052275 (6th powers), A085310 (7th powers), A085311 (8th powers), A085312 (9th powers), A085313 (10th powers), A085314 (11th powers), A228849 (12th powers).

Programs

  • Haskell
    a000224 n = product $ zipWith f (a027748_row n) (a124010_row n) where
       f 2 e = 2 ^ e `div` 6 + 2
       f p e = p ^ (e + 1) `div` (2 * p + 2) + 1
    -- Reinhard Zumkeller, Aug 01 2012
    
  • Maple
    A000224 := proc(m)
        {seq( modp(b^2,m),b=0..m-1) };
        nops(%) ;
    end proc: # Emeric Deutsch
    # 2nd implementation
    A000224 := proc(n)
        local a,ifs,f,p,e,c ;
        a := 1 ;
        ifs := ifactors(n)[2] ;
        for f in ifs do
            p := op(1,f) ;
            e := op(2,f) ;
            if p = 2 then
                if type(e,'odd') then
                    a := a*(2^(e-1)+5)/3 ;
                else
                    a := a*(2^(e-1)+4)/3 ;
                end if;
            else
                if type(e,'odd') then
                    c := 2*p+1 ;
                else
                    c := p+2 ;
                end if;
                a := a*(p^(e+1)+c)/2/(p+1) ;
            end if;
        end do:
        a ;
    end proc: # R. J. Mathar, Oct 10 2014
  • Mathematica
    Length[Union[#]]& /@ Table[Mod[k^2, n], {n, 65}, {k, n}] (* Jean-François Alcover, Aug 30 2011 *)
    a[2] = 2; a[n_] := a[n] = Switch[fi = FactorInteger[n], {{, 1}}, (fi[[1, 1]] + 1)/2, {{2, }}, 3/2 + 2^fi[[1, 2]]/6 + (-1)^(fi[[1, 2]]+1)/6, {{, }}, {p, k} = fi[[1]]; 3/4 + (p-1)*(-1)^(k+1)/(4*(p+1)) + p^(k+1)/(2*(p+1)), , Times @@ Table[ a[Power @@ f], {f, fi}]]; Table[a[n], {n, 1, 100}] (* _Jean-François Alcover, Mar 09 2015 *)
  • PARI
    a(n) = local(v,i); v = vector(n,i,0); for(i=0, floor(n/2),v[i^2%n+1] = 1); sum(i=1,n,v[i]) \\ Franklin T. Adams-Watters, Nov 05 2006
    
  • PARI
    a(n)=my(f=factor(n));prod(i=1,#f[,1],if(f[i,1]==2,2^f[1,2]\6+2,f[i,1]^(f[i,2]+1)\(2*f[i,1]+2)+1)) \\ Charles R Greathouse IV, Jul 15 2011
    
  • Python
    from math import prod
    from sympy import factorint
    def A000224(n): return prod((p**(e+1)//((p+1)*(q:=1+(p==2)))>>1)+q for p, e in factorint(n).items()) # Chai Wah Wu, Oct 07 2024

Formula

a(n) = A105612(n) + 1.
Multiplicative with a(p^e) = floor(p^e/6) + 2 if p = 2; floor(p^(e+1)/(2p + 2)) + 1 if p > 2. - David W. Wilson, Aug 01 2001
a(2^n) = A023105(n). a(3^n) = A039300(n). a(5^n) = A039302(n). a(7^n) = A039304(n). - R. J. Mathar, Sep 28 2017
Sum_{k=1..n} a(k) ~ c * n^2/sqrt(log(n)), where c = (17/(32*sqrt(Pi))) * Product_{p prime} (1 - (p^2+2)/(2*(p^2+1)*(p+1))) * (1-1/p)^(-1/2) = 0.37672933209687137604... (Finch and Sebah, 2006). - Amiram Eldar, Oct 18 2022
If p is an odd prime, then a(p) = (p + 1)/2. - Thomas Ordowski, Apr 09 2025

A052273 Number of distinct 4th powers mod n.

Original entry on oeis.org

1, 2, 2, 2, 2, 4, 4, 2, 4, 4, 6, 4, 4, 8, 4, 2, 5, 8, 10, 4, 8, 12, 12, 4, 6, 8, 10, 8, 8, 8, 16, 4, 12, 10, 8, 8, 10, 20, 8, 4, 11, 16, 22, 12, 8, 24, 24, 4, 22, 12, 10, 8, 14, 20, 12, 8, 20, 16, 30, 8, 16, 32, 16, 6, 8, 24, 34, 10, 24, 16, 36, 8, 19, 20, 12, 20
Offset: 1

Views

Author

N. J. A. Sloane, Feb 05 2000

Keywords

Comments

This sequence is multiplicative [Li]. - Leon P Smith, Apr 16 2005

Crossrefs

Cf. A000224 (squares), A046530 (cubic residues), A052274 (5th powers), A052275 (6th powers), A085310 (7th powers), A085311 (8th powers), A085312 (9th powers), A085313 (10th powers), A085314 (11th powers), A228849 (12th powers).

Programs

  • Maple
    A052273 := proc(n,k) local i; nops({seq(i^k mod n,i=0..n-1)}); end; # number of k-th powers mod n
  • Mathematica
    a[n_] := Table[PowerMod[i, 4, n], {i, 0, n-1}] // Union // Length;
    Array[a, 100] (* Jean-François Alcover, Mar 24 2020 *)
  • PARI
    a(n)=my(f=factor(n)); prod(i=1,#f[,1],my(k=f[i,1]^f[i,2]); #vecsort(vector(k,i,i^4%k),,8)) \\ Charles R Greathouse IV, May 26 2013
    
  • PARI
    \\ general formula for k-th powers, see Seraj link
    h(p,e,k=4)=my(a=(p-1)/gcd(k,p-1),b=if(k%2+p%2,0,valuation(k,p)+1)+p%2*valuation(k,p),g=(e-1)%k+1,G=p^g,B=p^(b+1),K=p^k,E=p^e); a*(K/B*(E-G)/(K-1)+ceil(G/B))+1
    a(n,f=factor(n),k=4)=prod(i=1,#f~, h(f[i,1],f[i,2],k)) \\ Charles R Greathouse IV, Nov 09 2022
    
  • Python
    from math import prod
    from sympy import factorint
    def A052273(n): return prod(1+(p**e//15+bool(e&3) if p==2 else (p-1)*p**(e+3)//((4 if p&3==1 else 2)*(p**4-1))) for p, e in factorint(n).items()) # Chai Wah Wu, Apr 09 2025

Formula

Conjecture: a(2^e) = 1 + floor(2^e/(2^4-1)) if e == 0 (mod 4). a(2^e) = 2 + floor(2^e/(2^4-1)) if e == {1,2,3} mod 4. - R. J. Mathar, Oct 22 2017
Conjecture: a(p^e) = 1 + floor((p-1)*p^(e+3)/(gcd(p-1,4)*(p^4-1))) for odd primes p. - R. J. Mathar, Oct 22 2017
From Samer Seraj, Nov 09 2022: (Start)
The above conjectures are correct, and a unified form is:
a(p^m) = alpha*((p^3 / p^beta)*((p^m - p^gamma)/(p^4 -1)) + ceiling((p^gamma)/(p^(beta+1)))) + 1, where p is any prime, m is any positive integer, alpha = (p-1)/gcd(4,p-1), beta = 3 if p = 2 or beta = 0 if p is odd, and gamma = 4 if 4|m or gamma = (m mod 4) otherwise. (End)

A052274 Number of distinct 5th powers mod n.

Original entry on oeis.org

1, 2, 3, 3, 5, 6, 7, 5, 7, 10, 3, 9, 13, 14, 15, 9, 17, 14, 19, 15, 21, 6, 23, 15, 5, 26, 19, 21, 29, 30, 7, 17, 9, 34, 35, 21, 37, 38, 39, 25, 9, 42, 43, 9, 35, 46, 47, 27, 43, 10, 51, 39, 53, 38, 15, 35, 57, 58, 59, 45, 13, 14, 49, 34, 65, 18, 67, 51, 69, 70
Offset: 1

Views

Author

N. J. A. Sloane, Feb 05 2000

Keywords

Comments

This sequence is multiplicative. - Leon P Smith, Apr 16 2005

Crossrefs

Cf. A000224 (squares), A046530 (cubic residues), A052273 (4th powers), A052275 (6th powers), A085310 (7th powers), A085311 (8th powers), A085312 (9th powers), A085313 (10th powers), A085314 (11th powers), A228849 (12th powers).

Programs

  • Maple
    A052274 := proc(m)
        {seq( modp(b^5,m),b=0..m-1) };
        nops(%) ;
    end proc:
    seq(A052274(m),m=1..100) ; # R. J. Mathar, Sep 22 2017
  • Mathematica
    With[{nn=100},Table[Length[Union[PowerMod[Range[nn],5,n]]],{n,nn}]] (* Harvey P. Dale, Mar 19 2016 *)
  • PARI
    a(n)=my(f=factor(n)); prod(i=1, #f[, 1], my(k=f[i, 1]^f[i, 2]); #vecsort(vector(k, i, i^5%k), , 8)) \\ Charles R Greathouse IV, Sep 05 2013

Formula

Conjecture: a(5^e) = 1+floor[(5-1)*5^(e+3)/(5^5-1)] if e == {0,2,3,4} (mod 5). a(5^e) = 5+floor[(5-1)*5^(e+3)/(5^5-1)] if e==1 (mod 5). - R. J. Mathar, Oct 22 2017
Conjecture: a(p^e) = 1+floor[(p-1)*p^(e+4)/{gcd(p-1,5)*(p^5-1)}] for primes p<>5 - R. J. Mathar, Oct 22 2017

A052275 Number of distinct 6th powers mod n.

Original entry on oeis.org

1, 2, 2, 2, 3, 4, 2, 2, 2, 6, 6, 4, 3, 4, 6, 3, 9, 4, 4, 6, 4, 12, 12, 4, 11, 6, 4, 4, 15, 12, 6, 5, 12, 18, 6, 4, 7, 8, 6, 6, 21, 8, 8, 12, 6, 24, 24, 6, 8, 22, 18, 6, 27, 8, 18, 4, 8, 30, 30, 12, 11, 12, 4, 9, 9, 24, 12, 18, 24, 12, 36, 4, 13, 14, 22, 8, 12, 12
Offset: 1

Views

Author

N. J. A. Sloane, Feb 05 2000

Keywords

Comments

This sequence is multiplicative [Li]. - Leon P Smith, Apr 16 2005
Same as the number of distinct elements that are both squares and cubes mod n. - Steven Finch, Mar 01 2006

Crossrefs

Cf. A000224 (squares), A046530 (cubic residues), A052273 (4th powers), A052274 (5th powers), A085310 (7th powers), A085311 (8th powers), A085312 (9th powers), A085313 (10th powers), A085314 (11th powers), A228849 (12th powers).

Programs

  • Maple
    A052275 := proc(m)
        {seq( modp(b^6,m),b=0..m-1) };
        nops(%) ;
    end proc:
    seq(A052275(m),m=1..100) ; # R. J. Mathar, Sep 22 2017
  • Mathematica
    Length[Union[#]]&/@Table[PowerMod[k,6,n],{n,100},{k,n}] (* Zak Seidov, Feb 17 2013 *)
  • PARI
    a(n)=my(f=factor(n)); prod(i=1, #f[, 1], my(k=f[i, 1]^f[i, 2]); #vecsort(vector(k, i, i^6%k), , 8)) \\ Charles R Greathouse IV, Sep 05 2013

Formula

Conjecture: a(2^n) = 1,2,2,2,3,5,9,18,... with g.f. ( 1-2*x^2-2*x^3-x^4-x^5-2*x^6 ) / ( (x-1)*(2*x-1)*(1+x)*(1+x+x^2)*(x^2-x+1) ). - R. J. Mathar, Sep 28 2017
Conjecture: a(3^n) = 1,2,2,4,10,28,82,.... with g.f. ( 1-x-4*x^2-2*x^3-2*x^4-2*x^5-3*x^6 ) / ( (x-1)*(3*x-1)*(1+x)*(x^2-x+1)*(1+x+x^2) ). - R. J. Mathar, Sep 28 2017

A085310 Number of distinct 7th powers modulo n.

Original entry on oeis.org

1, 2, 3, 3, 5, 6, 7, 5, 7, 10, 11, 9, 13, 14, 15, 9, 17, 14, 19, 15, 21, 22, 23, 15, 21, 26, 19, 21, 5, 30, 31, 17, 33, 34, 35, 21, 37, 38, 39, 25, 41, 42, 7, 33, 35, 46, 47, 27, 7, 42, 51, 39, 53, 38, 55, 35, 57, 10, 59, 45, 61, 62, 49, 33, 65, 66, 67, 51, 69, 70, 11, 35, 73, 74
Offset: 1

Views

Author

Labos Elemer, Jun 27 2003

Keywords

Comments

Compare with enigmatic similarity of analogous odd-th power counts to A055653.
This sequence is multiplicative [Li]. - Leon P Smith, Apr 16 2005

Crossrefs

Cf. A000224[k=2], A046530[k=3], A052273[k=4], A052274[k=5], A052275[k=6], A085311[k=8], A085312[k=9], A085313[k=10], A085314[k=11], A228849[k=12], A055653.

Programs

  • Maple
    A085310 := proc(m)
        {seq( modp(b^7,m),b=0..m-1) };
        nops(%) ;
    end proc:
    seq(A085310(m),m=1..100) ; # R. J. Mathar, Sep 22 2017
  • Mathematica
    a[n_] := Table[PowerMod[i, 7, n], {i, 0, n - 1}] // Union // Length;
    Array[a, 100] (* Jean-François Alcover, Mar 24 2020 *)
  • PARI
    a(n)=my(f=factor(n)); prod(i=1, #f[, 1], my(k=f[i, 1]^f[i, 2]); #vecsort(vector(k, i, i^7%k), , 8)) \\ Charles R Greathouse IV, Sep 05 2013

A085311 Number of distinct 8th powers modulo n.

Original entry on oeis.org

1, 2, 2, 2, 2, 4, 4, 2, 4, 4, 6, 4, 4, 8, 4, 2, 3, 8, 10, 4, 8, 12, 12, 4, 6, 8, 10, 8, 8, 8, 16, 2, 12, 6, 8, 8, 10, 20, 8, 4, 6, 16, 22, 12, 8, 24, 24, 4, 22, 12, 6, 8, 14, 20, 12, 8, 20, 16, 30, 8, 16, 32, 16, 3, 8, 24, 34, 6, 24, 16, 36, 8, 10, 20, 12, 20, 24, 16, 40, 4, 28, 12, 42, 16, 6
Offset: 1

Views

Author

Labos Elemer, Jun 27 2003

Keywords

Comments

This sequence is multiplicative. - Leon P Smith, Apr 16 2005

Crossrefs

Cf. A000224[k=2], A046530[k=3], A052273[k=4], A052274[k=5], A052275[k=6], A085310[k=7], A085312[k=9], A085313[k=10], A085314[k=11], A228849[k=12], A055653.

Programs

  • Maple
    A085311 := proc(m)
        {seq( modp(b^8,m),b=0..m-1) };
        nops(%) ;
    end proc:
    seq(A085311(m),m=1..100) ; # R. J. Mathar, Sep 22 2017
  • Mathematica
    a[n_] := Table[PowerMod[i, 8, n], {i, 0, n - 1}] // Union // Length;
    Array[a, 100] (* Jean-François Alcover, Mar 24 2020 *)
  • PARI
    a(n)=my(f=factor(n)); prod(i=1, #f[, 1], my(k=f[i, 1]^f[i, 2]); #vecsort(vector(k, i, i^8%k), , 8)) \\ Charles R Greathouse IV, Sep 05 2013

A085312 Number of distinct 9th powers modulo n.

Original entry on oeis.org

1, 2, 3, 3, 5, 6, 3, 5, 3, 10, 11, 9, 5, 6, 15, 9, 17, 6, 3, 15, 9, 22, 23, 15, 21, 10, 3, 9, 29, 30, 11, 17, 33, 34, 15, 9, 5, 6, 15, 25, 41, 18, 15, 33, 15, 46, 47, 27, 15, 42, 51, 15, 53, 6, 55, 15, 9, 58, 59, 45, 21, 22, 9, 33, 25, 66, 23, 51, 69, 30, 71, 15, 9, 10, 63, 9, 33, 30, 27
Offset: 1

Views

Author

Labos Elemer, Jun 27 2003

Keywords

Comments

Compare with enigmatic similarity of analogous odd-th power counts to A055653.
This sequence is multiplicative [Li]. - Leon P Smith, Apr 16 2005

Crossrefs

Cf. A000224[k=2], A046530[k=3], A052273[k=4], A052274[k=5], A052275[k=6], A085310[k=7], A085311[k=8], A085313[k=10], A085314[k=11], A228849[k=12], A055653.

Programs

  • Maple
    A085312 := proc(m)
        {seq( modp(b^9,m),b=0..m-1) };
        nops(%) ;
    end proc:
    seq(A085312(m),m=1..100) ; # R. J. Mathar, Sep 22 2017
  • Mathematica
    a[n_] := Table[PowerMod[i, 9, n], {i, 0, n - 1}] // Union // Length;
    Array[a, 100] (* Jean-François Alcover, Mar 25 2020 *)
  • PARI
    a(n)=my(f=factor(n)); prod(i=1, #f[, 1], my(k=f[i, 1]^f[i, 2]); #vecsort(vector(k, i, i^9%k), , 8)) \\ Charles R Greathouse IV, Sep 05 2013

A085313 Number of distinct 10th power residues modulo n.

Original entry on oeis.org

1, 2, 2, 2, 3, 4, 4, 2, 4, 6, 2, 4, 7, 8, 6, 3, 9, 8, 10, 6, 8, 4, 12, 4, 3, 14, 10, 8, 15, 12, 4, 5, 4, 18, 12, 8, 19, 20, 14, 6, 5, 16, 22, 4, 12, 24, 24, 6, 22, 6, 18, 14, 27, 20, 6, 8, 20, 30, 30, 12, 7, 8, 16, 9, 21, 8, 34, 18, 24, 24, 8, 8, 37, 38, 6, 20, 8, 28, 40, 9, 28, 10, 42, 16
Offset: 1

Views

Author

Labos Elemer, Jun 27 2003

Keywords

Comments

This sequence is multiplicative [Li]. - Leon P Smith, Apr 16 2005

Crossrefs

Cf. A000224[k=2], A046530[k=3], A052273[k=4], A052274[k=5], A052275[k=6], A085310[k=7], A085311[k=8], A085312[k=9], A085314[k=11], A228849[k=12], A055653.

Programs

  • Maple
    A085313 := proc(m)
        {seq( modp(b^10,m),b=0..m-1) };
        nops(%) ;
    end proc:
    seq(A085313(m),m=1..100) ; # R. J. Mathar, Sep 22 2017
  • Mathematica
    a[n_] := Table[PowerMod[i, 10, n], {i, 0, n - 1}] // Union // Length;
    Array[a, 100] (* Jean-François Alcover, Mar 25 2020 *)
  • PARI
    a(n)=my(f=factor(n)); prod(i=1, #f[, 1], my(k=f[i, 1]^f[i, 2]); #vecsort(vector(k, i, i^10%k), , 8)) \\ Charles R Greathouse IV, Sep 05 2013
Showing 1-10 of 31 results. Next