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.

A121042 Smallest divisor of n that is also contained in the decimal representation of n.

This page as a plain text file.
%I A121042 #12 May 12 2025 14:01:10
%S A121042 1,2,3,4,5,6,7,8,9,1,1,1,1,1,1,1,1,1,1,2,1,2,23,2,5,2,27,2,29,3,1,2,3,
%T A121042 34,5,3,37,38,3,4,1,2,43,4,5,46,47,4,49,5,1,2,53,54,5,56,57,58,59,6,1,
%U A121042 2,3,4,5,6,67,68,69,7,1,2,73,74,5,76,7,78,79,8,1,2,83,4,5,86,87,8,89,9,1
%N A121042 Smallest divisor of n that is also contained in the decimal representation of n.
%C A121042 1 <= a(n) <= n;
%C A121042 a(A011531(n)) = 1; a(n) = n iff A121041(n) = 1.
%C A121042 a(n) = 1 for almost all n (measure 1). - _Charles R Greathouse IV_, Mar 31 2016
%H A121042 Paolo Xausa, <a href="/A121042/b121042.txt">Table of n, a(n) for n = 1..10000</a>
%e A121042 a(48) = Min{4, 8, 48} = 4;
%e A121042 a(49) = Min{49} = 49;
%e A121042 a(120) = Min{1, 2, 12, 20, 120} = 1;
%e A121042 a(121) = Min{1} = 1.
%t A121042 A121042[n_] := SelectFirst[Divisors[n], StringContainsQ[IntegerString[n], IntegerString[#]] &];
%t A121042 Array[A121042, 100] (* _Paolo Xausa_, May 12 2025 *)
%o A121042 (PARI) substr(a,b)=a=digits(a);b=digits(b); for(i=0,#a-#b, for(j=1,#b, if(a[i+j]!=b[j], next(2))); return(1)); 0
%o A121042 a(n)=fordiv(n,d, if(substr(n,d), return(d))) \\ _Charles R Greathouse IV_, Mar 31 2016
%Y A121042 Cf. A011531, A027750, A121041, A383749 (fixed points).
%K A121042 nonn,base
%O A121042 1,2
%A A121042 _Reinhard Zumkeller_, Jul 21 2006