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 21-30 of 62 results. Next

A105874 Primes for which -2 is a primitive root.

Original entry on oeis.org

5, 7, 13, 23, 29, 37, 47, 53, 61, 71, 79, 101, 103, 149, 167, 173, 181, 191, 197, 199, 239, 263, 269, 271, 293, 311, 317, 349, 359, 367, 373, 383, 389, 421, 461, 463, 479, 487, 503, 509, 541, 557, 599, 607, 613, 647, 653, 661, 677, 701, 709, 719, 743, 751, 757, 773, 797
Offset: 1

Views

Author

N. J. A. Sloane, Apr 24 2005

Keywords

Comments

Also primes for which (p-1)/2 (==-1/2 mod p) is a primitive root. [Joerg Arndt, Jun 27 2011]

Crossrefs

Programs

  • Maple
    with(numtheory); f:=proc(n) local t1,i,p; t1:=[]; for i from 1 to 500 do p:=ithprime(i); if order(n,p) = p-1 then t1:=[op(t1),p]; fi; od; t1; end; f(-2);
  • Mathematica
    pr=-2; Select[Prime[Range[200]], MultiplicativeOrder[pr, # ] == #-1 &] (* N. J. A. Sloane, Jun 01 2010 *)
    a[p_,q_]:=Sum[2 Cos[2^n Pi/((2 q+1) (2 p+1))], {n,1,2 q p}];
    Select[Range[400], Reduce[a[#, 1] == 1, Integers] &];
    2 % + 1 (* Gerry Martens, Apr 28 2015 *)
  • PARI
    forprime(p=3,10^4,if(p-1==znorder(Mod(-2,p)),print1(p", "))); /* Joerg Arndt, Jun 27 2011 */
    
  • Python
    from sympy import n_order, nextprime
    from itertools import islice
    def A105874_gen(startvalue=3): # generator of terms >= startvalue
        p = max(startvalue-1,2)
        while (p:=nextprime(p)):
            if n_order(-2,p) == p-1:
                yield p
    A105874_list = list(islice(A105874_gen(),20)) # Chai Wah Wu, Aug 11 2023

Formula

Let a(p,q)=sum(n=1,2*p*q,2*cos(2^n*Pi/((2*q+1)*(2*p+1)))). Then 2*p+1 is a prime belonging to this sequence when a(p,1)==1. - Gerry Martens, May 21 2015

A087026 Euler's totient of n-th cyclic number.

Original entry on oeis.org

77760, 1382399778816000, 98221093640386560, 1053590173895849103360, 821095240766161265049600000, 511883170649353472639948811682935064652736000, 410719109641406326635474611575828305116907342385175347200
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 30 2003

Keywords

Comments

Calculated with Dario Alpern's ECM.
Extended using factors of 10^(A001913(n)-1)-1, see Kamada link.

Crossrefs

Formula

a(n) = A000010(A004042(n+1)).

Extensions

a(12)-a(42) from Ray Chandler, Nov 16 2011

A021023 Decimal expansion of 1/19.

Original entry on oeis.org

0, 5, 2, 6, 3, 1, 5, 7, 8, 9, 4, 7, 3, 6, 8, 4, 2, 1, 0, 5, 2, 6, 3, 1, 5, 7, 8, 9, 4, 7, 3, 6, 8, 4, 2, 1, 0, 5, 2, 6, 3, 1, 5, 7, 8, 9, 4, 7, 3, 6, 8, 4, 2, 1, 0, 5, 2, 6, 3, 1, 5, 7, 8, 9, 4, 7, 3, 6, 8, 4, 2, 1, 0, 5, 2, 6, 3, 1, 5, 7, 8, 9, 4, 7, 3, 6, 8, 4, 2, 1, 0, 5, 2, 6, 3, 1, 5, 7, 8
Offset: 0

Views

Author

Keywords

Comments

The 18-digit cycle 1, 0, 5, 2, 6, 3, 1, 5, 7, 8, 9, 4, 7, 3, 6, 8, 4, 2 in this sequence and the others based on nineteenths gives the successive digits of the smallest integer which is doubled, quadrupled and octupled when the last three digits in turn are moved from the right hand end to the left hand end. For example, 842105263157894736 is eight times 105263157894736842. - Ian Duff, Jan 07 2009, Jan 12 2009
The magic square that uses the decimals of 1/19 is fully magic. 383 has the same property (see A021387). For other such primes see A072359. - Michel Marcus, Sep 02 2015
Since 19 is prime and the cycle of its reciprocal's base 10 digits is 19 - 1 long, 19 is a full reptend prime (A001913). - Alonso del Arte, Mar 21 2020

References

  • Martin Gardner, Cyclic numbers, Mathematical Circus, Chapter 10, p. 172, of the 1992 Mathematical Association of America edition.
  • GCHQ, The GCHQ Puzzle Book, Penguin, 2016. See page 92.

Crossrefs

Programs

  • Mathematica
    Prepend[First@ RealDigits[N[1/19, 120]], 0] (* Michael De Vlieger, Sep 02 2015 *)
    LinearRecurrence[{1,0,0,0,0,0,0,0,-1,1},{0,5,2,6,3,1,5,7,8,9},100] (* or *) PadRight[{},100,{0,5,2,6,3,1,5,7,8,9,4,7,3,6,8,4,2,1}] (* Harvey P. Dale, Jan 23 2021 *)
  • PARI
    default(realprecision,2000);1/19.0 \\ Anders Hellström, Sep 02 2015
    
  • Scala
    def longDivRecip(n: Int, places: Int = 100): List[Int] = {
      val pow10 = Math.pow(10, Math.ceil(Math.log10(Math.abs(n)))).toInt
      val digits = new scala.collection.mutable.ListBuffer[Int]()
      var quotient = pow10; var remainder = 0
      while (digits.size < places) {
        remainder = quotient % n; quotient /= n; digits += quotient
        quotient = remainder * 10
      }
      digits.toList
    }
    0 :: longDivRecip(19) // Alonso del Arte, Mar 20 2020

Formula

G.f.: -x*(x^8 + x^7 + 2*x^6 + 4*x^5 - 2*x^4 - 3*x^3 + 4*x^2 - 3*x + 5)/((x - 1)*(x + 1)*(x^2 - x + 1)*(x^6 - x^3 + 1)). - Colin Barker, Aug 15 2012

A087020 Greatest prime factor of n-th cyclic number.

Original entry on oeis.org

37, 5882353, 333667, 513239, 121499449, 11111111111111111111111, 154083204930662557781201849, 39526741, 9999999900000001, 59779577156334533866654838281, 119968369144846370226083377, 8396862596258693901610602298557167100076327481
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 30 2003

Keywords

Comments

A004042(n) factorized with Dario Alpern's ECM.
Extended using factors of 10^(A001913(n)-1)-1, see Kamada link.

Examples

			A004042(2) = 142857 = 37*13*11*3^3, therefore a(1) = 37.
		

Crossrefs

Formula

a(n) = A006530(A004042(n+1)).

Extensions

a(12) from Ray Chandler, Nov 16 2011

A087022 Total number of prime factors of n-th cyclic number.

Original entry on oeis.org

6, 9, 12, 10, 11, 9, 11, 23, 25, 25, 22, 18, 19, 15, 14, 38, 35, 24, 28, 25, 27, 21, 17, 38, 44, 27, 43, 16, 16, 23, 42, 35, 37, 30, 29, 14, 23, 62, 41, 51, 28, 26, 24, 19, 50, 29, 39, 25, 62, 36, 29
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 30 2003

Keywords

Comments

A004042(n) factorized with Dario Alpern's ECM.
Extended using factors of 10^(A001913(n)-1)-1, see Kamada link.

Examples

			A004042(2) = 142857 = 37*13*11*3^3, therefore a(1) = A087021(1)+2 = 6.
		

Crossrefs

Formula

a(n) = A001222(A004042(n+1)).

Extensions

a(3) corrected, a(12)-a(42) added by Ray Chandler, Nov 16 2011
a(43)-a(51) from Max Alekseyev, May 13 2022

A056619 Smallest prime with primitive root n, or 0 if no such prime exists.

Original entry on oeis.org

2, 3, 2, 0, 2, 11, 2, 3, 2, 7, 2, 5, 2, 3, 2, 0, 2, 5, 2, 3, 2, 5, 2, 7, 2, 3, 2, 5, 2, 11, 2, 3, 2, 19, 2, 0, 2, 3, 2, 7, 2, 5, 2, 3, 2, 11, 2, 5, 2, 3, 2, 5, 2, 7, 2, 3, 2, 5, 2, 19, 2, 3, 2, 0, 2, 7, 2, 3, 2, 19, 2, 5, 2, 3, 2, 13, 2, 5, 2, 3, 2, 5, 2, 11, 2, 3, 2, 5, 2, 11, 2, 3, 2, 7, 2, 7, 2, 3, 2
Offset: 1

Views

Author

Robert G. Wilson v, Aug 07 2000

Keywords

Comments

a(n) > n/2 for n in { 2, 6, 10, 34 }. Are there any other such indices n? - M. F. Hasler, Feb 21 2017

Crossrefs

Here the primitive root may be larger than the prime, whereas in A023049 it may not be.

Programs

  • Maple
    f:= proc(n) local p;
       if n::odd then return 2
       elif issqr(n) then return 0
       fi;
       p:= 3;
       do
          if numtheory:-order(n,p) = p-1 then return p fi;
          p:= nextprime(p);
       od
    end proc:
    map(f, [$1..100]); # Robert Israel, Feb 21 2017
  • Mathematica
    a[n_] := Module[{p}, If[OddQ[n], Return[2], If[IntegerQ[Sqrt[n]], Return[0], p = 3; While[True, If[MultiplicativeOrder[n, p] == p-1, Return[p]]; p = NextPrime[p]]]]];
    Array[a, 100] (* Jean-François Alcover, Apr 10 2019, after Robert Israel *)
  • PARI
    A056619(n)=forprime(p=2,n*2,gcd(n,p)==1&&znorder(Mod(n,p))==p-1&&return(p)) \\ or, more efficient:
    A056619(n)=if(bittest(n,0),2,!issquare(n)&&forprime(p=3,n*2,gcd(n,p)==1&&znorder(Mod(n,p))==p-1&&return(p))) \\ M. F. Hasler, Feb 21 2017

Formula

a(n) = 0 only for perfect squares, A000290.
a(n) = 2 for all odd n. a(n) = 0 for even squares. a(n) = 3 for n = 2 (mod 6). a(n) = 5 for n in {12, 18, 22, 28} (mod 30). - M. F. Hasler, Feb 21 2017

Extensions

Corrected and extended by Jud McCranie, Mar 21 2002
Corrected by Robert Israel, Feb 21 2017

A060257 Numbers k such that 1/prime(k) has period prime(k) - 1.

Original entry on oeis.org

4, 7, 8, 9, 10, 15, 17, 18, 25, 29, 30, 32, 35, 39, 41, 42, 44, 48, 50, 51, 55, 56, 57, 65, 68, 73, 75, 76, 77, 81, 84, 89, 93, 94, 95, 96, 97, 100, 105, 106, 108, 114, 118, 120, 126, 127, 129, 132, 141, 142, 143, 148, 150, 154, 159, 160, 162, 164, 165, 166, 171
Offset: 1

Views

Author

Jeff Burch, Mar 22 2001

Keywords

Crossrefs

Cf. A060258.
Cf. A000720 (PrimePi), A001913 (primes with primitive root 10).

Programs

  • Mathematica
    Select[Range[200], MultiplicativeOrder[10, (p = Prime[#])] == p - 1 &] (* Amiram Eldar, Oct 03 2021 *)

Formula

a(n) = PrimePi(A001913(n)). - Alexander Adamchuk, Jan 28 2007

A087024 Number of divisors of n-th cyclic number.

Original entry on oeis.org

32, 384, 1280, 576, 1536, 384, 1536, 4194304, 16777216, 3538944, 1769472, 110592, 221184, 13824, 6912, 48318382080, 9663676416, 3538944, 75497472, 14155776, 56623104, 884736, 55296, 57982058496, 3710851743744, 37748736, 695784701952, 27648, 27648, 2654208
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 30 2003

Keywords

Comments

Calculated with Dario Alpern's ECM.
Extended using factors of 10^(A001913(n)-1)-1, see Kamada link.

Crossrefs

Formula

a(n) = A000005(A004042(n+1)).

Extensions

a(12)-a(42) from Ray Chandler, Nov 16 2011

A087025 Sum of divisors of n-th cyclic number.

Original entry on oeis.org

255360, 17205180696931968, 1951532915603927040, 12430490030984319840000, 9956179688423375044684800000, 6080633705911286890368486450696472902951229440, 4809378729404888733987843426081300724182624228548100710400
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 30 2003

Keywords

Comments

Calculated with Dario Alpern's ECM.
Extended using factors of 10^(A001913(n)-1)-1, see Kamada link.

Crossrefs

Formula

a(n) = A000203(A004042(n+1)).

Extensions

a(12)-a(42) from Ray Chandler, Nov 16 2011

A021027 Decimal expansion of 1/23.

Original entry on oeis.org

0, 4, 3, 4, 7, 8, 2, 6, 0, 8, 6, 9, 5, 6, 5, 2, 1, 7, 3, 9, 1, 3, 0, 4, 3, 4, 7, 8, 2, 6, 0, 8, 6, 9, 5, 6, 5, 2, 1, 7, 3, 9, 1, 3, 0, 4, 3, 4, 7, 8, 2, 6, 0, 8, 6, 9, 5, 6, 5, 2, 1, 7, 3, 9, 1, 3, 0, 4, 3, 4, 7, 8, 2, 6, 0, 8, 6, 9, 5, 6, 5, 2, 1, 7, 3, 9, 1, 3, 0, 4, 3, 4, 7, 8, 2, 6, 0, 8, 6
Offset: 0

Views

Author

Keywords

Comments

Since 23 is prime and the cycle of its reciprocal's base 10 digits is 22, 23 is a full reptend prime in base 10 (A001913). - Alonso del Arte, Mar 26 2020

Examples

			1/23 = 0.043478260869565217391304347826...
		

Crossrefs

Cf. A001913.

Programs

  • Mathematica
    Join[{0}, RealDigits[1/23, 10, 100][[1]]] (* Alonso del Arte, Mar 14 2020 *)
  • Scala
    def longDivRecip(n: Int, places: Int = 100): List[Int] = {
      val pow10 = Math.pow(10, Math.ceil(Math.log10(Math.abs(n)))).toInt
      val digits = new scala.collection.mutable.ListBuffer[Int]()
      var quotient = pow10; var remainder = 0
      while (digits.size < places) {
        remainder = quotient % n; quotient /= n; digits += quotient
        quotient = remainder * 10
      }
      digits.toList
    }
    0 :: longDivRecip(23) // Alonso del Arte, Mar 25 2020
Previous Showing 21-30 of 62 results. Next