cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A316227 Composite numbers k for which no nontrivial divisor shares any digits with k.

This page as a plain text file.
%I A316227 #20 Jul 23 2018 02:46:20
%S A316227 4,6,8,9,10,14,16,18,21,27,34,38,46,49,54,56,57,58,68,69,76,78,81,86,
%T A316227 87,106,111,116,118,129,134,146,158,161,166,177,188,201,219,247,249,
%U A316227 259,267,289,323,329,334,356,358,388,413,446,454,458,466,477,478,489
%N A316227 Composite numbers k for which no nontrivial divisor shares any digits with k.
%C A316227 A nontrivial divisor of k means a divisor greater than 1 and less than k.
%H A316227 Robert Israel, <a href="/A316227/b316227.txt">Table of n, a(n) for n = 1..10000</a>
%e A316227 The nontrivial divisors of 54 are 2, 3, 6, 9, 18, and 27, none of which have a digit 5 or 4.
%e A316227 The nontrivial divisors of 248629501 are 337 and 737773.
%e A316227 The nontrivial divisors of 321810649 are 557 and 577757.
%p A316227 filter:= proc(n) local S;
%p A316227   if isprime(n) then return false fi;
%p A316227   S:= convert(convert(n,base,10),set);
%p A316227   andmap(d -> convert(convert(d,base,10),set) intersect S = {}, numtheory:-divisors(n) minus {1,n})
%p A316227 end proc:
%p A316227 select(filter, [$4..1000]); # _Robert Israel_, Jul 22 2018
%t A316227 MaxCheck = 1000; (* modify as desired *)
%t A316227 ResultList = {};
%t A316227 Do[
%t A316227   If[
%t A316227    Not[PrimeQ[k]] &&
%t A316227     Intersection[
%t A316227       Flatten[
%t A316227        Map[
%t A316227         IntegerDigits,
%t A316227         Complement[Divisors[k], {1, k}]
%t A316227         ]
%t A316227        ],
%t A316227       IntegerDigits[k]
%t A316227       ] == {},
%t A316227    ResultList = Append[ResultList, k]
%t A316227    ],
%t A316227   {k, 2, MaxCheck}];
%t A316227 ResultList
%t A316227 (* or *) Select[Range@500, CompositeQ@# && Intersection[ IntegerDigits@#, Flatten@ IntegerDigits@ Most@ Rest@ Divisors@ #] == {} &] (* _Giovanni Resta_, Jun 27 2018 *)
%o A316227 (PARI) isok(n) = {my(d=divisors(n), dd = Set(digits(n))); for (k=2, #d-1, if (#setintersect(Set(digits(d[k])), dd), return (0));); return (1);}
%o A316227 lista(nn) = {forcomposite(n=1, nn, if (isok(n), print1(n, ", ")););} \\ _Michel Marcus_, Jul 03 2018
%Y A316227 Cf. A002808, A035139, A132080.
%K A316227 nonn,base
%O A316227 1,1
%A A316227 _Jason Zimba_, Jun 27 2018