OFFSET
1,2
COMMENTS
All terms are necessarily odd because 2 is not in A333369
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
Project Euler, Problem 520: Simbers.
EXAMPLE
111 is a term since all the divisors of 111, i.e., 1, 3, 37 and 111, are in A333369.
MATHEMATICA
simQ[n_] := AllTrue[Tally @ IntegerDigits[n], EvenQ[Plus @@ #] &]; Select[Range[1000], AllTrue[Divisors[#], simQ] &] (* Amiram Eldar, Jul 19 2022 *)
PROG
(PARI) issimber(m) = my(d=digits(m), s=Set(d)); for (i=1, #s, if (#select(x->(x==s[i]), d) % 2 != (s[i] % 2), return (0))); return (1); \\ A333369
isok(k) = fordiv(k, d, if (!issimber(d), return(0))); return(1); \\ Michel Marcus, Jul 19 2022
(Python)
from sympy import divisors, isprime
def c(n): s = str(n); return all(s.count(d)%2 == int(d)%2 for d in set(s))
def ok(n): return n > 0 and all(c(d) for d in divisors(n, generator=True))
print([k for k in range(740) if ok(k)]) # Michael S. Branicky, Jul 24 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Bernard Schott, Jul 18 2022
STATUS
approved