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.

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

This page as a plain text file.
%I A003592 #118 Jul 06 2025 10:27:42
%S A003592 1,2,4,5,8,10,16,20,25,32,40,50,64,80,100,125,128,160,200,250,256,320,
%T A003592 400,500,512,625,640,800,1000,1024,1250,1280,1600,2000,2048,2500,2560,
%U A003592 3125,3200,4000,4096,5000,5120,6250,6400,8000,8192,10000,10240,12500,12800
%N A003592 Numbers of the form 2^i*5^j with i, j >= 0.
%C A003592 These are the natural numbers whose reciprocals are terminating decimals. - _David Wasserman_, Feb 26 2002
%C A003592 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
%C A003592 Where record values greater than 1 occur in A165706: A165707(n) = A165706(a(n)). - _Reinhard Zumkeller_, Sep 26 2009
%C A003592 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
%C A003592 A204455(5*a(n)) = 5, and only for these numbers. - _Wolfdieter Lang_, Feb 04 2012
%C A003592 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
%C A003592 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
%C A003592 1,2 and 4,5 are the only consecutive terms in the sequence. - _Robin Jones_, May 03 2025
%D A003592 Albert H. Beiler, Recreations in the theory of numbers, New York, Dover, (2nd ed.) 1966. See p. 73.
%H A003592 Reinhard Zumkeller, <a href="/A003592/b003592.txt">Table of n, a(n) for n = 1..10000</a>
%H A003592 Vaclav Kotesovec, <a href="/A003592/a003592.jpg">Graph - the asymptotic ratio (200000 terms)</a>
%H A003592 Math Stack Exchange, <a href="https://math.stackexchange.com/q/3818796/602386">Are (1,2) and (4,5) the only two consecutive pairs in A003592, the integers of the form 2^i5^j?</a>
%H A003592 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/RegularNumber.html">Regular Number</a>
%H A003592 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/DecimalExpansion.html">Decimal Expansion</a>
%F A003592 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
%F A003592 a(n) ~ exp(sqrt(2*log(2)*log(5)*n)) / sqrt(10). - _Vaclav Kotesovec_, Sep 22 2020
%F A003592 a(n) = 2^A022332(n) * 5^A022333(n). - _R. J. Mathar_, Jul 06 2025
%p A003592 isA003592 := proc(n)
%p A003592       if n = 1 then
%p A003592         true;
%p A003592     else
%p A003592         return (numtheory[factorset](n) minus {2,5} = {} );
%p A003592     end if;
%p A003592 end proc:
%p A003592 A003592 := proc(n)
%p A003592      option remember;
%p A003592      if n = 1 then
%p A003592         1;
%p A003592     else
%p A003592         for a from procname(n-1)+1 do
%p A003592             if isA003592(a) then
%p A003592                 return a;
%p A003592             end if;
%p A003592         end do:
%p A003592     end if;
%p A003592 end proc: # _R. J. Mathar_, Jul 16 2012
%t A003592 twoFiveableQ[n_] := PowerMod[10, n, n] == 0; Select[Range@ 10000, twoFiveableQ] (* _Robert G. Wilson v_, Jan 12 2012 *)
%t A003592 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 *)
%t A003592 maxExpo = 14; Sort@ Flatten@ Table[2^i * 5^j, {i, 0, maxExpo}, {j, 0, Log[5, 2^(maxExpo - i)]}] (* Or *)
%t A003592 Union@ Flatten@ NestList[{2#, 4#, 5#} &, 1, 7] (* _Robert G. Wilson v_, Apr 16 2011 *)
%o A003592 (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
%o A003592 (Sage)
%o A003592 def isA003592(n) :
%o A003592     return not any(d != 2 and d != 5 for d in prime_divisors(n))
%o A003592 @CachedFunction
%o A003592 def A003592(n) :
%o A003592     if n == 1 : return 1
%o A003592     k = A003592(n-1) + 1
%o A003592     while not isA003592(k) : k += 1
%o A003592     return k
%o A003592 [A003592(n) for n in (1..48)]  # _Peter Luschny_, Jul 20 2012
%o A003592 (Magma) [n: n in [1..10000] | PrimeDivisors(n) subset [2,5]]; // _Bruno Berselli_, Sep 24 2012
%o A003592 (Haskell)
%o A003592 import Data.Set (singleton, deleteFindMin, insert)
%o A003592 a003592 n = a003592_list !! (n-1)
%o A003592 a003592_list = f $ singleton 1 where
%o A003592    f s = y : f (insert (2 * y) $ insert (5 * y) s')
%o A003592                where (y, s') = deleteFindMin s
%o A003592 -- _Reinhard Zumkeller_, May 16 2015
%o A003592 (Python)
%o A003592 # A003592.py
%o A003592 from heapq import heappush, heappop
%o A003592 def A003592():
%o A003592     pq = [1]
%o A003592     seen = set(pq)
%o A003592     while True:
%o A003592         value = heappop(pq)
%o A003592         yield value
%o A003592         seen.remove(value)
%o A003592         for x in 2*value, 5*value:
%o A003592             if x not in seen:
%o A003592                 heappush(pq, x)
%o A003592                 seen.add(x)
%o A003592 sequence = A003592()
%o A003592 A003592_list = [next(sequence) for _ in range(100)]
%o A003592 (Python)
%o A003592 from sympy import integer_log
%o A003592 def A003592(n):
%o A003592     def bisection(f,kmin=0,kmax=1):
%o A003592         while f(kmax) > kmax: kmax <<= 1
%o A003592         kmin = kmax >> 1
%o A003592         while kmax-kmin > 1:
%o A003592             kmid = kmax+kmin>>1
%o A003592             if f(kmid) <= kmid:
%o A003592                 kmax = kmid
%o A003592             else:
%o A003592                 kmin = kmid
%o A003592         return kmax
%o A003592     def f(x): return n+x-sum((x//5**i).bit_length() for i in range(integer_log(x,5)[0]+1))
%o A003592     return bisection(f,n,n) # _Chai Wah Wu_, Feb 24 2025
%o A003592 (GAP) Filtered([1..10000],n->PowerMod(10,n,n)=0); # _Muniru A Asiru_, Mar 19 2019
%Y A003592 Complement of A085837. Cf. A094958, A022333 (list of j), A022332 (list of i).
%Y A003592 Cf. A003586, A003591, A003593, A003594, A003595, A257997.
%Y A003592 Cf. A164768 (difference between consecutive terms)
%K A003592 nonn,easy
%O A003592 1,2
%A A003592 _N. J. A. Sloane_
%E A003592 Incomplete Python program removed by _David Radcliffe_, Jun 27 2016