A003592 Numbers of the form 2^i*5^j with i, j >= 0.
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
References
- Albert H. Beiler, Recreations in the theory of numbers, New York, Dover, (2nd ed.) 1966. See p. 73.
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
- Vaclav Kotesovec, Graph - the asymptotic ratio (200000 terms)
- Math Stack Exchange, Are (1,2) and (4,5) the only two consecutive pairs in A003592, the integers of the form 2^i5^j?
- Eric Weisstein's World of Mathematics, Regular Number
- Eric Weisstein's World of Mathematics, Decimal Expansion
Crossrefs
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
Extensions
Incomplete Python program removed by David Radcliffe, Jun 27 2016
Comments