A262283 a(1)=2. For n>1, let s denote the digit-string of a(n-1) with the first digit omitted. Then a(n) is the smallest prime not yet present which starts with s.
2, 3, 5, 7, 11, 13, 31, 17, 71, 19, 97, 73, 37, 79, 907, 701, 101, 103, 307, 709, 911, 113, 131, 311, 1103, 1031, 313, 137, 373, 733, 331, 317, 173, 739, 397, 971, 719, 191, 919, 193, 937, 379, 797, 977, 773, 7307, 3079, 7901, 9011, 1109, 109, 929, 29, 941, 41
Offset: 1
Examples
a(1)=2, so s is the empty string, so a(2) is the smallest missing prime, 3. After a(6)=13, s=3, so a(7) is the smallest missing prime that starts with 3, which is 31.
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..676
Programs
-
Haskell
import Data.List (isPrefixOf, delete) a262283 n = a262283_list !! (n-1) a262283_list = 2 : f "" (map show $ tail a000040_list) where f xs pss = (read ys :: Integer) : f (dropWhile (== '0') ys') (delete ys pss) where ys@(_:ys') = head $ filter (isPrefixOf xs) pss -- Reinhard Zumkeller, Sep 19 2015
Extensions
More terms from Alois P. Heinz, Sep 18 2015
Comments