# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a297646 Showing 1-1 of 1 %I A297646 #10 Jul 14 2022 14:59:43 %S A297646 1,7,18,34,81,189,616,783,874,3010,4141,4347,5452,6943,8323,12145, %T A297646 14707,18361,52345,69472,74563,78943,96727,129618,147258,163456, %U A297646 214183,232105,250747,258727,270109,276723,278389,307476,309232,381616,389470,436183,450925 %N A297646 Heptagonal numbers (A000566) in which parity of digits alternates. %C A297646 Intersection of A000566 and A030141. - _Felix Fröhlich_, Jan 03 2018 %H A297646 Harvey P. Dale, Table of n, a(n) for n = 1..500 %e A297646 6943 is in the sequence because 6, 9, 4 and 3 have even and odd parity alternately. %t A297646 Join[{1,7},Select[PolygonalNumber[7,Range[1000]],Union[Abs[Differences[ Boole[ OddQ[ IntegerDigits[ #]]]]]] =={1}&]] (* _Harvey P. Dale_, Jul 14 2022 *) %o A297646 (PARI) %o A297646 is_alt(n) = m=n; e=n%10; n\=10; while(n>0, f=n%10; if(e%2==f%2, return, e=f; n\=10)); return(m) %o A297646 select(is_alt, vector(1000, n, (5*n^2-3*n)/2)) %Y A297646 Cf. A297644, A297645, A297647. %Y A297646 Cf. A000566, A030141, A030152, A030160, A068882. %K A297646 nonn,base %O A297646 1,2 %A A297646 _Colin Barker_, Jan 02 2018 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE