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!)
A297645 Hexagonal numbers (A000384) in which parity of digits alternates. 4

%I #9 Jan 06 2018 22:27:44

%S 1,6,45,276,325,496,561,630,703,2145,2701,6903,8385,10585,14365,18721,

%T 25878,38503,47278,74305,89676,90525,107416,109278,147696,149878,

%U 210925,254541,303810,345696,349030,383250,454581,527878,561270,674541,705078,709836

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

%C Intersection of A000384 and A030141. - _Felix Fröhlich_, Jan 03 2018

%H Robert Israel, <a href="/A297645/b297645.txt">Table of n, a(n) for n = 1..1000</a>

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

%p filter:= proc(n) local L;

%p if n < 10 then return true fi;

%p L:= convert(n, base, 10) mod 2;

%p not has(L[2..-1]-L[1..-2], 0)

%p end proc:

%p select(filter, [seq(n*(2*n-1),n=1..10^4)]); # _Robert Israel_, Jan 05 2018

%o (PARI)

%o 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 select(is_alt, vector(1000, n, (4*n^2-2*n)/2))

%Y Cf. A297644, A297646, A297647.

%Y Cf. A000384, A030141, A030152, A030160, A068882.

%K nonn,base

%O 1,2

%A _Colin Barker_, Jan 02 2018

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 24 00:30 EDT 2024. Contains 371917 sequences. (Running on oeis4.)