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!)
A286846 Zeroless pandigital (9-digit) numbers where the first three digits minus the middle three digits equals the last three digits. 4
459173286, 459176283, 459183276, 459186273, 459273186, 459276183, 459283176, 459286173, 468173295, 468175293, 468193275, 468195273, 468273195, 468275193, 468293175, 468295173, 486127359, 486129357, 486157329, 486159327, 486327159, 486329157, 486357129 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
David A. Corneth, PARI program
EXAMPLE
459173286: 459 - 173 = 286.
MATHEMATICA
FromDigits/@Select[Permutations[Range[9]], FromDigits[Take[#, 3]]-FromDigits[ Take[ #, {4, 6}]]==FromDigits[Take[#, -3]]&] (* Harvey P. Dale, Aug 08 2020 *)
PROG
(Java) import java.util.*; public class GenerateSequence {public static void main(String[] args) { Set<Integer> seq = new TreeSet<Integer>(); for (long i = 123456789l; i < 987654321; 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(i); } } } System.out.println(seq); } }
(Python)
from itertools import permutations
def t2i(t): return int("".join(map(str, t)))
alst = [t2i(p) for p in permutations(range(1, 10)) if t2i(p[:3]) - t2i(p[3:6]) == t2i(p[6:])]
print(alst) # Michael S. Branicky, May 30 2022
CROSSREFS
A subsequence of A290725.
Sequence in context: A038830 A038819 A351430 * A349747 A323653 A246548
KEYWORD
nonn,base,fini,full
AUTHOR
Jonathan Schwartz, Aug 01 2017
STATUS
approved

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 18 20:26 EDT 2024. Contains 371781 sequences. (Running on oeis4.)