login

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”).

A286845
Every 3-digit number 'a' such that there exist two other 3-digit numbers, 'b' and 'c', such that a - b = c, and a,b,c collectively use every digit 1-9 exactly once.
1
459, 468, 486, 495, 549, 567, 576, 594, 639, 648, 657, 675, 693, 729, 738, 783, 792, 819, 837, 846, 864, 873, 891, 918, 927, 936, 945, 954, 963, 972, 981
OFFSET
1,1
COMMENTS
For example, 459 - 173 = 286 and 459173286 is a zeroless pandigital number.
MATHEMATICA
With[{s = Select[Range[#/9, #] &[10^3 - 1], DigitCount[#, 10, 0] == 0 &]}, Select[s, Function[n, AnyTrue[s, Function[k, And[n - k > 0, FreeQ[#, i_ /; i == 0], Length@ # == 9] &@ Union@ Apply[Join, IntegerDigits@ {n, k, n - k}]]]]]] (* Michael De Vlieger, Aug 01 2017 *)
PROG
(Java) import java.util.*; public class GenerateSequence {public static void main(String[] args) { Set<Integer> seq = new TreeSet<Integer>();
for (long i = 987654321l; i > 123456789; i--) {Set<Character> set = new HashSet<Character>(); String number = Long.toString(i);
if (!(number.contains("0"))) {for (int n = 0; n < 9; n++){set.add(number.charAt(n)); }
if (set.size() == 9) {
if (Integer.valueOf(number.substring(0, 3)) - Integer.valueOf(number.substring(3, 6)) == Integer.valueOf(number.substring(6, 9))) { seq.add(Integer.valueOf(number.substring(0, 3))); } } } System.out.println(seq); } }
CROSSREFS
Sequence in context: A251474 A251468 A098765 * A062043 A331468 A124620
KEYWORD
nonn,base,fini,full
AUTHOR
Jonathan Schwartz, Aug 01 2017
STATUS
approved