cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A030142 Odd numbers in which parity of digits alternates.

Original entry on oeis.org

1, 3, 5, 7, 9, 21, 23, 25, 27, 29, 41, 43, 45, 47, 49, 61, 63, 65, 67, 69, 81, 83, 85, 87, 89, 101, 103, 105, 107, 109, 121, 123, 125, 127, 129, 141, 143, 145, 147, 149, 161, 163, 165, 167, 169, 181, 183, 185, 187, 189, 301, 303, 305, 307, 309, 321, 323
Offset: 1

Views

Author

Keywords

Comments

a(n) = A179085(n) for n <= 25. - Reinhard Zumkeller, Jun 28 2010

Crossrefs

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

Programs

  • Haskell
    a030142 n = a030142_list !! (n-1)
    a030142_list = filter odd a030141_list
    -- Reinhard Zumkeller, Aug 31 2013
  • Mathematica
    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 *)
    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 *)

Formula

(a(n) mod 2) * A228710(a(n)) = 1. - Reinhard Zumkeller, Aug 31 2013

Extensions

Offset corrected by Reinhard Zumkeller, Jun 28 2010