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.
%I A121041 #31 Feb 26 2024 10:10:10 %S A121041 1,1,1,1,1,1,1,1,1,2,2,3,2,2,3,2,2,2,2,2,2,2,1,3,2,2,1,2,1,2,2,2,2,1, %T A121041 2,3,1,1,2,2,2,2,1,2,2,1,1,3,1,2,2,2,1,1,2,1,1,1,1,2,2,2,2,2,2,2,1,1, %U A121041 1,2,2,2,1,1,2,1,2,1,1,2,2,2,1,2,2,1,1,2,1,2,2,2,2,1,2,2,1,1,2,3,2,3,2,3,3 %N A121041 Number of divisors of n that are also contained in the decimal representation of n. %H A121041 Reinhard Zumkeller, <a href="/A121041/b121041.txt">Table of n, a(n) for n = 1..10000</a> %F A121041 a(n) = 1 iff A121042(n) = n. %F A121041 a(A155005(n)) = n and a(m) < n for m < A155005(n). - _Reinhard Zumkeller_, Jan 18 2009 %e A121041 a(22) = #{2, 22} = 2; %e A121041 a(23) = #{23} = 1; %e A121041 a(24) = #{2, 4, 24} = 3. %t A121041 A121041[n_] := DivisorSum[n, 1 &, StringContainsQ[IntegerString[n], IntegerString[#]] &]; Array[A121041, 150] (* _Paolo Xausa_, Feb 25 2024 *) %o A121041 (Haskell) %o A121041 import Data.List (isInfixOf) %o A121041 a121041 n = length $ filter (\d -> n `mod` d == 0 %o A121041 && show d `isInfixOf` show n) [1..n] %o A121041 -- _Reinhard Zumkeller_, Feb 11 2011 %o A121041 (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 A121041 a(n)=sumdiv(n,d, substr(n,d)) \\ _Charles R Greathouse IV_, Mar 31 2016 %o A121041 (Python) %o A121041 from sympy import divisors %o A121041 def a(n): %o A121041 s = str(n) %o A121041 return sum(1 for d in divisors(n, generator=True) if str(d) in s) %o A121041 print([a(n) for n in range(1, 106)]) # _Michael S. Branicky_, Jul 11 2022 %Y A121041 Cf. A121022, A121023, A121024, A121025, A121026, A121027, A121028, A121029, A121030, A121031, A121032, A121033, A121034, A121035, A121036, A121037, A121038, A121039, A121040. %K A121041 nonn,base,easy %O A121041 1,10 %A A121041 _Reinhard Zumkeller_, Jul 21 2006