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.
%I A030478 #25 Oct 31 2024 01:42:39 %S A030478 0,1,2,3,4,8,10,11,12,13,15,17,19,20,22,24,26,31,33,34,35,39,40,42,46, %T A030478 52,54,58,59,71,72,80,82,91,92,93,95,100,104,110,120,124,131,135,137, %U A030478 150,152,169,172,173,174,175,179,200,202,211,220,240,258,259 %N A030478 Numbers k such that k^3 has property that all even digits occur together and all odd digits occur together. %C A030478 From _Robert Israel_, Oct 27 2024: (Start) %C A030478 If x is an even member, then so is 10 * x. %C A030478 2^k + 2 is a member for every k. %C A030478 (End) %H A030478 David A. Corneth, <a href="/A030478/b030478.txt">Table of n, a(n) for n = 1..4505</a> (first 2500 terms from Robert Israel, terms <= 10^10) %H A030478 David A. Corneth, <a href="/A030478/a030478.gp.txt">PARI program</a> %e A030478 From _David A. Corneth_, Oct 28 2024: (Start) %e A030478 12 is in the sequence as 12^3 = 1728 has all even digits occur together and all odd digits occur together. That we can place a bar somewhere between the digits of 1728 so that all odd digits are on one side of the bar and all even digits are on the other side of the bar. In this case that would be 17|28 where all odd digits are on the left of the bar and all even digits are on the other side of the bar. %e A030478 16 is not in the sequence. To split the even from odd digits in 16^3 = 4096 we would need more than 1 bar, like so: 40|9|6. %e A030478 321 is not in the sequence as for 321^3 = 33076161 we would need more than two bars to split even from odd. Like so: 33|0|7|6|1|6|1. As the last three digits must be split by more than one bar and 321 has at least three digits no term can end in the last three digits of 321 which means no term can end in 321. Using this idea we can ease the search significantly. (End) %p A030478 filter:= proc(n) local L,x,m; %p A030478 L:= convert(n^3,base,10) mod 2; %p A030478 if n::odd then %p A030478 if not member(0,L,m) then return true fi; %p A030478 convert(L[m..-1],set) = {0} %p A030478 else %p A030478 if not member(1,L,m) then return true fi; %p A030478 convert(L[m..-1],set) = {1} %p A030478 fi %p A030478 end proc: %p A030478 select(filter, [$0..1000]); %p A030478 # _Robert Israel_, Oct 27 2024 %t A030478 Select[Range[0,300],Length[Split[If[OddQ[#],1,0]&/@IntegerDigits[ #^3]]]<3&] (* _Harvey P. Dale_, Mar 27 2016 *) %o A030478 (Python) %o A030478 def ok(n): %o A030478 s = "".join("0" if d in "02468" else "1" for d in str(n**3)) %o A030478 return len(set(s.rstrip(s[-1]))) < 2 %o A030478 print([k for k in range(260) if ok(k)]) # _Michael S. Branicky_, Oct 28 2024 %o A030478 (PARI) \\ See Corneth link %Y A030478 Cf. A030477, A030479. %K A030478 nonn,base %O A030478 1,3 %A A030478 _Patrick De Geest_