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!)
A289552 Zeroless pandigital numbers (each digit 1-9 used exactly once) where the first 3 digits plus the next 3 digits equals the last 3 digits. 3

%I #33 Oct 18 2022 09:43:07

%S 124659783,125739864,127359486,127368495,128367495,128439567,

%T 129357486,129438567,129654783,129735864,134658792,135729864,

%U 138429567,138654792,139428567,139725864,142596738,142695837,143586729,145692837,146583729,146592738,152487639,152784936

%N Zeroless pandigital numbers (each digit 1-9 used exactly once) where the first 3 digits plus the next 3 digits equals the last 3 digits.

%H Jonathan Schwartz, <a href="/A289552/b289552.txt">Table of n, a(n) for n = 1..336</a>

%H David A. Corneth, <a href="/A289552/a289552.gp.txt">PARI program</a>

%H Eric Weisstein, World of Mathematics, <a href="http://mathworld.wolfram.com/PandigitalNumber.html">Pandigital Number</a>.

%e 124659783: 124 + 659 = 783.

%t FromDigits/@Select[Permutations[Range[9]],FromDigits[Take[#,3]]+FromDigits[ Take[ #,{4,6}]] == FromDigits[Take[#,-3]]&] (* _Harvey P. Dale_, Oct 18 2022 *)

%o (Java) import java.util.*;public class Sequence{public static void main(String[] args) {

%o for (long i = 123456789l; i < 987654321l; i++)

%o {Set<Character> set = new HashSet<Character>();String number = Long.toString(i);

%o if (!(number.contains("0"))) {

%o for (int n = 0; n < 9; n++) {set.add(number.charAt(n));}

%o if (set.size() == 9){

%o if(Integer.valueOf(number.substring(0,3))+Integer.valueOf(number.substring(3,6))==Integer.valueOf(number.substring(6,9)))

%o {System.out.print(i + ", ");}}}}}}

%o (Python)

%o from itertools import permutations

%o def t2i(t): return int("".join(map(str, t)))

%o alst = [t2i(p) for p in permutations(range(1, 10)) if t2i(p[:3]) + t2i(p[3:6]) == t2i(p[6:])]

%o print(alst) # _Michael S. Branicky_, May 30 2022

%Y Cf. A050289, A286846, A289544.

%K nonn,base,fini,full

%O 1,1

%A _Jonathan Schwartz_, Aug 02 2017

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 24 18:17 EDT 2024. Contains 371962 sequences. (Running on oeis4.)