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.

A003592 Numbers of the form 2^i*5^j with i, j >= 0.

Original entry on oeis.org

1, 2, 4, 5, 8, 10, 16, 20, 25, 32, 40, 50, 64, 80, 100, 125, 128, 160, 200, 250, 256, 320, 400, 500, 512, 625, 640, 800, 1000, 1024, 1250, 1280, 1600, 2000, 2048, 2500, 2560, 3125, 3200, 4000, 4096, 5000, 5120, 6250, 6400, 8000, 8192, 10000, 10240, 12500, 12800
Offset: 1

Views

Author

Keywords

Comments

These are the natural numbers whose reciprocals are terminating decimals. - David Wasserman, Feb 26 2002
A132726(a(n), k) = 0 for k <= a(n); A051626(a(n)) = 0; A132740(a(n)) = 1; A132741(a(n)) = a(n). - Reinhard Zumkeller, Aug 27 2007
Where record values greater than 1 occur in A165706: A165707(n) = A165706(a(n)). - Reinhard Zumkeller, Sep 26 2009
Also numbers that are divisible by neither 10k - 7, 10k - 3, 10k - 1 nor 10k + 1, for all k > 0. - Robert G. Wilson v, Oct 26 2010
A204455(5*a(n)) = 5, and only for these numbers. - Wolfdieter Lang, Feb 04 2012
Since p = 2 and q = 5 are coprime, sum_{n >= 1} 1/a(n) = sum_{i >= 0} sum_{j >= 0} 1/p^i * 1/q^j = sum_{i >= 0} 1/p^i q/(q - 1) = p*q/((p-1)*(q-1)) = 2*5/(1*4) = 2.5. - Franklin T. Adams-Watters, Jul 07 2014
Conjecture: Each positive integer n not among 1, 4 and 12 can be written as a sum of finitely many numbers of the form 2^a*5^b + 1 (a,b >= 0) with no one dividing another. This has been verified for n <= 3700. - Zhi-Wei Sun, Apr 18 2023
1,2 and 4,5 are the only consecutive terms in the sequence. - Robin Jones, May 03 2025

References

  • Albert H. Beiler, Recreations in the theory of numbers, New York, Dover, (2nd ed.) 1966. See p. 73.

Crossrefs

Complement of A085837. Cf. A094958, A022333 (list of j), A022332 (list of i).
Cf. A164768 (difference between consecutive terms)

Programs

  • GAP
    Filtered([1..10000],n->PowerMod(10,n,n)=0); # Muniru A Asiru, Mar 19 2019
  • Haskell
    import Data.Set (singleton, deleteFindMin, insert)
    a003592 n = a003592_list !! (n-1)
    a003592_list = f $ singleton 1 where
       f s = y : f (insert (2 * y) $ insert (5 * y) s')
                   where (y, s') = deleteFindMin s
    -- Reinhard Zumkeller, May 16 2015
    
  • Magma
    [n: n in [1..10000] | PrimeDivisors(n) subset [2,5]]; // Bruno Berselli, Sep 24 2012
    
  • Maple
    isA003592 := proc(n)
          if n = 1 then
            true;
        else
            return (numtheory[factorset](n) minus {2,5} = {} );
        end if;
    end proc:
    A003592 := proc(n)
         option remember;
         if n = 1 then
            1;
        else
            for a from procname(n-1)+1 do
                if isA003592(a) then
                    return a;
                end if;
            end do:
        end if;
    end proc: # R. J. Mathar, Jul 16 2012
  • Mathematica
    twoFiveableQ[n_] := PowerMod[10, n, n] == 0; Select[Range@ 10000, twoFiveableQ] (* Robert G. Wilson v, Jan 12 2012 *)
    twoFiveableQ[n_] := Union[ MemberQ[{1, 3, 7, 9}, # ] & /@ Union@ Mod[ Rest@ Divisors@ n, 10]] == {False}; twoFiveableQ[1] = True; Select[Range@ 10000, twoFiveableQ] (* Robert G. Wilson v, Oct 26 2010 *)
    maxExpo = 14; Sort@ Flatten@ Table[2^i * 5^j, {i, 0, maxExpo}, {j, 0, Log[5, 2^(maxExpo - i)]}] (* Or *)
    Union@ Flatten@ NestList[{2#, 4#, 5#} &, 1, 7] (* Robert G. Wilson v, Apr 16 2011 *)
  • PARI
    list(lim)=my(v=List(),N);for(n=0,log(lim+.5)\log(5),N=5^n;while(N<=lim,listput(v,N);N<<=1));vecsort(Vec(v)) \\ Charles R Greathouse IV, Jun 28 2011
    
  • Python
    # A003592.py
    from heapq import heappush, heappop
    def A003592():
        pq = [1]
        seen = set(pq)
        while True:
            value = heappop(pq)
            yield value
            seen.remove(value)
            for x in 2*value, 5*value:
                if x not in seen:
                    heappush(pq, x)
                    seen.add(x)
    sequence = A003592()
    A003592_list = [next(sequence) for _ in range(100)]
    
  • Python
    from sympy import integer_log
    def A003592(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            kmin = kmax >> 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return n+x-sum((x//5**i).bit_length() for i in range(integer_log(x,5)[0]+1))
        return bisection(f,n,n) # Chai Wah Wu, Feb 24 2025
    
  • Sage
    def isA003592(n) :
        return not any(d != 2 and d != 5 for d in prime_divisors(n))
    @CachedFunction
    def A003592(n) :
        if n == 1 : return 1
        k = A003592(n-1) + 1
        while not isA003592(k) : k += 1
        return k
    [A003592(n) for n in (1..48)]  # Peter Luschny, Jul 20 2012
    

Formula

The characteristic function of this sequence is given by Sum_{n >= 1} x^a(n) = Sum_{n >= 1} mu(10*n)*x^n/(1 - x^n), where mu(n) is the Möbius function A008683. Cf. with the formula of Hanna in A051037. - Peter Bala, Mar 18 2019
a(n) ~ exp(sqrt(2*log(2)*log(5)*n)) / sqrt(10). - Vaclav Kotesovec, Sep 22 2020
a(n) = 2^A022332(n) * 5^A022333(n). - R. J. Mathar, Jul 06 2025

Extensions

Incomplete Python program removed by David Radcliffe, Jun 27 2016

A004139 Odd primes excluding 5.

Original entry on oeis.org

3, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241
Offset: 1

Views

Author

Keywords

Comments

Subsequence of A007401. - Reinhard Zumkeller, Jul 18 2011
Primes not dividing 10. Therefore primes p for which the decimal expansion of 1/p does not terminate (primes in A085837). - Jeppe Stig Nielsen, Dec 15 2019

References

  • John H. Conway, R. K. Guy, The Book of Numbers, Copernicus Press, p. 162.

Crossrefs

Subsequence of A065091, A007401, and A085837.

Programs

A121090 Period of unit fractions having periodic decimal expansions.

Original entry on oeis.org

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

Views

Author

Gil Broussard, Aug 11 2006

Keywords

Comments

See A007732, which is the main entry for this sequence.

Examples

			The first unit fraction considered is 1/3 because both 1/1 and 1/2 have finite decimal expansions.
a(1) = 1 because 1/3=.33333... whose repeating portion, 3, is of length 1.
Note: 1/4 and 1/5 are skipped because their decimal expansions are finite.
a(2) = 1 because 1/6=.166666... whose repeating portion, 6, is of length 1.
a(3) = 6 because 1/7 =.142857142857... whose repeating portion, 142857, is of length 6.
		

Crossrefs

Formula

a(n) = A007732(A085837(n)). - Kevin Ryde, May 05 2023

A178335 Integers for which the decimal expansion of the reciprocal contains the repeating digits 1,4,2,8,5,7 (corresponding to the decimal expansion of 1/7).

Original entry on oeis.org

7, 14, 28, 35, 56, 70, 112, 140, 175, 224, 280, 350, 448, 560, 700, 875, 896, 1120, 1400, 1750, 1792, 2240, 2800, 3500, 3584, 4375, 4480, 5600, 7000, 7168, 8750, 8960, 11200, 14000, 14336, 17500, 17920, 21875, 22400, 28000, 28672, 35000, 35840, 43750
Offset: 1

Views

Author

Joost de Winter, May 25 2010

Keywords

Comments

All terms are == 0 (mod 7).
If m appears, so does 10*m. Therefore the primitive terms (they will not end in 0) are: 7, 14, 28, 35, 56, 112, 175, 224, 448, 875, 896, 1792, 3584, 4375, 7168, 14336, 21875, 28672,... (see A158204).
From R. J. Mathar, Jul 13 2010: (Start)
a(n) = 7*A003592(n). [Proof: the a(n) are defined demanding that 1/a(n) = t/10^b+1/(7*10^c) for a transient integer t>=0 and a periodic part 1/(7*10^c) for some b>=0 and c>=0.
Note this splits the chain of decimal digits right in front of the period 142857, which means the least significant digits of t may be some of the least significant digits of 142857. We may assume that 1/(7*10^c) < 1/10^b, so c>=b.
Multiply by a(n)*7*10^c to get 7*10^c = a(n)*(7*t*10^(c-b)+1). Reduction modulo 7 shows that a(n)=7*k, so 10^c = k*(7*t*10^(c-b)+1).
Decomposition of both sides into prime factors shows that k must be of the form 2^i*5^j, which shows that the a(n) are of the form 7*A003592(.)
To demonstrate that none of the A003592 are missed it remains to show that the other factor, 7*t*10^(c-b)+1, can always be chosen of the form 2^(i')*5^(i'+i-j) to cancel the excess of the two exponents that the prime factorization of k may have: 10^c =2^c*5^c demands equal exponents.
Because t and 10^(c-b) can chosen freely, this is equivalent to showing that there is always a t, a c-b and an i' such that 7*t*10^(c-b)+1 = 10^i'*(excess power of 2 or 5).
On the right hand side, the (power of 2 or 5) mod 7 is a fixed number between 1 and 6.
As i' runs through 7 consecutive numbers, 10^i' mod 7 attains all numbers between 1 and 6; the product 10^i'*(power of 2 or 5) can always be tuned to == 1 (mod 7) by selection of i', and t*10^(c-b) follows by division. This shows that all k of the form 2^i*5^j contribute to the sequence.] (End)

Examples

			1/7 = 0.142857142857143..., 1/14 = 0.0714285714285714...
		

Crossrefs

Programs

  • Mathematica
    digitCycleLength[ r_Rational, b_Integer?Positive ] := MultiplicativeOrder[ b, FixedPoint[ Quotient[ #, GCD[ #, b ] ] &, Denominator[ r ] ] ] (* from Wolfram Library, Help Menu for MultiplicativeOrder *); fQ[ n_ ] := MemberQ[ {{1, 4, 2, 8, 5, 7}, {4, 2, 8, 5, 7, 1}, {2, 8, 5, 7, 1, 4}, {8, 5, 7, 1, 4, 2}, {5, 7, 1, 4, 2, 8}, {7, 1, 4, 2, 8, 5}}, RealDigits[ 1/n ][ [ 1, -1 ] ] ]; k = 0; lst = {}; While[ k < 10^9, If[ digitCycleLength[ 1/k, 10 ] == 6 && fQ[ k ], Print@k; AppendTo[ lst, k ] ]; k += 7 ]; lst

Extensions

Edited, corrected and extended by Robert G. Wilson v, May 31 2010

A158899 These are numbers n such that the reciprocal, 1/n, is a repeating fraction whose period is n/2 - 1.

Original entry on oeis.org

14, 34, 38, 46, 58, 94, 118, 122, 194, 218, 226, 262, 298, 334, 358, 362, 386, 446, 458, 466, 514, 526, 538, 626, 674, 734, 758, 766, 778, 838, 866, 922, 974, 982, 998, 1006, 1018, 1082, 1142, 1154, 1186, 1238, 1294, 1318, 1402, 1418, 1454, 1486, 1622, 1642
Offset: 1

Views

Author

Robert Hutchins, Mar 29 2009

Keywords

Comments

These numbers relate to the long period primes, those that for 1/m the period is m-1 (sequence A006883) in that by multiplying each term in the long period primes by 2, this sequence is generated.

Crossrefs

Programs

  • PARI
    forstep(n=2, 2e3, 2, if ((setminus(Set(factor(n)[,1]), Set([2,5])) != []) && (znorder(Mod(10, n/2^valuation(n, 2)/5^valuation(n, 5))) + 1 == n/2), print1(n, ", "));); \\ Michel Marcus, Feb 24 2013

Extensions

More terms and edited by Michel Marcus, Feb 24 2013

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 *)
Showing 1-6 of 6 results.