login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A249591 Lexicographically earliest permutation of the integers such that a(n+1) shares at least one digit with a(n)-1. 6
1, 10, 9, 8, 7, 6, 5, 4, 3, 2, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 20, 29, 22, 23, 24, 25, 26, 27, 28, 32, 30, 39, 31, 33, 34, 35, 36, 37, 38, 43, 40, 49, 41, 42, 44, 45, 46, 47, 48, 54, 50, 59, 51, 52, 53, 55, 56, 57, 58, 65, 60, 69, 61, 62, 63, 64, 66, 67, 68, 70, 76, 71 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
E. Angelini, a(n) shows one of the digits of a(n-1)-1, Nov 02 2014.
PROG
(PARI) {u=0; a=1; for(n=1, 99, print1(a", "); u+=1<<a; D=Set(if(a>1, digits(a-1))); for(k=2, 9e9, bittest(u, k)&&next; #setintersect(D, Set(digits(k)))||next; a=k; break))}
(Haskell)
import Data.List (intersect, delete)
a249591 n = a249591_list !! (n-1)
a249591_list = 1 : f 1 [2..] where
f x zs = g zs where
g (y:ys) = if null $ show y `intersect` show (x - 1)
then g ys else y : f y (delete y zs)
-- Reinhard Zumkeller, Nov 02 2014
CROSSREFS
Cf. A249585.
Cf. A184992.
Sequence in context: A178914 A143473 A055121 * A132674 A090293 A164732
KEYWORD
nonn,base
AUTHOR
Eric Angelini and M. F. Hasler, Nov 01 2014
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 25 04:49 EDT 2024. Contains 374586 sequences. (Running on oeis4.)