A061808 a(n) is the smallest number with all digits odd that is divisible by 2n-1.
1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 315, 115, 75, 135, 319, 31, 33, 35, 37, 39, 533, 559, 135, 517, 539, 51, 53, 55, 57, 59, 793, 315, 195, 335, 759, 71, 73, 75, 77, 79, 1377, 913, 595, 957, 979, 91, 93, 95, 97, 99, 1111, 515, 315, 535, 1199, 111, 113, 115, 117, 119, 1331, 1353, 375, 1397, 1935
Offset: 1
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
- Mathematical Excalibur, Problem 300, Vol. 1 No. 3 (2008), p. 3.
Programs
-
Magma
a:=[]; for n in [1..120 by 2] do k:=1; while not Set(Intseq(n*k)) subset {1,3,5,7,9} do k:=k+2; end while; Append(~a,k*n); end for; a; // Marius A. Burtea, Sep 20 2019
-
Maple
Ad[1]:= [1,3,5,7,9]: for n from 2 to 9 do Ad[n]:= map(t -> seq(10*t+j,j=[1,3,5,7,9]), Ad[n-1]) od: Aod:= [seq(op(Ad[i]),i=1..9)]: f:= proc(n) local k; for k from 1 to nops(Aod) do if Aod[k] mod (2*n-1) = 0 then return(Aod[k]) fi od; NotFound end proc: map(f, [$1..100]); # Robert Israel, Feb 15 2017
-
Mathematica
Table[Block[{k = 2 n - 1}, While[Nand[AllTrue[IntegerDigits@ k, OddQ], Divisible[k, 2 n - 1]], k += 2]; k], {n, 59}] (* Michael De Vlieger, Dec 02 2017 *)
-
PARI
isoddd(n) = #select(x->((x%2) == 0), digits(n)) == 0; a(n) = {my(m = 2*n-1, k = 1); while(!isoddd(k*m), k++); k*m;} \\ Michel Marcus, Sep 20 2019
-
PARI
apply( {A061808(n)=forstep(k=n*2-1,oo,n*4-2,vecmin(digits(k)%2)&& return(k))}, [1..99])
-
Python
A061808 = lambda n: next(m for m in range(2*n-1,9<<99,4*n-2) if all(int(d)&1 for d in str(m))) # M. F. Hasler, Mar 05 2025
Formula
From M. F. Hasler, Mar 05 2025: (Start)
a(n) = (2n-1)*A296009(n).
a(n) == 1 (mod 2) for all n. (End)
Extensions
Corrected and extended by Larry Reeves (larryr(AT)acm.org), May 30 2001
Comments