login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A030147 Palindromes in which parity of digits alternates. 6
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 101, 121, 141, 161, 181, 212, 232, 252, 272, 292, 303, 323, 343, 363, 383, 414, 434, 454, 474, 494, 505, 525, 545, 565, 585, 616, 636, 656, 676, 696, 707, 727, 747, 767, 787, 818, 838, 858, 878, 898, 909, 929, 949 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
COMMENTS
All terms have an odd number of digits. - Alonso del Arte, Jan 31 2020
LINKS
FORMULA
A136522(a(n)) * A228710(a(n)) = 1. - Reinhard Zumkeller, Aug 31 2013
MATHEMATICA
palQ[n_, b_:10] := (IntegerDigits[n, b] == Reverse[IntegerDigits[n, b]]); alternParQ[n_, b_:10] := (Union[BlockMap[Xor @@ # &, OddQ[IntegerDigits[n, b]], 2, 1]] == {True}); Join[Range[0, 9], Select[Range[1000], palQ[#] && alternParQ[#] &]] (* Alonso del Arte, Feb 02 2020 *)
Join[Range[0, 9], Select[Range[100000], PalindromeQ[#]&&Union[Total/@Partition[Boole[ EvenQ[ IntegerDigits[ #]]], 2, 1]] =={1}&]] (* Harvey P. Dale, Jul 04 2023 *)
PROG
(Haskell)
a030147 n = a030147_list !! (n-1)
a030147_list = filter ((== 1) . a228710) a002113_list
-- Reinhard Zumkeller, Aug 31 2013
(Scala) def isPal(n: Int) = (n.toString == n.toString.reverse)
def alternsPar(n: Int): Boolean = {
val dPars = Integer.toString(n).toList.map(_ % 2 == 0)
val scanPars = (dPars zip dPars.tail).map{ case (x, y) => x ^ y }
scanPars.toSet == Set(true)
}
(0 to 9) ++: (10 to 999).filter(isPal).filter(alternsPar) // Alonso del Arte, Feb 02 2020
CROSSREFS
Intersection of A002113 and A030141.
Subsequence of A001633.
Sequence in context: A083851 A071275 A050783 * A207954 A193412 A266139
KEYWORD
nonn,base
AUTHOR
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 13 02:50 EDT 2024. Contains 374265 sequences. (Running on oeis4.)