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.

A297645 Hexagonal numbers (A000384) in which parity of digits alternates.

Original entry on oeis.org

1, 6, 45, 276, 325, 496, 561, 630, 703, 2145, 2701, 6903, 8385, 10585, 14365, 18721, 25878, 38503, 47278, 74305, 89676, 90525, 107416, 109278, 147696, 149878, 210925, 254541, 303810, 345696, 349030, 383250, 454581, 527878, 561270, 674541, 705078, 709836
Offset: 1

Views

Author

Colin Barker, Jan 02 2018

Keywords

Comments

Intersection of A000384 and A030141. - Felix Fröhlich, Jan 03 2018

Examples

			6903 is in the sequence because 6, 9, 0 and 3 have even and odd parity alternately.
		

Crossrefs

Programs

  • Maple
    filter:= proc(n) local L;
      if n < 10 then return true fi;
      L:= convert(n, base, 10) mod 2;
      not has(L[2..-1]-L[1..-2], 0)
    end proc:
    select(filter, [seq(n*(2*n-1),n=1..10^4)]); # Robert Israel, Jan 05 2018
  • 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, (4*n^2-2*n)/2))