login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A014261
Numbers that contain odd digits only.
66
1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 31, 33, 35, 37, 39, 51, 53, 55, 57, 59, 71, 73, 75, 77, 79, 91, 93, 95, 97, 99, 111, 113, 115, 117, 119, 131, 133, 135, 137, 139, 151, 153, 155, 157, 159, 171, 173, 175, 177, 179, 191, 193, 195, 197, 199, 311, 313, 315, 317, 319
OFFSET
1,2
COMMENTS
Or, numbers whose product of digits is odd.
Complement of A007928; A196563(a(n)) = 0. - Reinhard Zumkeller, Oct 04 2011
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
FORMULA
A121759(a(n)) = a(n); A000035(A007959(a(n))) = 1. - Reinhard Zumkeller, Nov 30 2007
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.
a(n) = A084545(n) if and only if all digits of A084545(n) are 1, else a(n) > A084545(n).
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)
a(n) = A225985(A226091(n)). - Reinhard Zumkeller, May 26 2013
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))
A014261_list = list(islice(A014261(), 20)) # Chai Wah Wu, Nov 22 2021
(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
Subsequence of A059708 and of A225985. A066640 and A030096 are subsequences.
Sequence in context: A374909 A143451 A352547 * A066640 A137507 A061808
KEYWORD
nonn,base,easy,look
EXTENSIONS
More terms from Robert G. Wilson v, Oct 18 2002
Examples and crossrefs added by Hieronymus Fischer, Jun 06 2012
STATUS
approved