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-10 of 107 results. Next

A117920 Number of digits in the decimal expansion of the regular unit fractions 1/A003592.

Original entry on oeis.org

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

Views

Author

Eric W. Weisstein, Apr 02 2006

Keywords

Examples

			1/A003592(2) = 1/2 = 0.5, with 1 digit after the decimal point, so a(2) = 1.
		

Crossrefs

Cf. A003592.

Programs

  • Mathematica
    digNum[n_] := Length[(dig = RealDigits[1/n,10])[[1]]] - dig[[2]]; s = {}; m = 12; Do[n = 5^k; While[n <= 5^m, AppendTo[s, n]; n *= 2], {k, 0, m}]; Rest[digNum /@ Union[s]] (* Amiram Eldar, Feb 08 2020 *)

Extensions

Offset corrected by Amiram Eldar, Feb 08 2020

A164768 First differences of A003592.

Original entry on oeis.org

1, 2, 1, 3, 2, 6, 4, 5, 7, 8, 10, 14, 16, 20, 25, 3, 32, 40, 50, 6, 64, 80, 100, 12, 113, 15, 160, 200, 24, 226, 30, 320, 400, 48, 452, 60, 565, 75, 800, 96, 904, 120, 1130, 150, 1600, 192, 1808, 240, 2260, 300, 2825, 375, 384, 3616, 480, 4520, 600, 5650
Offset: 1

Views

Author

Barry Wells (wells.barry(AT)gmail.com), Aug 26 2009, Sep 24 2009

Keywords

Comments

The gaps between the natural numbers whose reciprocals are terminating decimals.

Examples

			The first few terms of A003592 are 1, 2, 4, 5, 8, 10, 16 because 1/1, 1/2, 1,4, 1/5, 1/8 etc. terminate and 1/3, 1/6, 1/7, 1/9 etc. repeat. Hence the denominators of the first few terminating decimals are 1, 2, 4, 5, 8, 10, 16 and the first differences between these gives the sequence 1,2,1,3,2,4
		

Crossrefs

Cf. A003592.

Formula

a(n) = A003592(n+1) - A003592(n). - Amiram Eldar, Feb 08 2020

A180953 The number of terms of the form 2^i*5^j (A003592) less than or equal to 10^n.

Original entry on oeis.org

1, 6, 15, 29, 48, 72, 100, 134, 172, 214, 262, 314, 371, 433, 500, 571, 647, 728, 813, 904, 999, 1099, 1204, 1313, 1427, 1546, 1670, 1798, 1932, 2070, 2212, 2359, 2511, 2668, 2829, 2996, 3167, 3342, 3523, 3708, 3898, 4093, 4293, 4497, 4706, 4920, 5138
Offset: 0

Views

Author

Robert G. Wilson v, Sep 27 2010

Keywords

Crossrefs

Cf. A003592.

Programs

  • Mathematica
    f[n_] := Sum[1 + Floor@ Log[2, 10^n/5^k], {k, 0, Floor@ Log[5, 10^n]}]; Array[f, 47, 0]

A352218 a(n) = least k such that A003592(n) | 20^k.

Original entry on oeis.org

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

Views

Author

Michael De Vlieger, Mar 08 2022

Keywords

Comments

Also, number of digits in the vigesimal (base 20) expansion of terminating unit fractions 1/A003592.

Examples

			a(1) = 0 since A003592(1) = 1 | 20^0.
a(4) = 1 since A003592(4) = 5 | 20^1; 1/5 in base 20 = 0.4.
a(5) = 2 since A003592(5) = 8 | 20^2; 1/8 in base 20 = 0.2a, where "a" is digit 10, etc.
		

References

  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, Chapter IX: The Representation of Numbers by Decimals, Theorem 136. 8th ed., Oxford Univ. Press, 2008, 144-145.

Crossrefs

Programs

  • Mathematica
    With[{nn = 360000}, Sort[Join @@ Table[{2^a*5^b, Max[Ceiling[a/2], b]}, {a, 0, Log2[nn]}, {b, 0, Log[5, nn/(2^a)]}]][[All, -1]] ]

A181980 Least positive integer m > 1 such that 1 - m^k + m^(2k) - m^(3k) + m^(4k) is prime, where k = A003592(n).

Original entry on oeis.org

2, 4, 2, 6, 2, 20, 20, 26, 25, 10, 14, 5, 373, 4, 65, 232, 56, 2, 521, 911, 1156, 1619, 647, 511, 34, 2336, 2123, 1274, 2866, 951, 2199, 1353, 4965, 7396, 13513, 3692, 14103, 32275, 2257, 86, 3928, 2779, 18781, 85835, 820, 16647, 2468, 26677, 1172, 38361, 40842
Offset: 1

Views

Author

Lei Zhou, Apr 04 2012

Keywords

Comments

1 - m^k + m^(2*k) - m^(3^k) + m^(4*k) equals Phi(10*k,m).
First 15 terms were generated by the provided Mathematica program. All other terms found using OpenPFGW as Fermat and Lucas PRP. Term 16-20, 22-24, 27 have N^2-1 factored over 33.3% and proved using OpenPFGW;
terms 21, 25, 29-33, 36, 37, 39, 41, 42, 45, 48, 51 are proved using CHG pari script;
terms 26, 28, 34, 40 are proved using kppm PARI script;
terms 35, 38, 43, 44, 46, 47, 49, 50 do not yet have a primality certificate.
The corresponding prime number of term 51 (40842) has 236089 digits.
The corresponding prime numbers for the following terms are equal:
p(3) = p(2) = Phi(10, 2^4),
p(12) = p(9) = Phi(10, 5^50),
p(18) = p(14) = Phi(10, 2^160),
p(25) = p(21) = Phi(10, 34^512),
p(40) = p(34) = Phi(10, 86^4000).

Examples

			n=1, A003592(1) = 1, when a=2, 1 - 2^1 + 2^2 - 2^3 + 2^4 = 11 is prime, so a(1)=2;
n=2, A003592(2) = 2, when a=4, 1 - 4^2 + 4^4 - 4^6 + 4^8 = 61681 is prime, so a(2)=4;
...
n=13, A003592(13) = 64, when a=373, PrimeQ(1 - 373^64 + 373^128 - 373^192 + 373^256) = True, while for a = 2..372, PrimeQ(1 - a^64 + a^128 - a^192 + a^256) = False, so a(13)=373.
		

Crossrefs

Programs

  • Mathematica
    fQ[n_] := PowerMod[10, n, n] == 0;a = Select[10 Range@100, fQ]/10; l = Length[a]; Table[m = a[[j]]; i = 1;While[i++; cp = 1 - i^m + i^(2*m)-i^(3*m)+i^(4*m); ! PrimeQ[cp]]; i, {j, 1, l}]
  • PARI
    do(k)=my(m=1);while(!ispseudoprime(polcyclo(10*k,m++)),);m
    list(lim)=my(v=List(), N); for(n=0, log(lim)\log(5), N=5^n; while(N<=lim, listput(v, N); N<<=1)); apply(do, vecsort(Vec(v))) \\ Charles R Greathouse IV, Apr 04 2012

Formula

a(n) = A085398(10*A003592(n)). - Jinyuan Wang, Jan 01 2023

Extensions

Term 50 added and comments updated by Lei Zhou, Jul 27 2012
Term 51 added and comments updated by Lei Zhou, Oct 10 2012

A299025 a(n) = the fractional part of 1 / A003592(n) read backwards.

Original entry on oeis.org

0, 5, 52, 2, 521, 1, 5260, 50, 40, 52130, 520, 20, 526510, 5210, 10, 800, 5218700, 52600, 500, 400, 52609300, 521300, 5200, 200, 521359100, 6100, 5265100, 52100, 100, 5265679000, 8000, 52187000, 526000, 5000, 52182884000, 4000, 526093000, 23000, 5213000, 52000
Offset: 1

Views

Author

Rémy Sigrist, Feb 01 2018

Keywords

Comments

Numbers in this sequence that also appear in A003592, sorted, include the product of numbers k | 10^e with integer e >= 0 and 10^m with m >= e. For instance, the proper divisors of 10 {1, 2, 5} appear and {10, 20, 40, 50} follow, finally {100, 200, 400, 500, 800} followed by any product k 10^m with k = {1, 2, 4, 5, 8} and m >= 3. - Michael De Vlieger, Feb 03 2018

Examples

			The first terms, alongside A003592(n) and the fractional part of 1/A003592(n), are:
  n        a(n)  A003592(n)     frac(1/A003592(n))
  --       ----  ----------     ------------------
   1          0           1     0
   2          5           2     0.5
   3         52           4     0.25
   4          2           5     0.2
   5        521           8     0.125
   6          1          10     0.1
   7       5260          16     0.0625
   8         50          20     0.05
   9         40          25     0.04
  10      52130          32     0.03125
  11        520          40     0.025
  12         20          50     0.02
  13     526510          64     0.015625
  14       5210          80     0.0125
  15         10         100     0.01
  16        800         125     0.008
  17    5218700         128     0.0078125
  18      52600         160     0.00625
  19        500         200     0.005
  20        400         250     0.004
		

Crossrefs

Programs

  • Mathematica
    With[{e = 12}, Table[FromDigits@ Reverse@ PadLeft[#1, Length@ #1 + Abs@ #2] - 10 Boole[n == 1] & @@ RealDigits[1/n], {n, Sort@ Flatten@ Table[2^i*5^j, {i, 0, e}, {j, 0, Log[5, 2^(e - i)]}]}]] (* Michael De Vlieger, Feb 03 2018, after Robert G. Wilson v at A003592 *)
  • PARI
    mx = 4000; A003592 = vecsort(concat(vector(1+logint(mx,2), i, vector(1+logint(floor(mx/2^(i-1)), 5), j, 2^(i-1) * 5^(j-1)))))
    backward(n) = my (v=0, i=frac(1/n), r=1/10); while (i, v += r*floor(i); i=frac(i)*10; r*=10); v
    print (apply(backward, A003592))

Formula

a(A180953(n)) = 10^(n-1) for any n > 0.

A353384 Irregular triangle T(n,k) with row n listing A003592(j) not divisible by 20 such that A352218(A003592(j)) = n.

Original entry on oeis.org

1, 2, 4, 5, 10, 8, 16, 25, 50, 32, 64, 125, 250, 128, 256, 625, 1250, 512, 1024, 3125, 6250, 2048, 4096, 15625, 31250, 8192, 16384, 78125, 156250, 32768, 65536, 390625, 781250, 131072, 262144, 1953125, 3906250, 524288, 1048576, 9765625, 19531250, 2097152, 4194304, 48828125, 97656250
Offset: 0

Views

Author

Michael De Vlieger, Apr 15 2022

Keywords

Comments

All terms in A003592 are products T(n,k)*20^j, j >= 0.
When expressed in base 20, T(n,k) does not end in zero, yet 1/T(n,k) is a terminating fraction, regular to 20.
The first 5 terms are the proper divisors of 20.
For these reasons, the terms may be called vigesimal "proper regular" numbers.

Examples

			Row 0 contains 1 since 1 is the empty product.
Row 1 contains 2, 4, 5, and 10 since these divide 20 and are not divisible by 20.
Row 2 contains 8, 16, 25, and 50 since these divide 20^2 but not 20. The other divisors of 20^2 either divide smaller powers of 20 or they are divisible by 20 and do not appear.
Row 3 contains 32, 64, 125, and 250 since these divide 20^3 but not 20^2. The other divisors of 20^3 either divide smaller powers of 20 or they are divisible by 20 therefore do not appear.
		

References

  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, Chapter IX: The Representation of Numbers by Decimals, Theorem 136. 8th ed., Oxford Univ. Press, 2008, 144-145.

Crossrefs

Programs

  • Mathematica
    {{1}}~Join~Array[Union@ Flatten@ {#, 2 #} &@ {2^(2 # - 1), 5^#} &, 11] // Flatten

Formula

Row 0 contains the empty product, thus row length = 1.
Row n sorts {2^(2n-1), 5^n, 2^(2n), 2*5^n}, thus row length = 4.

A051037 5-smooth numbers, i.e., numbers whose prime divisors are all <= 5.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, 18, 20, 24, 25, 27, 30, 32, 36, 40, 45, 48, 50, 54, 60, 64, 72, 75, 80, 81, 90, 96, 100, 108, 120, 125, 128, 135, 144, 150, 160, 162, 180, 192, 200, 216, 225, 240, 243, 250, 256, 270, 288, 300, 320, 324, 360, 375, 384, 400, 405
Offset: 1

Views

Author

Keywords

Comments

Sometimes called the Hamming sequence, since Hamming asked for an efficient algorithm to generate the list, in ascending order, of all numbers of the form 2^i*3^j*5^k for i,j,k >= 0. The problem was popularized by Edsger Dijkstra.
Numbers k such that 8*k = EulerPhi(30*k). - Artur Jasinski, Nov 05 2008
Where record values greater than 1 occur in A165704: A165705(n) = A165704(a(n)). - Reinhard Zumkeller, Sep 26 2009
Also called "harmonic whole numbers", see Howard and Longair, 1982, Table I, page 121. - Hugo Pfoertner, Jul 16 2020
Also called ugly numbers, although it is not clear why. - Gus Wiseman, May 21 2021
Some woody bamboo species have extraordinarily long and stable flowering intervals that belong to this sequence. The model by Veller, Nowak & Davis justifies this observation from the evolutionary point of view. - Andrey Zabolotskiy, Jun 27 2021
Also those integers k for which, for every prime p > 5, p^(4*k) - 1 == 0 (mod 240*k). - Federico Provvedi, May 23 2022
As noted in the comments to A085152, Størmer's theorem implies that the only pairs of consecutive integers that appear as consecutive terms of this sequence are (1,2), (2,3), (3,4), (4,5), (5,6), (8,9), (9,10), (15,16), (24,25), and (80,81). These all represent significant musical intervals. - Hal M. Switkay, Dec 05 2022

Examples

			From _Gus Wiseman_, May 21 2021: (Start)
The sequence of terms together with their prime indices begins:
      1: {}            25: {3,3}
      2: {1}           27: {2,2,2}
      3: {2}           30: {1,2,3}
      4: {1,1}         32: {1,1,1,1,1}
      5: {3}           36: {1,1,2,2}
      6: {1,2}         40: {1,1,1,3}
      8: {1,1,1}       45: {2,2,3}
      9: {2,2}         48: {1,1,1,1,2}
     10: {1,3}         50: {1,3,3}
     12: {1,1,2}       54: {1,2,2,2}
     15: {2,3}         60: {1,1,2,3}
     16: {1,1,1,1}     64: {1,1,1,1,1,1}
     18: {1,2,2}       72: {1,1,1,2,2}
     20: {1,1,3}       75: {2,3,3}
     24: {1,1,1,2}     80: {1,1,1,1,3}
(End)
		

Crossrefs

Subsequences: A003592, A003593, A051916 , A257997.
For p-smooth numbers with other values of p, see A003586, A002473, A051038, A080197, A080681, A080682, A080683.
The partitions with these Heinz numbers are counted by A001399.
The conjugate opposite is A033942, counted by A004250.
The opposite is A059485, counted by A004250.
The non-3-smooth case is A080193, counted by A069905.
The conjugate is A037144, counted by A001399.
The complement is A279622, counted by A035300.
Requiring the sum of prime indices to be even gives A344297.

Programs

  • Haskell
    import Data.Set (singleton, deleteFindMin, insert)
    a051037 n = a051037_list !! (n-1)
    a051037_list = f $ singleton 1 where
       f s = y : f (insert (5 * y) $ insert (3 * y) $ insert (2 * y) s')
                   where (y, s') = deleteFindMin s
    -- Reinhard Zumkeller, May 16 2015
    
  • Magma
    [n: n in [1..500] | PrimeDivisors(n) subset [2,3,5]]; // Bruno Berselli, Sep 24 2012
    
  • Maple
    A051037 := proc(n)
        option remember;
        local a;
        if n = 1 then
            1;
        else
            for a from procname(n-1)+1 do
                numtheory[factorset](a) minus {2, 3,5 } ;
                if % = {} then
                    return a;
                end if;
            end do:
        end if;
    end proc:
    seq(A051037(n),n=1..100) ; # R. J. Mathar, Nov 05 2017
  • Mathematica
    mx = 405; Sort@ Flatten@ Table[ 2^a*3^b*5^c, {a, 0, Log[2, mx]}, {b, 0, Log[3, mx/2^a]}, {c, 0, Log[5, mx/(2^a*3^b)]}] (* Or *)
    Select[ Range@ 405, Last@ Map[First, FactorInteger@ #] < 7 &] (* Robert G. Wilson v *)
    With[{nn=10},Select[Union[Times@@@Flatten[Table[Tuples[{2,3,5},n],{n,0,nn}],1]],#<=2^nn&]] (* Harvey P. Dale, Feb 28 2022 *)
  • PARI
    test(n)= {m=n; forprime(p=2,5, while(m%p==0,m=m/p)); return(m==1)}
    for(n=1,500,if(test(n),print1(n",")))
    
  • PARI
    a(n)=local(m); if(n<1,0,n=a(n-1); until(if(m=n, forprime(p=2,5, while(m%p==0,m/=p)); m==1),n++); n)
    
  • PARI
    list(lim)=my(v=List(),s,t); for(i=0,logint(lim\=1,5), t=5^i; for(j=0,logint(lim\t,3), s=t*3^j; while(s<=lim, listput(v,s); s<<=1))); Set(v) \\ Charles R Greathouse IV, Sep 21 2011; updated Sep 19 2016
    
  • PARI
    smooth(P:vec,lim)={ my(v=List([1]),nxt=vector(#P,i,1),indx,t);
    while(1, t=vecmin(vector(#P,i,v[nxt[i]]*P[i]),&indx);
    if(t>lim,break); if(t>v[#v],listput(v,t)); nxt[indx]++);
    Vec(v)
    };
    smooth([2,3,5], 1e4) \\ Charles R Greathouse IV, Dec 03 2013
    
  • PARI
    is_A051037(n)=n<7||vecmax(factor(n,6)[, 1])<7 \\ M. F. Hasler, Jan 16 2015
    
  • Python
    def isok(n):
      while n & 1 == 0: n >>= 1
      while n % 3 == 0: n //= 3
      while n % 5 == 0: n //= 5
      return n == 1 #  Darío Clavijo, Dec 30 2022
    
  • Python
    from sympy import integer_log
    def A051037(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x):
            c = n+x
            for i in range(integer_log(x,5)[0]+1):
                for j in range(integer_log(y:=x//5**i,3)[0]+1):
                    c -= (y//3**j).bit_length()
            return c
        return bisection(f,n,n) # Chai Wah Wu, Sep 16 2024
    
  • Python
    # faster for initial segment of sequence
    import heapq
    from itertools import islice
    def A051037gen(): # generator of terms
        v, oldv, h, psmooth_primes, = 1, 0, [1], [2, 3, 5]
        while True:
            v = heapq.heappop(h)
            if v != oldv:
                yield v
                oldv = v
                for p in psmooth_primes:
                        heapq.heappush(h, v*p)
    print(list(islice(A051037gen(), 65))) # Michael S. Branicky, Sep 17 2024

Formula

Let s(n) = Card(k | a(k)Benoit Cloitre, Dec 30 2001
The characteristic function of this sequence is given by:
Sum_{n>=1} x^a(n) = Sum_{n>=1} -Möbius(30*n)*x^n/(1-x^n). - Paul D. Hanna, Sep 18 2011
a(n) = A143207(n) / 30. - Reinhard Zumkeller, Sep 13 2011
A204455(15*a(n)) = 15, and only for these numbers. - Wolfdieter Lang, Feb 04 2012
A006530(a(n)) <= 5. - Reinhard Zumkeller, May 16 2015
Sum_{n>=1} 1/a(n) = Product_{primes p <= 5} p/(p-1) = (2*3*5)/(1*2*4) = 15/4. - Amiram Eldar, Sep 22 2020

A192476 Monotonic ordering of set S generated by these rules: if x and y are in S then x^2 + y^2 is in S, and 1 is in S.

Original entry on oeis.org

1, 2, 5, 8, 26, 29, 50, 65, 68, 89, 128, 677, 680, 701, 740, 842, 845, 866, 905, 1352, 1517, 1682, 2501, 2504, 2525, 2564, 3176, 3341, 4226, 4229, 4250, 4289, 4625, 4628, 4649, 4688, 4901, 5000, 5066, 5300, 5465, 6725, 7124, 7922, 7925, 7946, 7985
Offset: 1

Views

Author

Clark Kimberling, Jul 01 2011

Keywords

Comments

Let N denote the positive integers, and suppose that f(x,y): N x N->N. Let "start" denote a subset of N, and let S be the set of numbers defined by these rules: if x and y are in S, then f(x,y) is in S, and "start" is a subset of S. The monotonic increasing ordering of S is a sequence:
A192476: f(x,y)=x^2+y^2, start={1}
A003586: f(x,y)=x*y, start={1,2,3}
A051037: f(x,y)=x*y, start={1,2,3,5}
A002473: f(x,y)=x*y, start={1,2,3,5,7}
A003592: f(x,y)=x*y, start={2,5}
A009293: f(x,y)=x*y+1, start={2}
A009388: f(x,y)=x*y-1, start={2}
A009299: f(x,y)=x*y+2, start={3}
A192518: f(x,y)=(x+1)(y+1), start={2}
A192519: f(x,y)=floor(x*y/2), start={3}
A192520: f(x,y)=floor(x*y/2), start={5}
A192521: f(x,y)=floor((x+1)(y+1)/2), start={2}
A192522: f(x,y)=floor((x-1)(y-1)/2), start={5}
A192523: f(x,y)=2x*y-x-y, start={2}
A192525: f(x,y)=2x*y-x-y, start={3}
A192524: f(x,y)=4x*y-x-y, start={1}
A192528: f(x,y)=5x*y-x-y, start={1}
A192529: f(x,y)=3x*y-x-y, start={2}
A192531: f(x,y)=3x*y-2x-2y, start={2}
A192533: f(x,y)=x^2+y^2-x*y, start={2}
A192535: f(x,y)=x^2+y^2+x*y, start={1}
A192536: f(x,y)=x^2+y^2-floor(x*y/2), start={1}
A192537: f(x,y)=x^2+y^2-x*y/2, start={2}
A192539: f(x,y)=2x*y+floor(x*y/2), start={1}

Examples

			1^2+1^2=2, 1^2+2^2=5, 2^2+2^2=8, 1^2+5^2=26.
		

Crossrefs

Programs

  • Haskell
    import Data.Set (singleton, deleteFindMin, insert)
    a192476 n = a192476_list !! (n-1)
    a192476_list = f [1] (singleton 1) where
       f xs s =
         m : f xs' (foldl (flip insert) s' (map (+ m^2) (map (^ 2) xs')))
         where xs' = m : xs
               (m,s') = deleteFindMin s
    -- Reinhard Zumkeller, Aug 15 2011
  • Mathematica
    start = {1}; f[x_, y_] :=  x^2 + y^2  (* start is a subset of t, and if x,y are in t then f(x,y) is in t. *)
    b[z_] :=  Block[{w = z}, Select[Union[Flatten[AppendTo[w, Table[f[w[[i]], w[[j]]], {i, 1, Length[w]}, {j, 1, i}]]]], # < 30000 &]];
    t = FixedPoint[b, start] (* A192476 *)
    Differences[t]
    (* based on program by Robert G. Wilson v at A009293 *)

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
Showing 1-10 of 107 results. Next