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!)
A297646 Heptagonal numbers (A000566) in which parity of digits alternates. 4
1, 7, 18, 34, 81, 189, 616, 783, 874, 3010, 4141, 4347, 5452, 6943, 8323, 12145, 14707, 18361, 52345, 69472, 74563, 78943, 96727, 129618, 147258, 163456, 214183, 232105, 250747, 258727, 270109, 276723, 278389, 307476, 309232, 381616, 389470, 436183, 450925 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
Intersection of A000566 and A030141. - Felix Fröhlich, Jan 03 2018
LINKS
EXAMPLE
6943 is in the sequence because 6, 9, 4 and 3 have even and odd parity alternately.
MATHEMATICA
Join[{1, 7}, Select[PolygonalNumber[7, Range[1000]], Union[Abs[Differences[ Boole[ OddQ[ IntegerDigits[ #]]]]]] =={1}&]] (* Harvey P. Dale, Jul 14 2022 *)
PROG
(PARI)
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)
select(is_alt, vector(1000, n, (5*n^2-3*n)/2))
CROSSREFS
Sequence in context: A000566 A225248 A301709 * A320281 A169677 A263876
KEYWORD
nonn,base
AUTHOR
Colin Barker, Jan 02 2018
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 April 25 14:35 EDT 2024. Contains 371989 sequences. (Running on oeis4.)