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

A128857 a(n) = least number m beginning with 1 such that the quotient m/n is obtained merely by shifting the leftmost digit 1 of m to the right end.

Original entry on oeis.org

1, 105263157894736842, 1034482758620689655172413793, 102564, 102040816326530612244897959183673469387755, 1016949152542372881355932203389830508474576271186440677966
Offset: 1

Views

Author

Anton V. Chupin (chupin(X)icmm.ru), Apr 12 2007

Keywords

Comments

a(n) is simply the decimal period of the fraction n/(10n-1). Thus, we have: n/(10n-1) = a(n)/(10^A128858(n)-1). With the usual convention that the decimal period of 0 is zero, that definition would allow the extension a(0)=0. a(n) is also the period of the decadic integer -n/(10n-1). - Gerard P. Michon, Oct 31 2012

Examples

			a(4) = 102564 since this is the smallest number that begins with 1 and which is divided by 4 when the first digit 1 is made the last digit (102564/4 = 25641).
		

Crossrefs

Minimal numbers for shifting any digit from the left to the right (not only 1) are in A097717.
By accident, the nine terms of A092697 coincide with the first nine terms of the present sequence. - N. J. A. Sloane, Apr 13 2009

Programs

  • Mathematica
    (*Moving digits a:*) Give[a_,n_]:=Block[{d=Ceiling[Log[10,n]],m=(10n-1)/GCD[10n-1, a]}, If[m!=1,While[PowerMod[10,d,m]!=n,d++ ],d=1]; ((10^(d+1)-1) a n)/(10n-1)]; Table[Give[1,n],{n,101}]
  • Python
    from sympy import n_order
    def A128857(n): return n*(10**n_order(10,(m:=10*n-1))-1)//m # Chai Wah Wu, Apr 09 2024

Extensions

Edited by N. J. A. Sloane, Apr 13 2009
Code and b-file corrected by Ray Chandler, Apr 29 2009

A217852 Multiplicative order of 5 (mod 5*n - 1).

Original entry on oeis.org

1, 6, 6, 9, 2, 14, 16, 4, 5, 42, 18, 29, 16, 22, 36, 39, 6, 44, 46, 30, 4, 27, 18, 48, 3, 42, 22, 69, 12, 37, 30, 52, 20, 52, 14, 89, 22, 18, 96, 33, 16, 45, 106, 72, 24, 114, 12, 119, 30, 82, 42, 36, 10, 67, 136, 6, 5, 272, 42, 44, 36, 102, 156, 70, 54, 138, 166
Offset: 1

Views

Author

Arkadiusz Wesolowski, Nov 16 2012

Keywords

Comments

Least m such that 5*n - 1 divides 5^m - 1.

Crossrefs

Programs

  • GAP
    List([1..70],n->OrderMod(5,5*n-1)); # Muniru A Asiru, Feb 25 2019
  • Mathematica
    Table[MultiplicativeOrder[5, 5*n - 1], {n, 67}]
  • PARI
    vector(80, n, znorder(Mod(5, 5*n-1))) \\ Michel Marcus, Feb 09 2015
    

A366494 a(n) is the number of cycles of the map f(x) = 10*x mod (10*n - 1).

Original entry on oeis.org

8, 1, 1, 8, 2, 1, 5, 6, 2, 53, 1, 4, 8, 3, 1, 14, 4, 1, 41, 2, 16, 29, 1, 34, 8, 49, 1, 26, 2, 7, 11, 16, 4, 5, 3, 2, 80, 1, 1, 26, 2, 1, 83, 2, 14, 29, 9, 2, 8, 1, 1, 14, 2, 27, 17, 16, 2, 5, 9, 2, 14, 1, 25, 26, 16, 1, 5, 8, 14, 5, 1, 2, 32, 3, 5, 50, 4, 17, 5, 4, 4, 143
Offset: 1

Views

Author

Hillel Wayne, Oct 10 2023

Keywords

Comments

Taking the length of each orbit that starts from f(0)=1 gives the sequence A128858.
Equivalently, the number of cyclotomic cosets of 10 mod (10*n - 1). See A006694.
Map is the Multiply-with-carry algorithm with a=n, b=10, and c=1.

Examples

			For a(4) the 8 cycles are:
  (1 10 22 25 16 4)
  (2 20 5 11 32 8)
  (3 30 27 36 9 12)
  (6 21 15 33 18 24)
  (7 31 37 19 34 28)
  (13)
  (14 23 35 38 29 17)
  (26)
		

Crossrefs

Programs

  • PARI
    a(n)=sumdiv(10*n-1, d, eulerphi(d)/znorder(Mod(10, d)))-1;
    vector(100, n, a(n-1)) \\ Joerg Arndt, Jan 22 2024
  • Python
    def get_num_orbits(n: int) -> int:
        orbits = 0
        mod = 10*n - 1
        seen = set()
        for i in range(1, mod):
            if i not in seen:
                seen.add(i)
                orbits += 1
            x = 10*i % mod
            while x != i:
                seen.add(x)
                x = 10*x % mod
        return orbits
    
  • Python
    from sympy import totient, n_order, divisors
    def A366494(n): return sum(totient(d)//n_order(10,d) for d in divisors(10*n-1,generator=True) if d>1) # Chai Wah Wu, Apr 09 2024
    
Showing 1-3 of 3 results.