OFFSET
1,2
COMMENTS
Or, numbers whose product of digits is odd.
If n is represented as a zerofree base-5 number (see A084545) according to n = d(m)d(m-1)...d(3)d(2)d(1)d(0) then a(n) = Sum_{j = 0..m} c(d(j))*10^j, where c(k) = 1, 3, 5, 7, 9 for k = 1..5. - Hieronymus Fischer, Jun 06 2012
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
FORMULA
From Reinhard Zumkeller, Aug 30 2009: (Start)
a(n+1) - a(n) = A164898(n). - Reinhard Zumkeller, Aug 30 2009
a(n+1) = h(a(n)) with h(x) = 1 + (if x mod 10 < 9 then x + x mod 2 else 10*h(floor(x/10)));
a(n) = f(n, 1) where f(n, x) = if n = 1 then x else f(n-1, h(x)). (End)
From Hieronymus Fischer, Jun 06 2012: (Start)
a(n) = Sum_{j = 0..m-1} ((2*b_j(n)+1) mod 10)*10^j, where b_j(n) = floor((4*n+1-5^m)/(4*5^j)), m = floor(log_5(4*n+1)).
a(1*(5^n-1)/4) = 1*(10^n-1)/9.
a(2*(5^n-1)/4) = 1*(10^n-1)/3.
a(3*(5^n-1)/4) = 5*(10^n-1)/9.
a(4*(5^n-1)/4) = 7*(10^n-1)/9.
a(5*(5^n-1)/4) = 10^n - 1.
a((5^n-1)/4 + 5^(n-1)-1) = (10^n-5)/5.
a(n) = (10^log_5(4*n+1)-1)/9 for n = (5^k-1)/4, k > 0.
a(n) < (10^log_5(4*n+1)-1)/9 for (5^k-1)/4 < n < (5^(k+1)-1)/4, k > 0.
a(n) <= 27/(9*2^log_5(9)-1)*(10^log_5(4*n+1)-1)/9 for n > 0, equality holds for n = 2.
a(n) > 0.776*10^log_5(4*n+1)-1)/9 for n > 0.
a(n) >= A001742(n), equality holds for n = (5^k-1)/4, k > 0.
G.f.: g(x)= (x^(1/4)*(1-x))^(-1) Sum_{j >= 0} 10^j*z(j)^(5/4)*(1-z(j))*(1 + 3*z(j) + 5*z(j)^2 + 7*z(j)^3 + 9*z(j)^4)/(1-z(j)^5), where z(j) = x^5^j.
Also: g(x) = (1/(1-x))*(h_(5,0)(x) + 2*h_(5,1)(x) + 2*h_(5,2)(x) + 2*h_(5,3)(x) + 2*h_(5,4)(x) - 9*h_(5,5)(x)), where h_(5,k)(x) = Sum_{j >= 0} 10^j*x^((5^(j+1)-1)/4)*(x^5^j)^k/(1-(x^5^j)^5). (End)
Sum_{n>=1} 1/a(n) = A194181. - Bernard Schott, Jan 13 2022
EXAMPLE
a(10^3) = 13779.
a(10^4) = 397779.
a(10^5) = 11177779.
a(10^6) = 335777779.
MATHEMATICA
Select[Range[400], OddQ[Times@@IntegerDigits[#]] &] (* Alonso del Arte, Feb 21 2014 *)
PROG
(Magma) [ n : n in [1..129] | IsOdd(&*Intseq(n, 10)) ];
(Haskell)
a014261 n = a014261_list !! (n-1)
a014261_list = filter (all (`elem` "13579") . show) [1, 3..]
-- Reinhard Zumkeller, Jul 05 2011
(PARI) is(n)=Set(digits(n)%2)==[1] \\ Charles R Greathouse IV, Jul 06 2017
(PARI) a(n)={my(k=1); while(n>5^k, n-=5^k; k++); fromdigits([2*d+1 | d<-digits(5^k+n-1, 5)]) - 3*10^k} \\ Andrew Howroyd, Jan 17 2020
(Python)
from itertools import islice, count
def A014261(): return filter(lambda n: set(str(n)) <= {'1', '3', '5', '7', '9'}, count(1, 2))
(Python)
from itertools import count, islice, product
def agen(): yield from (int("".join(p)) for d in count(1) for p in product("13579", repeat=d))
print(list(islice(agen(), 60))) # Michael S. Branicky, Jan 13 2022
CROSSREFS
KEYWORD
AUTHOR
EXTENSIONS
More terms from Robert G. Wilson v, Oct 18 2002
Examples and crossrefs added by Hieronymus Fischer, Jun 06 2012
STATUS
approved