Pandigital Number

Author

Eric W. Weisstein
September 7, 2022

This notebook downloaded from http://mathworld.wolfram.com/notebooks/NumberTheory/PandigitalNumber.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/PandigitalNumber.html.

©2022 Wolfram Research, Inc. except for portions noted otherwise

Code

PandigitalQ[n_Integer?Positive]:=Union[IntegerDigits[n]]==Range[0,9]

PandigitalQ[n_Integer?Positive,Zeros->False]:=Union[IntegerDigits[n]]==Range[1,9]

Pandigital numbers

With 0's

A050278

p=Sort[FromDigits/@(Join[{1,0,2,3,4},#]&/@Permutations[Range[5,9]])]

Union[PandigitalQ/@p]

Zeroless

A050290

p=Sort[FromDigits/@(Join[{1,2,3,4},#]&/@Permutations[Range[5,9]])]

AllTrue[p,PandigitalQ[#,Zeros->False]&]

Pandigital primes

With 0's

A050288

10-digit pandigital numbers cannot be prime since

Sum[i,{i,0,9}]

This is the next smallest possibility

pp=Sort[Select[FromDigits/@(Join[{1,0,1},#]&/@Permutations[Range[2,9]]),PrimeQ]];

Union[PandigitalQ/@pp]

Zeroless

A050290

10-digit pandigital numbers cannot be prime since

Sum[i,{i,9}]

This is the next smallest possibility

pp=Sort[Select[FromDigits/@(Join[{1,1},#]&/@Permutations[Range[2,9]]),PrimeQ]]

AllTrue[pp,PandigitalQ[#,Zeros->False]&]

AllTrue[pp,PrimeQ]

Special pandigital numbers

Integer relation

A . Povolotsky, Aug. 27, 20

(9876543120*9876543210)/(1234567890*7901234568)

AllTrue[{9876543120,9876543210,1234567890,7901234568},PandigitalQ]

Sum of consecutive primes

A049442

(res=Flatten[Position[Accumulate[Prime[Range[40000]]],_?(Sort[IntegerDigits[#]]==Range[0,9]&)]])//Timing

Index is a palindromic number:

Select[res,(Reverse[r=IntegerDigits[#]]==r)&]

Pandigital Fibonacci

PandigitalFibonacciQ[n_]:=PandigitalQ[#,Zeros->False]&/@Or@@PandigitalFibonacciList[n]

PandigitalFibonacciList[n_]:=Select[First/@PandigitalFibonacciSequence[n],#>10^8&]

PandigitalFibonacciSequence[n_]:=NestWhileList[{Last[#],Plus@@Take[#,-2]}&,{1,n},Last[#]<10^9&]

PandigitalFibonacciQ/@{8955,24405,30013,59325,62025,71493,72123,76885,85461,92077,99165,106185,109717,112251,119077,148773,153007,155077,163771,163803,196797,211369,221137,223365,227119,228271,228631}

Select[Range[10^4],PandigitalFibonacciQ]

Union[Flatten[PandigitalFibonacciSequence[718]]]

ID Number:A034589
Sequence:8955,24405,30013,59325,62025,71493,72123,76885,85461,92077,99165,106185,109717,112251,119077,148773,153007,155077,163771,163803,196797,211369,221137,223365,227119,228271,228631
Name:Fibonacci iteration F(1,lucky number a(n)) leads to a'nine digits'
anagram.Links:Nine Digits Digressions
Lucky Numbers
Example:E.g.F(1,228631)->+228632->+457263->+685895->+1143158->+1829053->+2972211->+4801264->+7773475->+12574739->+20348214->+32922953->+53271167->+86194120 and finally we have->'139465287' which is our
nine-digits anagram.See also:Cf.A034306,A000959.Keywords:nonn,base,fini
Offset:0
Author(s):Patrick De Geest (Patrick.DeGeest@ping.be),October 1998.

?Lucky*