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

A175561 Period of the decimal representation of 1/Fibonacci(n).

Original entry on oeis.org

1, 1, 1, 1, 6, 6, 16, 2, 44, 1, 232, 84, 60, 138, 133, 144, 336, 10, 420, 396, 28656, 66, 1500, 3016, 5616, 84, 514228, 60, 335824, 152214, 9900, 67830, 70980, 7632, 4440, 261744, 27144, 30, 504628, 420, 108373609, 47124, 9120, 3295440, 2971215072, 836418
Offset: 3

Views

Author

Michel Lagneau, Jul 02 2010

Keywords

Comments

With regard to A175550, where the period of 1/Fibonacci(n) is concerned with the Fibonacci numbers such that gcd(Fibonacci(n), 10) = 1 only, this sequence is complete.

Examples

			a(8) = 6 because Fibonacci(8) = 21, and 1/21 = 0. 047619 047619 047619 047619 ... => period = 6;
a(9) = 16 because Fibonacci(9) = 34, and 1/34 = 0.0 2941176470588235 2941176470588235 2941176470588235 ... => period = 16.
		

Crossrefs

Programs

  • Mathematica
    Table[MultiplicativeOrder[10, n/Times @@ ({2, 5}^IntegerExponent[n, {2, 5}])], {n, Fibonacci[Range[3, 50]]}] (* Amiram Eldar, May 26 2024 *)
  • PARI
    a(n) = my(f=fibonacci(n)); znorder(Mod(10, f/2^valuation(f, 2)/5^valuation(f, 5))); \\ Michel Marcus, May 26 2024

Formula

a(n) = A007732(A000045(n)).

Extensions

a(23) onward corrected by Sean A. Irvine, May 26 2024

A175741 Integers n for which the period of the decimal expansion of 1/n is 100.

Original entry on oeis.org

25351, 50702, 60101, 76053, 101404, 120202, 126755, 152106, 180303, 202808, 228159, 240404, 253510, 278861, 300505, 304212, 360606, 380265, 405616, 456318, 480808, 507020, 510151, 540909, 557722, 601010, 608424, 633775, 661111, 721212, 760530, 811232, 836583, 888791, 901515, 912636, 961616
Offset: 1

Views

Author

Harvey P. Dale, Dec 04 2010

Keywords

Comments

Numbers such that A007732(n) = 100. - Andrew Howroyd, Jan 14 2020

Crossrefs

Programs

  • Mathematica
    Transpose[Select[Table[{n,Length[RealDigits[1/n][[1,-1]]]},{n,500000}],#[[2]]==100&]][[1]]
  • PARI
    is(n)={my(t=n/(2^valuation(n,2)*5^valuation(n,5))); 100==znorder(Mod(10,t))}
    {for(n=1, 10^6, if(is(n), print1(n, ", ")))} \\ Andrew Howroyd, Jan 14 2020

Extensions

Terms a(22) and beyond from Andrew Howroyd, Jan 14 2020

A176920 Period of decimal representation of 1/n^2.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 42, 1, 9, 1, 22, 1, 78, 42, 1, 1, 272, 9, 342, 1, 42, 22, 506, 1, 1, 78, 81, 42, 812, 1, 465, 1, 22, 272, 42, 9, 111, 342, 78, 1, 205, 42, 903, 22, 9, 506, 2162, 1, 2058, 1, 272, 78, 689, 81, 22, 42, 342, 812, 3422, 1, 3660, 465, 126, 1, 78, 22, 2211, 272, 506
Offset: 1

Views

Author

Keywords

Comments

term #7=42; 1/7^2= 0. 020408163265306122448979591836734693877551` 020408163265306122448979591836734693877551` 020408163265306122448979591836734693877551` 02040816326530612244897959183673469..

Crossrefs

Programs

  • Mathematica
    DigitCycleLength[r_Rational,b_Integer?Positive]:=MultiplicativeOrder[b,FixedPoint[Quotient[ #,GCD[ #,b]]&,Denominator[r]]];Table[If[n<2,1,DigitCycleLength[1/n^2,10]],{n,5!}]

A236250 Period of the n-th convergent to the continued fraction expansion of Pi.

Original entry on oeis.org

1, 6, 13, 112, 51, 24, 15088, 12284, 88460, 1204, 459, 31824, 93210, 1864254, 531648, 456036, 8299090, 28574910, 1813560, 32552820, 33166008, 133585180, 2503410, 214098720, 3183870690, 7411133309730, 4852769490690, 2294509753536, 175964053944, 3336533898768
Offset: 1

Views

Author

Jani Melik, Jan 21 2014

Keywords

Examples

			The 2nd convergent is 22/7 = 3.142857 142857 ..., whose period is 6, so a(2) = 6.
The 3rd convergent is 333/106 = 3.1 4150943396226 4150943396226 ..., whose period is 13, so a(3) = 13.
		

Crossrefs

Programs

  • Sage
    st_clenov = 30
    def A236250(n) :
       vu = continued_fraction_list(pi, nterms=st_clenov);
       p = []
       for i in (0..n) :
          p.append(convergents(vu)[i].period())
       return(p)
    A236250(st_clenov-1);

Formula

a(n) = A007732(A002486(n+2)). - Michel Marcus, Jan 21 2014

A268731 Period of the decimal expansion of 1/h(n) where h(n) is the length of the finite sequence {n, f(n), f(f(n)),...,1} in the Collatz (or 3n + 1) problem.

Original entry on oeis.org

1, 6, 1, 1, 1, 1, 1, 18, 1, 6, 1, 1, 16, 16, 1, 1, 1, 1, 6, 6, 1, 1, 1, 22, 1, 3, 1, 1, 1, 13, 1, 6, 6, 6, 6, 6, 6, 16, 1, 108, 1, 28, 1, 1, 1, 6, 2, 1, 1, 1, 2, 2, 6, 6, 18, 1, 18, 1, 18, 18, 53, 53, 1, 3, 3, 3, 6, 6, 6, 16, 2, 22, 2, 6, 2, 2, 6, 6, 1, 2, 2, 2
Offset: 2

Views

Author

Michel Lagneau, Feb 12 2016

Keywords

Comments

a(n) = A007732(A006577(n)).

Examples

			a(3) = 6 because A007732(A006577(3)) = A007732(7) = 6.
		

Crossrefs

Programs

  • Mathematica
    f[n_]:=Module[{a=n,k=0},While[a!=1,k++;If[EvenQ[a],a=a/2,a=a*3+1]];k]; Table[r = f[n]/2^IntegerExponent[f[n], 2]/5^IntegerExponent[f[n], 5]; MultiplicativeOrder[10, r], {n, 2,100}]

A276981 Irregular triangle T(n,k) read by rows of residue classes of powers of 10 modulo n.

Original entry on oeis.org

0, 1, 0, 1, 1, 2, 0, 1, 0, 1, 4, 1, 3, 2, 6, 4, 5, 1, 2, 4, 0, 1, 1, 0, 1, 10, 1, 10, 4, 1, 10, 9, 12, 3, 4, 1, 10, 2, 6, 4, 12, 8, 1, 10, 1, 10, 4, 8, 0, 1, 10, 15, 14, 4, 6, 9, 5, 16, 7, 2, 3, 13, 11, 8, 12, 1, 10, 1, 10, 5, 12, 6, 3, 11, 15, 17, 18, 9, 14, 7, 13, 16, 8, 4, 2
Offset: 1

Views

Author

Martin Renner, Apr 11 2017

Keywords

Comments

The length of the nonperiodic part of the residue class values is given in A051628, the length of the periodic part is given in A007732.
These residue class values are useful to check the divisibility of a number by the divisor n simply by calculating the weighted sum of digits. For example, the number 86415 is divisible by 7, because the weighted sum of digits 5*1 + 1*3 + 4*2 + 6*6 + 8*4 = 84 is divisible by 7. The used weights are the residue class values for n = 7: 1, 3, 2, 6, 4, 5, ... for ones, tens, hundreds, ...

Examples

			T(n,k), 1 <= k <= A051628(n) + A007732(n), starts with
n = 1:  0
n = 2:  1, 0
n = 3:  1
n = 4:  1, 2, 0
n = 5:  1, 0
n = 6:  1, 4
n = 7:  1, 3, 2, 6, 4, 5
n = 8:  1, 2, 4, 0
n = 9:  1
n = 10: 1, 0
n = 11: 1, 10
n = 12: 1, 10, 4
etc.
		

Crossrefs

Programs

  • Maple
    a:=proc(n)
      local R,N,P,i;
      R:=[seq(10^k mod n,k=0..n)]; # residue class
      N:=[]; # nonperiodic part
      P:=[]; # periodic part
      for i from 1 to nops(R) do
        member(R[i],R,'m');
        if m
    				

A306355 Numbers k such that the period of 1/k, or 0 if 1/k terminates, is strictly greater than the period of the decimal expansion of 1/m for all m < k.

Original entry on oeis.org

1, 3, 7, 17, 19, 23, 29, 47, 59, 61, 97, 109, 113, 131, 149, 167, 179, 181, 193, 223, 229, 233, 257, 263, 269, 289, 313, 337, 361, 367, 379, 383, 389, 419, 433, 461, 487, 491, 499, 503, 509, 541, 571, 577, 593, 619, 647, 659, 701, 709, 727, 743, 811, 821, 823
Offset: 1

Author

Matthew Schulz, Feb 09 2019

Keywords

Comments

This sequence is infinite because 1/(10^k-1) has a period of k for all k, so the period can be arbitrarily large.
Are 1, 3, 289 and 361 the only terms that are not in A001913? - Robert Israel, Feb 10 2019

Examples

			7 is a term because 1/7 has a period of 6, which is greater than the periods of 1/m for m < 7.
		

Crossrefs

Contains A001913.

Programs

  • Maple
    count:= 1: A[1]:= 1: m:= 0:
    for k from 0 to 100 do
      for d in [3,7,9,11] do
         x:= 10*k+d;
         p:= numtheory:-order(10,x);
         if p > m then
            m := p;
            count:= count+1;
            A[count]:= x
         fi
    od od:
    seq(A[i],i=1..count); # Robert Israel, Feb 10 2019
  • Mathematica
    ResourceFunction["ProgressiveMaxPositions"]@
     Map[n |->
        First[RealDigits[n]] /. {{_, list_?ListQ} :> Length[list],
          list_?ListQ -> 0}][
      1/Range[1050]] (* Peter Cullen Burbery, Aug 05 2023 *)

Formula

RECORDS transform of A051626.

A350220 Composite numbers d such that the period k of the repetend of 1/d is > 1 and divides d-1, and d is the first such composite with a given period.

Original entry on oeis.org

33, 91, 148, 246, 451, 496, 505, 561, 657, 703, 1035, 1105, 1912, 2120, 2465, 2556, 2752, 2821, 4005, 4141, 5461, 6525, 6533, 6565, 6601, 6700, 7107, 8695, 8905, 8911, 10585, 11649, 12403, 12801, 13366, 13695, 13833, 14701, 15211, 15841, 17120, 18336, 19345, 19503, 19900
Offset: 1

Author

Barry Smyth, Mar 27 2022

Keywords

Comments

This is a subset of sequence A351396 with the extra condition that d is included if and only if it is the smallest value of d with a given period. Thus, 246 is included because its period is 5 (repetend is 04065) and it is the first valid of d with this period and, moreover, 5 divides evenly into 245. However, 55 (which is in A351396) is excluded because although its period (2 based on a repetend of 18 for 1/55) divides evenly into 54, there is a smaller value of d (33) with this property and a period of 2 (1/33 has a repetend of 03).

Examples

			33 is a term since 1/33 = 0.030303..., its repetend is 03, so its period is 2, 2 divides into 33-1 evenly, and there is no smaller value of d with this period.
91 is a term since 1/91 = 0.010989010989..., its repetend is 010989, so its period is 6, 6 divides into 91-1 evenly, and there is no smaller value of d with this period.
148 is a term since 1/148 = 0.00675675..., its repetend is 675, so its period is 3, 3 divides into 148-1 evenly, and there is no smaller value of d with this period.
Note that 370 is not in the sequence even though the repetend of 1/370 is 027 (period = 3) and 3 divides 370-1 because the period of 3 is accounted for by 148; note, 370 is in the related sequence A351396.
		

Crossrefs

Cf. A007732 (digits period), A000010 (totient), A351396.

Programs

  • Python
    from itertools import count, islice
    from sympy import n_order, multiplicity, isprime
    def A350220_gen(): # generator of terms
        pset = set()
        for d in count(1):
            if not (isprime(d) or (p := n_order(10, d//2**multiplicity(2, d)//5**multiplicity(5, d))) <= 1 or (d-1) % p or p in pset):
                yield d
                pset.add(p)
    A350220_list = list(islice(A350220_gen(),50)) # Chai Wah Wu, May 19 2022

A350598 Composite numbers d such that the period k of the repetend of 1/d is > 1 and divides d-1, and d is the first such composite with a given repetend.

Original entry on oeis.org

33, 55, 91, 99, 148, 165, 175, 246, 259, 275, 325, 370, 385, 451, 481, 495, 496, 505, 561, 592, 656, 657, 703, 715, 825, 909, 925, 1035, 1045, 1105, 1233, 1375, 1476, 1626, 1729, 1825, 1912, 2035, 2120, 2275, 2368, 2409, 2465, 2475, 2525, 2556, 2752, 2821, 2981, 3160
Offset: 1

Author

Barry Smyth, Mar 27 2022

Keywords

Comments

This is a subset of sequence A351396, and adds the extra condition that d is included only if it is the smallest value of d with a given repetend; thus duplicate repetends are not permitted. This eliminates some values of A351396 which are powers of 10 of d. For example, 1480 is excluded because although its period (k=3 based on a repetend of 675) divides evenly into 1479, this repetend already exists for a smaller value of d, namely 148, and 3 also divides evenly into 147. 1480 is the smallest such value of d from A351396 that will be excluded based on this modification. Other values of A351396 that are excluded include 3700, 5920, 9250, 14800, ...

Examples

			33 is a term since 1/33 = 0.030303..., its repetend is 03, so its period is 2, 2 divides 33-1 evenly, and there is no smaller value of d with this repetend.
148 is in the sequence because 1/148 has 675 as its repetend, so its period is 3 and 3 divides 148-1.
		

Crossrefs

Cf. A007732 (digits period), A000010 (totient), A351396.

Programs

  • Python
    from itertools import count, islice
    from sympy import n_order, multiplicity, isprime
    def A350598_gen(): # generator of terms
        pset = set()
        for d in count(1):
            if not isprime(d):
                m2, m5 = multiplicity(2,d), multiplicity(5,d)
                r = max(m2,m5)
                k, m = 10**r, 10**(t := n_order(10,d//2**m2//5**m5))-1
                c = k//d
                s = str(m*k//d-c*m).zfill(t)
                if not (t <= 1 or (d-1) % t or s in pset):
                    yield d
                    pset.add(s)
    A350598_list = list(islice(A350598_gen(),50)) # Chai Wah Wu, May 19 2022

A370757 a(n) is the least k > 0 such that 1/n and 1/k have equivalent repeating decimal digits.

Original entry on oeis.org

1, 1, 3, 1, 1, 6, 7, 1, 9, 1, 11, 3, 13, 7, 6, 1, 17, 18, 19, 1, 21, 22, 23, 6, 1, 26, 27, 7, 29, 3, 31, 1, 33, 17, 7, 36, 37, 19, 39, 1, 41, 42, 43, 44, 45, 23, 47, 3, 49, 1, 51, 13, 53, 54, 55, 7, 57, 29, 59, 6, 61, 31, 63, 1, 26, 66, 67, 17, 69, 7, 71, 72
Offset: 1

Author

Rémy Sigrist, Feb 29 2024

Keywords

Comments

In other words, a(n) is the least k > 0 such that the fractional parts of (10^i)/n and (10^j)/k are equal for some integers i, j.
a(n) is not always a divisor of n. For example, a(65) = 26 is not a divisor of 65. - David A. Corneth, Mar 01 2024

Examples

			The first terms, alongside the decimal expansion of 1/n with its repeating decimal digits in parentheses, are:
  n   a(n)  1/n
  --  ----  -----------
   1     1  1.(0)
   2     1  0.5(0)
   3     3  0.(3)
   4     1  0.25(0)
   5     1  0.2(0)
   6     6  0.1(6)
   7     7  0.(142857)
   8     1  0.125(0)
   9     9  0.(1)
  10     1  0.1(0)
  11    11  0.(09)
  12     3  0.08(3)
  13    13  0.(076923)
  14     7  0.07(142857)
  15     6  0.0(6)
		

Crossrefs

Cf. A000265 (base-2 analog), A038502 (base-3 analog), A132739 (base-5 analog), A242603 (base-7 analog).

Programs

  • PARI
    \\ See Links section.
    
  • Python
    from itertools import count
    from sympy import multiplicity, n_order
    def A370757(n):
        m2, m5 = (~n & n-1).bit_length(), multiplicity(5,n)
        r = max(m2,m5)
        w, m = 10**r, 10**(t:=n_order(10,n2) if (n2:=(n>>m2)//5**m5)>1 else 1)-1
        c = w//n
        s = str(m*w//n-c*m).zfill(t)
        l = len(s)
        for k in count(1):
            m2, m5 = (~k & k-1).bit_length(), multiplicity(5,k)
            r = max(m2,m5)
            w, m = 10**r, 10**(t:=n_order(10,k2) if (k2:=(k>>m2)//5**m5)>1 else 1)-1
            c = w//k
            if any(s[i:]+s[:i] == str(m*w//k-c*m).zfill(t) for i in range(l)):
                return k # Chai Wah Wu, Mar 03 2024

Formula

a(n) = 1 iff n belongs to A003592.
a(10*n) = a(n).
A007732(a(n)) = A007732(n).
Previous Showing 31-40 of 47 results. Next