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”).

Odd numbers in which parity of digits alternates.
8

%I #20 Feb 14 2017 23:07:44

%S 1,3,5,7,9,21,23,25,27,29,41,43,45,47,49,61,63,65,67,69,81,83,85,87,

%T 89,101,103,105,107,109,121,123,125,127,129,141,143,145,147,149,161,

%U 163,165,167,169,181,183,185,187,189,301,303,305,307,309,321,323

%N Odd numbers in which parity of digits alternates.

%C a(n) = A179085(n) for n <= 25. - _Reinhard Zumkeller_, Jun 28 2010

%H Reinhard Zumkeller, <a href="/A030142/b030142.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 (a(n) mod 2) * A228710(a(n)) = 1. - _Reinhard Zumkeller_, Aug 31 2013

%t id[n_]:=IntegerDigits[n];t={}; Do[If[Length[id[n]]==1, AppendTo[t,n], If[Union[Abs[Differences[Boole /@ EvenQ[id[n]]]]] == {1}, AppendTo[t,n]]], {n,1,323,2}]; t (* _Jayanta Basu_, May 07 2013 *)

%t Join[{1, 3, 5, 7, 9}, Select[Range[21, 323, 2], Total[Abs[Differences[Mod[(id = IntegerDigits[#]), 2]]]] == Length[id] - 1 &]] (* _Zak Seidov_, May 07 2013 *)

%o (Haskell)

%o a030142 n = a030142_list !! (n-1)

%o a030142_list = filter odd a030141_list

%o -- _Reinhard Zumkeller_, Aug 31 2013

%Y Cf. A030143, A062285, intersection of A005408 and A030141.

%K nonn,base,easy

%O 1,2

%A _Patrick De Geest_

%E Offset corrected by _Reinhard Zumkeller_, Jun 28 2010