OFFSET
1,1
COMMENTS
Theorem: (See PDF "PROOFS" in Links)
Of Agathokakological Numbers k,
No k have a leading 9.
No k end in 2 or 5.
10 is the only k to end in 0. It is also the only k with 5 as a prime factor.
Can only be square terms when k is of the order 10^m where m is odd.
For k written as a*10^m, k can only be even when 1<=a<1.888...
Empirical observation: When graphed with the log of the n-th term on x axis and the log of the n-th term's value on the y axis a pattern appears with a similar shape for each new power of ten (see figure "LogLogGraph" in Links)
Special cases 28651 = 7*4093 and 65821 = 7*9043 use all digits 0-9 once.
"Agathokakological" is a Greek word meaning "composed of both good and evil." (Merriam-Webster) The composition (prime factorization) of Agathokakological Numbers is both good (same length) and evil (no common digits).
LINKS
Samuel Harkness, Table of n, a(n) for n = 1..6388
Samuel Harkness, MATLAB
Samuel Harkness, LogLogGraph
Samuel Harkness, PROOFS
EXAMPLE
158 = 2 * 79 since {2,7,9} do not appear in {1,5,8} and both have 3 digits.
MATHEMATICA
q[n_] := Module[{d = IntegerDigits[n], f = FactorInteger[n]}, Length[d] == Plus @@ ((Last[#]*IntegerLength[First[#]]) & /@ f ) && Intersection[d, Join @@ IntegerDigits[f[[;; , 1]]]] == {}]; Select[Range[1600], q] (* Amiram Eldar, Oct 12 2021 *)
PROG
(PARI) digsf(n) = my(f=factor(n), list=List()); for (k=1, #f~, my(dk=digits(f[k, 1])); for (i=1, f[k, 2], for (j=1, #dk, listput(list, dk[j])))); Vec(list);
isokd(m) = my(df=digsf(m), d=digits(m)); (#df == #d) && (#setintersect(Set(df), Set(d)) == 0); \\ Michel Marcus, Oct 11 2021
(Python)
from sympy import factorint
def ok(n):
s, f = str(n), factorint(n)
pfd = set("".join(str(p) for p in f))
if set(s) & pfd != set(): return False
return len(s) == sum(len(str(p))*f[p] for p in f)
print(list(filter(ok, range(1601)))) # Michael S. Branicky, Oct 11 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Samuel Harkness, Oct 11 2021
STATUS
approved