login
Triangular numbers composed of digits {2,4,6}.
2

%I #27 Apr 06 2023 20:07:56

%S 6,66,666,426426,266262426,22464262666,46624464466426,

%T 644644226644644222426,46424226426466426446424262644446,

%U 626644642222466644646226466422666

%N Triangular numbers composed of digits {2,4,6}.

%C All terms end in 6. - _Robert Israel_, Feb 05 2016

%C a(11) > 10^40. - _Tyler Busby_, Mar 29 2023

%H Giovanni Resta, <a href="http://www.numbersaplenty.com/tr/tr246.html">Tridigital Triangular Numbers</a>.

%F a(n) = A000217(A119161(n)). - _Tyler Busby_, Mar 29 2023

%p F:= proc(d) # get all terms with d digits

%p local res, m, prefs,i,t,qmax,qmin,smax,smin,cand,s;

%p res:= NULL;

%p m:= max(1,floor(d/2-1));

%p prefs:= [2,4,6]*10^(d-1);

%p for i from 1 to m-1 do

%p prefs:= map(t -> (t + 2*10^(d-1-i),t+4*10^(d-1-i),t+6*10^(d-1-i)), prefs)

%p od;

%p for t in prefs do

%p qmax:= t + 6*(10^(d-m)-1)/9; smax:= floor(sqrt(8*qmax+1));

%p qmin:= t + 2*(10^(d-m)-1)/9; smin:= ceil(sqrt(8*qmin+1));

%p smin:= smin + 1 - (smin mod 2);

%p for s from smin to smax by 2 do

%p cand:= (s^2 -1)/8;

%p if cand mod 10 = 6 and convert(convert(cand,base,10),set) subset {2,4,6} then

%p res:= res, cand;

%p fi

%p od

%p od;

%p res;

%p end proc:

%p seq(F(d),d=1..21); # _Robert Israel_, Feb 05 2016

%t Select[#*(# + 1)/2 & /@

%t Range[1000000], !

%t MemberQ[IntegerDigits[#], 0 | 1 | 3 | 5 | 7 | 8 | 9] &] (*_Julien Kluge_, Feb 01 2016*)

%o (Magma) [t: n in [1..2*10^7] | Set(Intseq(t)) subset {2, 4, 6} where t is n*(n+1) div 2]; // _Vincenzo Librandi_, Feb 04 2016

%Y Cf. A000217, A053923, A119161. See A119033 for a table of cross-references.

%K nonn,base,more

%O 1,1

%A _Giovanni Resta_, May 10 2006

%E a(10) from _Max Alekseyev_, Jun 16 2011