login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons 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. 3
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

Reinhard Zumkeller, Table of n, a(n) for n = 1..10000

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

Adjacent sequences:  A249588 A249589 A249590 * A249592 A249593 A249594

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 | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 4 20:58 EST 2021. Contains 341811 sequences. (Running on oeis4.)