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.

A059402 Numbers with more than one prime factor that do not end in 0 and contain as substrings every maximal prime power dividing them.

Original entry on oeis.org

1197, 14673, 83731, 129717, 167835, 322794, 429635, 831328, 1127125, 1183497, 1184128, 1319825, 1344837, 1371294, 1724786, 1731195, 1943795, 2597175, 2971137, 2993715, 3161907, 3181437, 3719193, 4609731, 4913928, 5037365, 5912739, 5981125, 6193563
Offset: 1

Views

Author

Erich Friedman, Jan 29 2001

Keywords

Examples

			1197 = 9 * 7 * 19 and all of these are substrings.
		

Programs

  • 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
    
  • 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 *)
  • 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

Extensions

Offset corrected and a(6)-a(26) from Donovan Johnson, Jul 09 2010
Definition stated more precisely by Reinhard Zumkeller, Jul 19 2011