OFFSET
1,1
LINKS
Reinhard Zumkeller and Donovan Johnson, Table of n, a(n) for n = 1..500 (first 100 terms from Reinhard Zumkeller)
Reinhard Zumkeller, Demonstration of first 100 terms
EXAMPLE
1197 = 9 * 7 * 19 and all of these are substrings.
MATHEMATICA
ok[n_] := If[id = IntegerDigits[n]; Last[id] == 0, False, If[ff = IntegerDigits /@ Apply[ Power, FactorInteger[n], {1}]; Length[ff] == 1, False, And @@ (MatchQ[id, {___, Sequence @@ #, ___}] & ) /@ ff]]; A059402 = {}; Do[ If[ok[n], Print[n]; AppendTo[A059402, n]], {n, 1, 6*10^6}] (* Jean-François Alcover, Nov 24 2011 *)
PROG
(Haskell)
import Data.List (isInfixOf)
a059402 n = a059402_list !! (n-1)
a059402_list = filter chi [1..] where
chi n = n `mod` 10 > 0 && f n 1 0 a000040_list where
f :: Integer -> Integer -> Int -> [Integer] -> Bool
f 1 1 o _ = o > 1
f m x o ps'@(p:ps)
| r == 0 = f m' (p*x) o ps'
| x > 1 = show x `isInfixOf` show n && f m 1 (o+1) ps
| m < p * p = f 1 m o ps
| otherwise = f m 1 o ps
where (m', r) = divMod m p
-- Reinhard Zumkeller, Jul 21 2011
(Python)
from sympy import factorint
A059402_list = [n for n in range(2, 10**6) if n % 10 and len(factorint(n)) > 1 and all(str(a**b) in str(n) for a, b in factorint(n).items())] # Chai Wah Wu, Aug 13 2021
CROSSREFS
KEYWORD
base,nice,nonn
AUTHOR
Erich Friedman, Jan 29 2001
EXTENSIONS
Offset corrected and a(6)-a(26) from Donovan Johnson, Jul 09 2010
Definition stated more precisely by Reinhard Zumkeller, Jul 19 2011
STATUS
approved