OFFSET
1,2
COMMENTS
LINKS
Robert Israel, Table of n, a(n) for n = 1..2000
EXAMPLE
3876 is in the sequence because 3, 8, 7 and 6 have odd and even parity alternately.
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*(3*n-1)/2, n=1..1000)]); # Robert Israel, Jan 03 2018
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, (3*n^2-n)/2))
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Colin Barker, Jan 02 2018
STATUS
approved