%I #88 Aug 04 2024 05:35:23
%S 1,3,5,7,9,11,13,15,17,19,31,33,35,37,39,51,53,55,57,59,71,73,75,77,
%T 79,91,93,95,97,99,111,113,115,117,119,131,133,135,137,139,151,153,
%U 155,157,159,171,173,175,177,179,191,193,195,197,199,311,313,315,317,319
%N Numbers that contain odd digits only.
%C Or, numbers whose product of digits is odd.
%C Complement of A007928; A196563(a(n)) = 0. - _Reinhard Zumkeller_, Oct 04 2011
%C 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
%H Reinhard Zumkeller, <a href="/A014261/b014261.txt">Table of n, a(n) for n = 1..10000</a>
%H <a href="/index/Ar#10-automatic">Index entries for 10-automatic sequences</a>.
%F A121759(a(n)) = a(n); A000035(A007959(a(n))) = 1. - _Reinhard Zumkeller_, Nov 30 2007
%F From _Reinhard Zumkeller_, Aug 30 2009: (Start)
%F a(n+1) - a(n) = A164898(n). - _Reinhard Zumkeller_, Aug 30 2009
%F 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)));
%F a(n) = f(n, 1) where f(n, x) = if n = 1 then x else f(n-1, h(x)). (End)
%F From _Hieronymus Fischer_, Jun 06 2012: (Start)
%F 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)).
%F a(1*(5^n-1)/4) = 1*(10^n-1)/9.
%F a(2*(5^n-1)/4) = 1*(10^n-1)/3.
%F a(3*(5^n-1)/4) = 5*(10^n-1)/9.
%F a(4*(5^n-1)/4) = 7*(10^n-1)/9.
%F a(5*(5^n-1)/4) = 10^n - 1.
%F a((5^n-1)/4 + 5^(n-1)-1) = (10^n-5)/5.
%F a(n) = (10^log_5(4*n+1)-1)/9 for n = (5^k-1)/4, k > 0.
%F a(n) < (10^log_5(4*n+1)-1)/9 for (5^k-1)/4 < n < (5^(k+1)-1)/4, k > 0.
%F 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.
%F a(n) > 0.776*10^log_5(4*n+1)-1)/9 for n > 0.
%F a(n) >= A001742(n), equality holds for n = (5^k-1)/4, k > 0.
%F a(n) = A084545(n) if and only if all digits of A084545(n) are 1, else a(n) > A084545(n).
%F 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.
%F 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)
%F a(n) = A225985(A226091(n)). - _Reinhard Zumkeller_, May 26 2013
%F Sum_{n>=1} 1/a(n) = A194181. - _Bernard Schott_, Jan 13 2022
%e a(10^3) = 13779.
%e a(10^4) = 397779.
%e a(10^5) = 11177779.
%e a(10^6) = 335777779.
%t Select[Range[400], OddQ[Times@@IntegerDigits[#]] &] (* _Alonso del Arte_, Feb 21 2014 *)
%o (Magma) [ n : n in [1..129] | IsOdd(&*Intseq(n,10)) ];
%o (Haskell)
%o a014261 n = a014261_list !! (n-1)
%o a014261_list = filter (all (`elem` "13579") . show) [1,3..]
%o -- _Reinhard Zumkeller_, Jul 05 2011
%o (PARI) is(n)=Set(digits(n)%2)==[1] \\ _Charles R Greathouse IV_, Jul 06 2017
%o (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
%o (Python)
%o from itertools import islice, count
%o def A014261(): return filter(lambda n: set(str(n)) <= {'1','3','5','7','9'}, count(1,2))
%o A014261_list = list(islice(A014261(),20)) # _Chai Wah Wu_, Nov 22 2021
%o (Python)
%o from itertools import count, islice, product
%o def agen(): yield from (int("".join(p)) for d in count(1) for p in product("13579", repeat=d))
%o print(list(islice(agen(), 60))) # _Michael S. Branicky_, Jan 13 2022
%Y Similar to but different from A066640.
%Y Subsequence of A059708. Cf. A005408, A010879, A014263, A046034, A084545, A089581, A084984, A001743, A001744, A202267, A202268, A196564.
%Y Cf. A192107, A194181.
%Y Cf. A030096 (primes).
%Y Subsequence of A225985.
%K nonn,base,easy,look
%O 1,2
%A _N. J. A. Sloane_
%E More terms from _Robert G. Wilson v_, Oct 18 2002
%E Examples and crossrefs added by _Hieronymus Fischer_, Jun 06 2012