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

A384869 For n >= 1, a(n) = Sum_{k = 1..n} gcd(n, floor((n/k)*10^x)), where x = A121341(k/gcd(n,k)).

Original entry on oeis.org

1, 3, 7, 8, 17, 21, 31, 27, 53, 33, 71, 58, 85, 74, 103, 75, 129, 118, 145, 70, 209, 141, 199, 146, 197, 194, 309, 191, 281, 175, 301, 206, 427, 271, 339, 297, 397, 306, 503, 157, 481, 432, 505, 336, 559, 395, 553, 388, 607, 303, 777, 454, 677, 620, 605, 467
Offset: 1

Views

Author

Ctibor O. Zizka, Jun 11 2025

Keywords

Comments

a(n) < n^2 - n + 1.

Examples

			For n = 12:
k = 4, x = A121341(4/gcd(12,4)) = 0, gcd(12, floor((12/4)*10^0)) = 3;
k = 5, x = A121341(5/gcd(12,5)) = 1, gcd(12, floor((12/5)*10^1)) = 12;
and so on.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Max[IntegerExponent[n, 2], IntegerExponent[n, 5]] + Length[RealDigits[1/n][[1, -1]]]; a[n_] := Sum[GCD[n, Floor[(n/k)*10^f[k/GCD[n, k]]]], {k, 1, n}]; Array[a, 100] (* Amiram Eldar, Jun 19 2025 *)

A007732 Period of decimal representation of 1/n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 6, 1, 1, 1, 2, 1, 6, 6, 1, 1, 16, 1, 18, 1, 6, 2, 22, 1, 1, 6, 3, 6, 28, 1, 15, 1, 2, 16, 6, 1, 3, 18, 6, 1, 5, 6, 21, 2, 1, 22, 46, 1, 42, 1, 16, 6, 13, 3, 2, 6, 18, 28, 58, 1, 60, 15, 6, 1, 6, 2, 33, 16, 22, 6, 35, 1, 8, 3, 1, 18, 6, 6, 13, 1, 9, 5, 41, 6, 16, 21, 28, 2, 44, 1
Offset: 1

Views

Author

N. J. A. Sloane, Hal Sampson [ hals(AT)easynet.com ]

Keywords

Comments

Appears to be a divisor of A007733*A007736. - Henry Bottomley, Dec 20 2001
Primes p such that a(p) = p-1 are in A001913. - Dmitry Kamenetsky, Nov 13 2008
When 1/n has a finite decimal expansion (namely, when n = 2^a*5^b), a(n) = 1 while A051626(n) = 0. - M. F. Hasler, Dec 14 2015
a(n.n) >= a(n) where n.n is A020338(n). - Davide Rotondo, Jun 13 2024

References

  • J. H. Conway and R. K. Guy, The Book of Numbers, Copernicus Press, NY, 1996, pp. 159 etc.

Crossrefs

Programs

  • Maple
    A007732 := proc(n)
        a132740 := 1 ;
        for pe in ifactors(n)[2] do
            if not op(1,pe) in {2,5} then
                a132740 := a132740*op(1,pe)^op(2,pe) ;
            end if;
        end do:
        if a132740 = 1 then
            1 ;
        else
            numtheory[order](10,a132740) ;
        end if;
    end proc:
    seq(A007732(n),n=1..50) ; # R. J. Mathar, May 05 2023
  • Mathematica
    Table[r = n/2^IntegerExponent[n, 2]/5^IntegerExponent[n, 5]; MultiplicativeOrder[10, r], {n, 100}] (* T. D. Noe, Oct 17 2012 *)
  • PARI
    a(n)=znorder(Mod(10,n/2^valuation(n,2)/5^valuation(n,5))) \\ Charles R Greathouse IV, Jan 14 2013
    
  • Python
    from sympy import n_order, multiplicity
    def A007732(n): return n_order(10,n//2**multiplicity(2,n)//5**multiplicity(5,n)) # Chai Wah Wu, Feb 07 2022
  • Sage
    def a(n):
        n = ZZ(n)
        rad = 2**n.valuation(2) * 5**n.valuation(5)
        return Zmod(n // rad)(10).multiplicative_order()
    [a(n) for n in range(1, 20)]
    # F. Chapoton, May 03 2020
    

Formula

Note that if n=r*s where r is a power of 2 and s is odd then a(n)=a(s). Also if n=r*s where r is a power of 5 and s is not divisible by 5 then a(n) = a(s). So we just need a(n) for n not divisible by 2 or 5. This is the smallest number m such that n divides 10^m - 1; m is a divisor of phi(n), where phi = A000010.
phi(n) = n-1 only if n is prime and since a(n) divides phi(n), a(n) can only equal n-1 if n is prime. - Scott Hemphill (hemphill(AT)alumni.caltech.edu), Nov 23 2006
a(n)=a(A132740(n)); a(A132741(n))=a(A003592(n))=1. - Reinhard Zumkeller, Aug 27 2007

Extensions

More terms from James Sellers, Feb 05 2000

A054710 Number of powers of 10 mod n.

Original entry on oeis.org

1, 2, 1, 3, 2, 2, 6, 4, 1, 2, 2, 3, 6, 7, 2, 5, 16, 2, 18, 3, 6, 3, 22, 4, 3, 7, 3, 8, 28, 2, 15, 6, 2, 17, 7, 3, 3, 19, 6, 4, 5, 7, 21, 4, 2, 23, 46, 5, 42, 3, 16, 8, 13, 4, 3, 9, 18, 29, 58, 3, 60, 16, 6, 7, 7, 3, 33, 18, 22, 7, 35, 4, 8, 4, 3, 20, 6, 7, 13, 5, 9, 6, 41, 8, 17, 22, 28, 5, 44, 2
Offset: 1

Views

Author

Henry Bottomley, Apr 20 2000

Keywords

Crossrefs

Cf. A054703 (base 2), A054704 (3), A054705 (4), A054706 (5), A054707 (6), A054708 (7), A054709 (8), A054717 (9), A351524 (11), A054712 (12), A054713 (13), A054714 (14), A054715 (15), A054716 (16).

Programs

  • Mathematica
    Table[Length[Union[PowerMod[10, Range[0,n], n]]], {n,100}] (* T. D. Noe, Aug 30 2006 *)
    a[n_] := Module[{e = IntegerExponent[n, {2, 5}]}, Max[e] + MultiplicativeOrder[10, n/Times @@ ({2, 5}^e)]]; Array[a, 100] (* Amiram Eldar, Aug 25 2024 *)

Formula

a(n) = A007732(n) + A051628(n). - Amiram Eldar, Aug 25 2024

A122060 Position in decimal expansion of 1/n where repetition begins.

Original entry on oeis.org

2, 3, 2, 4, 3, 3, 7, 5, 2, 3, 3, 4, 7, 8, 3, 6, 17, 3, 19, 4, 7, 4, 23, 5, 4, 8, 4, 11, 29, 3
Offset: 1

Views

Author

Ben Paul Thurston, Sep 14 2006

Keywords

Comments

If 1/n = 0.XYYYYY... then sequence gives index of first digit of the second Y.
a(4) = 4 and a(p) = p for primes p = {7, 17, 19, 23, 29, 47, 59, 61, 97, ...} = A001913(n) Cyclic numbers: primes with primitive root 10. - Alexander Adamchuk, Jan 28 2007

Examples

			a(4) = 4 because in 0.2500 the zero begins repeating at the fourth position.
a(17) = 17 because 0.05882352941176470588... begins repeating at the 17th position.
		

Crossrefs

Formula

a(n)=A121341(n)+2 if 1/n terminates, else a(n)=A121341(n)+1. - R. J. Mathar, Sep 20 2006

A225488 Murai Chuzen numbers.

Original entry on oeis.org

9, 45, 3, 225, 18, 15, -1, 1125, 1, 99, 495, 33, 2475, 198, 165, -1, 12375, 11, 999, 4995, 333, 24975, 1998, 1665, -1, 124875, 111, 9999, 49995, 3333, 249975, 19998, 16665, -1, 1249875, 1111, 99999, 49995, 33333, 2499975, 199998, 166665, -1, 12499875, 11111, 999999, 4999995, 333333, 24999975, 1999998, 1666665, -1, 124999875, 111111
Offset: 1

Views

Author

Jonathan Sondow, May 10 2013

Keywords

Comments

"Murai Chuzen divides 9 by 1, 2, 3, 4, 5, 6, 7, 8, 9, getting the figures 9, 45, 3, 225, 18, 15, x (not divisible), 1125, 1, -- without reference to the decimal points. Similarly he divides 99 by 1, 2, 3, 4, 5, 6, 7, 8, 9, getting the figures 99, 495, 33, 2475, 198, 165, x, 12375, 11. Next he divides 999 by 1, 2, 3, 4, 5, 6, 7, 8, 9, getting the figures 999, 4995, 333, 24975, 1998, 1665, x, 124875, 111." (Smith and Mikami, expanded and corrected)
Smith and Mikami put "x" whenever a decimal does not terminate. In the data, I put -1 instead of "x".
Murai Chuzen concludes that if 1 is divided by 9, 45, 3, 225, 18, 15, 1125, and 1, the results will have one-digit repetends; if 1 is divided by 99, 495, 33, 2475, 198, 165, 12375, and 11, the results will have two-digit repetends; if 1 is divided by 999, 4995, 333, 24975, 1998, 1665, 124875, and 111, the results will have three-digit repetends; etc.

Examples

			9/1 = 9, so a(1) = 9; 9/2 = 4.5, so a(2) = 45; 9/7 does not terminate, so a(7) = -1; 9/8 = 1.125, so a(8) = 1125; 9/9 = 1, so a(9) = 1.
99/1 = 99, so a(10) = 99; 99/2 = 49.5, so a(11) = 495.
		

References

  • Murai Chuzen, Sampo Doshi-mon (Arithmetic for the Young), 1781.

Crossrefs

A307070 a(n) is the number of decimal places before the decimal expansion of 1/n terminates, or the period of the recurring portion of 1/n if it is recurring.

Original entry on oeis.org

0, 1, 1, 2, 1, 1, 6, 3, 1, 1, 2, 1, 6, 6, 1, 4, 16, 1, 18, 2, 6, 2, 22, 1, 2, 6, 3, 6, 28, 1, 15, 5, 2, 16, 6, 1, 3, 18, 6, 3, 5, 6, 21, 2, 1, 22, 46, 1, 42, 2, 16, 6, 13, 3, 2, 6, 18, 28, 58, 1, 60, 15, 6, 6, 6, 2, 33, 16, 22, 6, 35, 1, 8, 3, 1, 18, 6, 6, 13
Offset: 1

Views

Author

Luke W. Richards, Mar 22 2019

Keywords

Comments

If the decimal expansion of 1/n terminates, we will write it as ending with infinitely many 0's (rather than 9's). Then for any n > 1, the expansion of 1/n consists of a preamble whose length is given by A051628(n), followed by a periodic part with period length A007732(n). This sequence is defined as follows: If the only primes dividing n are 2 and 5 (see A003592), a(n) = A051628(n), otherwise a(n) = A007732(n) (and the preamble is ignored). - N. J. A. Sloane, Mar 22 2019
This sequence was discovered by a school class (aged 12-13) at Arden School, Solihull, UK.
Equally space the digits 0-9 on a circle. The digits of the decimal expansion of rational numbers can be connected on this circle to form data visualizations. This sequence is useful, cf. A007732 or A051626, for identifying the complexity of that visualization.

Examples

			1/1 is 1.0. There are no decimal digits, so a(1) = 0.
1/2 is 0.5. This is a terminating decimal. There is 1 digit, so a(2) = 1.
1/6 is 0.166666... This is a recurring decimal with a period of 1 (the initial '1' does not recur) so a(6) = 1.
1/7 is 0.142857142857... This is a recurring decimal, with a period of 6 ('142857') so a(7) = 6.
		

Crossrefs

See A114205 and A051628 for the preamble, A036275 and A051626 for the periodic part.

Programs

  • PARI
    a(n) = my (t=valuation(n,2), f=valuation(n,5), r=n/(2^t*5^f)); if (r==1, max(t,f), znorder(Mod(10, r))) \\ Rémy Sigrist, May 08 2019
  • Python
    def sequence(n):
      count = 0
      dividend = 1
      remainder = dividend % n
      remainders = [remainder]
      no_recurrence = True
      while remainder != 0:
        count += 1
        dividend = remainder * 10
        remainder = dividend % n
        if remainder in remainders:
          if no_recurrence:
            no_recurrence = False
            remainders = [remainder]
          else:
            return len(remainders)
        else:
          remainders.append(remainder)
      else:
        return count
    

Extensions

More terms from Rémy Sigrist, May 08 2019
Showing 1-6 of 6 results.