OFFSET
1,1
COMMENTS
If p is a prime with d digits that divides 10^(d+1)+1, then 4*p is in the sequence.
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..802 (terms 1..329 from Robert Israel, terms 330..500 from Michael S. Branicky)
EXAMPLE
52 is in the sequence because 52 = 2*2*13 and 2132 is divisible by 52.
105 is in the sequence because 105 = 3*5*7 and 735 is divisible by 105.
MAPLE
filter:= proc(n) local L, P, t;
if isprime(n) then return false fi;
L:= map(t -> t[1]$t[2], ifactors(n)[2]);
ormap(t -> (op(sscanf(cat(op(t)), "%d"))/n)::integer, combinat:-permute(L))
end proc:
select(filter, [$4..50000]);
MATHEMATICA
divQ@n_:=AnyTrue[(FromDigits@Flatten@IntegerDigits@#)&/@ (Permutations@Flatten@(ConstantArray @@#&/@ FactorInteger@n)), Divisible[#, n] &];
Cases[Range@50000, _?(CompositeQ@#&&divQ@# &)] (* Hans Rudolf Widmer, Jan 15 2024 *)
PROG
(Python)
from sympy import factorint, isprime
from sympy.utilities.iterables import multiset_permutations as MP
def ok(n):
if n < 4 or isprime(n): return False
mpf = []; [mpf.extend([str(p)]*e) for p, e in factorint(n).items()]
return any(int("".join(p))%n == 0 for p in MP(mpf))
print([k for k in range(32000) if ok(k)]) # Michael S. Branicky, Jan 19 2024
CROSSREFS
KEYWORD
nonn,base
AUTHOR
J. M. Bergot and Robert Israel, Dec 28 2018
STATUS
approved