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

A002371 Period of decimal expansion of 1/(n-th prime) (0 by convention for the primes 2 and 5).

Original entry on oeis.org

0, 1, 0, 6, 2, 6, 16, 18, 22, 28, 15, 3, 5, 21, 46, 13, 58, 60, 33, 35, 8, 13, 41, 44, 96, 4, 34, 53, 108, 112, 42, 130, 8, 46, 148, 75, 78, 81, 166, 43, 178, 180, 95, 192, 98, 99, 30, 222, 113, 228, 232, 7, 30, 50, 256, 262, 268, 5, 69, 28, 141, 146, 153, 155, 312, 79, 110
Offset: 1

Views

Author

Keywords

Comments

a(n) is the minimum solution x of modular equation 10^x == 1 (mod p), where p = prime(n). - Carmine Suriano, Oct 10 2012
a(n) = smallest m such that 111...11 (m 1's) is divisible by the n-th prime, or 0 if no such m exists (with the exception that a(2) = 3 instead of 1). E.g., the 5th prime, 11, divides 11, so a(5) = 2. - N. J. A. Sloane, Oct 03 2013 [Comment corrected by Derek Orr, Jun 14 2014]
Numbers n such that A071126(n) = A000040(n) - 1. - Hugo Pfoertner, Mar 18 2003
Except for n = 1 and 3, a(n) divides A006093(n). - Robert Israel, Jul 15 2016

Examples

			A002371(11) = 15 because the 11th prime is 31, and 1/31 = 0.03225806451612903225806451612903225806452... has period 15. - _Richard F. Lyon_, Mar 29 2022
		

References

  • Albert H. Beiler, Recreations in the Theory of Numbers, 2nd ed. New York: Dover, 1966, pages 65, 309. ISBN 0-486-21096-0.
  • John H. Conway and R. K. Guy, The Book of Numbers, Copernicus Press, 1996, p. 162. ISBN 978-0-387-97993-9.
  • D. H. Lehmer, Guide to Tables in the Theory of Numbers. Bulletin No. 105, National Research Council, Washington, DC, 1941, p. 15.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

See A048595 for another version. Cf. A006883, A007732, A051626, A071126, A000040, A002275, A097443.
Cf. A001913 (full repetend primes), A060257 (1/prime(n) has period prime(n) - 1).

Programs

  • Maple
    seq(subs(FAIL=0,numtheory:-order(10, ithprime(n))),n=1..100); # Robert Israel, Jul 15 2016
  • Mathematica
    Table[ Length[ RealDigits[1 / Prime[n]] [[1, 1]]], {n, 1, 70}]
    Table[If[IntegerQ[#], #, 0] &[MultiplicativeOrder[10, Prime[n]]], {n, 1, 70}] (* Jan Mangaldan, Jul 07 2020 *)
  • PARI
    a(n)=if(n<4,n==2,znorder(Mod(10, prime(n))))
    
  • Python
    from sympy import prime, n_order
    def A002371(n): return 0 if n == 1 or n == 3 else n_order(10,prime(n)) # Chai Wah Wu, Feb 07 2022

Formula

From Alexander Adamchuk, Jan 28 2007: (Start)
a(A000720(p)) = p - 1 for primes p in A001913.
a(A060257(n)) = prime(A060257(n)) - 1. (End)

Extensions

More terms from Arlin Anderson (starship1(AT)gmail.com)
Edited by Charles R Greathouse IV, Mar 24 2010

A060526 A list of equal temperaments (equal divisions of the octave) whose nearest scale steps are closer and closer approximations to the ratios of six simple musical tones: 8/7 5/4 4/3 3/2 8/5 7/4.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 9, 10, 12, 15, 19, 21, 22, 31, 53, 84, 87, 94, 99, 118, 130, 140, 171, 270, 410, 441, 612, 935, 966, 1053, 1106, 1277, 1547, 1578, 2954, 3125, 3566, 6691, 9816, 11664, 14789, 18355, 39835, 48545, 54624, 58190, 59768, 63334, 81689, 84814
Offset: 1

Views

Author

Mark William Rankin (MarkRankin95511(AT)Yahoo.com), Apr 01 2001

Keywords

Comments

The sequence was found by a computer search of all of the equal divisions of the octave from 1 to over 84814.
The numerical value of each term represents a musical scale based on an equal division of the octave. 12, for example, signifies the scale which is formed by dividing the octave into 12 equal parts.

Examples

			84 = 53 + the previous term 31. Again, 291152 = 103169 + the previous terms (84814 + 81689 + 11664 + 9816).
		

Crossrefs

Formula

Recurrence: the next term equals the current term plus one or more of the previous terms: a(n+1) = a(n) + a(n-x)... + a(n-y)... +a(n-z)..., etc.

A060258 Numbers k such that 1/prime(k) has period prime(k) - 1 and 1/prime(k+1) has period prime(k+1) - 1.

Original entry on oeis.org

7, 8, 9, 17, 29, 41, 50, 55, 56, 75, 76, 93, 94, 95, 96, 105, 126, 141, 142, 159, 164, 165, 171, 179, 180, 181, 184, 185, 193, 199, 200, 210, 211, 212, 226, 242, 243, 244, 247, 248, 249, 256, 275, 280, 283, 311, 322, 323, 324, 337, 342, 346, 354, 358, 359
Offset: 1

Views

Author

Jeff Burch, Mar 23 2001

Keywords

Comments

Numbers k such that k and k+1 are both in A060257. - Amiram Eldar, Oct 03 2021

Crossrefs

Cf. A060257.

Programs

  • Mathematica
    q[n_] := Module[{p = Prime[n]}, MultiplicativeOrder[10, p] == p - 1]; Select[Range[360], q[#] && q[#+1] &] (* Amiram Eldar, Oct 03 2021 *)

Extensions

Data corrected by Amiram Eldar, Oct 03 2021

A382963 Prime index gaps between consecutive full reptend primes.

Original entry on oeis.org

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

Views

Author

Kyle Wyonch, Apr 10 2025

Keywords

Comments

This sequence gives the number of primes between consecutive full reptend primes, where a full reptend prime is a prime p for which 10 is a primitive root modulo p.

Examples

			The full reptend primes begin 7 (index 4), 17 (index 7), 19 (index 8), 23 (index 9). Then:
a(1) = 7 - 4 = 3,
a(2) = 8 - 7 = 1,
a(3) = 9 - 8 = 1.
		

Crossrefs

Partial differences of A060257.

Programs

  • Python
    from sympy import isprime, primerange, primepi
    def is_full_reptend_prime(p):
      if not isprime(p): return False
      k, mod = 1, 10 % p
      while mod != 1:
        mod = (mod * 10) % p
        k += 1
        if k >= p: return False
      return k == p - 1
    primes = list(primerange(2, 1000))
    reptends = [p for p in primes if is_full_reptend_prime(p)]
    gaps = [primepi(reptends[i+1]) - primepi(reptends[i]) for i in range(len(reptends)-1)]
    print(gaps)
    
  • Python
    from sympy import nextprime, n_order
    def A382963_gen(): # generator of terms
        p, c = 7, 0
        while True:
            p, c = nextprime(p), c+1
            if n_order(10, p)==p-1:
                yield c
                c = 0
    A382963_list = list(islice(A382963_gen(),87)) # Chai Wah Wu, Apr 10 2025

Formula

a(n) = pi(r(n+1)) - pi(r(n)), where r(n) is the n-th full reptend prime and pi(p) gives the prime index of p.
a(n) = A060257(n+1) - A060257(n).
Showing 1-4 of 4 results.