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.

A059496 a(1) = 2; a(n+1) is obtained by and trying to change just one digit of a(n), starting with the least significant digit, until a new prime is reached. Take the lexicographically earliest sequence. Digits may be replaced by any nonzero digit.

This page as a plain text file.
%I A059496 #12 Jun 13 2017 09:08:16
%S A059496 2,3,5,7,17,11,13,19,29,23,43,41,47,37,31,61,67,97,197,191,193,199,
%T A059496 139,131,137,127,157,151,181,281,283,223,227,229,239,233,263,269,569,
%U A059496 563,523,521,541,547,557,577,571,271,277,257,251,211,241,641,643,647,617,613,619
%N A059496 a(1) = 2; a(n+1) is obtained by and trying to change just one digit of a(n), starting with the least significant digit, until a new prime is reached. Take the lexicographically earliest sequence. Digits may be replaced by any nonzero digit.
%C A059496 The sequence is finite with last term a(114) = 149, see link and b-file. - _Reinhard Zumkeller_, Jan 06 2014
%H A059496 Reinhard Zumkeller, <a href="/A059496/b059496.txt">Table of n, a(n) for n = 1..114</a>
%H A059496 Reinhard Zumkeller, <a href="/A059496/a059496.txt">Proof of finiteness</a>
%o A059496 (Haskell)
%o A059496 a059496 n = a059496_list !! (n-1)
%o A059496 a059496_list = 2 : f [2] [2] where
%o A059496    f qs xs = g candidates where
%o A059496      g [] = []
%o A059496      g (ys:yss) | a010051 q == 0 || q `elem` qs = g yss
%o A059496                 | otherwise = q : f (q:qs) ys
%o A059496                 where q = foldr (\d r -> 10 * r + d) 0 ys
%o A059496      candidates = [us ++ [z] ++ vs | i <- [0 .. length xs - 1],
%o A059496                          let (us, (_:vs)) = splitAt i xs, z <- [1..9]] ++
%o A059496                   [xs ++ [z] | z <- [1..9]]
%o A059496 -- _Reinhard Zumkeller_, Jan 06 2014
%Y A059496 Another decimal analog of A059458. See A059497 for primes that are missed. Cf. A059471, A059498.
%Y A059496 Cf. A010051.
%K A059496 nonn,base,nice,fini,full
%O A059496 1,1
%A A059496 _David W. Wilson_, Feb 05 2001