Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #25 Nov 07 2021 18:35:33
%S 1001,1010,1100,1122,1133,1144,1155,1166,1177,1188,1199,1212,1221,
%T 1313,1331,1414,1441,1515,1551,1616,1661,1717,1771,1818,1881,1919,
%U 1991,2002,2020,2112,2121,2200,2211,2233,2244,2255,2266,2277,2288,2299,2323,2332,2424,2442
%N Numbers that contain exactly 2 pairs of identical digits.
%C Since other digits may be present, the last term is 998876543210; otherwise the last term would be 9988.
%C No multiples above 2 of identical digits are allowed, e.g., 1122333 is not a member of the sequence. - _Harvey P. Dale_, Nov 07 2021
%H Harvey P. Dale, <a href="/A291269/b291269.txt">Table of n, a(n) for n = 1..4000</a>
%t Select[Range[10^3, 10^4 - 1], Union@ Map[Length, #] == {2} &@ Split@ Sort@ IntegerDigits@ # &] (* _Michael De Vlieger_, Aug 24 2017 *)
%t (* program above only works for numbers of 4 digits, or *)
%t ok[n_] := Block[{d = DigitCount[n]}, Count[d, 2] == 2 && {} == Select[d, # > 2 &]]; Select[Range[11000], ok] (* _Giovanni Resta_, Aug 25 2017 *)
%t tpidQ[n_]:=Module[{dc=DigitCount[n]},Max[dc]==2&&Count[dc,2]==2]; Select[ Range[2500],tpidQ] (* _Harvey P. Dale_, Nov 07 2021 *)
%K nonn,base,fini
%O 1,1
%A _Enrique Navarrete_, Aug 21 2017