A068863 a(1) = 2; a(n+1) is the smallest prime not already in the sequence which differs from a(n) at every digit.
2, 3, 5, 7, 11, 23, 17, 29, 13, 31, 19, 37, 41, 53, 47, 59, 43, 61, 73, 67, 71, 83, 79, 97, 89, 101, 223, 107, 211, 103, 227, 109, 233, 127, 239, 113, 229, 131, 257, 139, 241, 137, 251, 149, 263, 151, 269, 157, 271, 163, 277, 181, 293, 167, 281, 173, 307, 179
Offset: 1
Examples
13 follows 29 as the smallest prime number not included earlier and differing at every digit position with 29.
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000 [Corrected by _Sean A. Irvine_, Mar 19 2024]
Programs
-
Haskell
import Data.List (delete) a068863 n = a068863_list !! (n-1) a068863_list = f "x" (map show a000040_list) where f p ps = g ps where g (q:qs) | and $ zipWith (/=) p q = (read q :: Int) : f q (delete q ps) | otherwise = g qs -- Reinhard Zumkeller, Dec 21 2013 [Warning: this code might not be correct - Sean A. Irvine, Mar 19 2024]
Extensions
Corrected and extended by Sascha Kurz, Feb 02 2003