login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A249278 Lexicographically earliest permutation of the nonnegative integers such that the parity of the first digit of a(n+1) equals that of a(n)'s last digit. 4
0, 2, 4, 6, 8, 20, 21, 1, 3, 5, 7, 9, 10, 22, 23, 11, 12, 24, 25, 13, 14, 26, 27, 15, 16, 28, 29, 17, 18, 40, 41, 19, 30, 42, 43, 31, 32, 44, 45, 33, 34, 46, 47, 35, 36, 48, 49, 37, 38, 60, 61, 39, 50, 62, 63, 51, 52, 64, 65, 53, 54, 66, 67, 55, 56, 68, 69, 57, 58, 80, 81, 59, 70, 82, 83, 71, 72, 84, 85, 73, 74, 86, 87, 75, 76, 88, 89, 77, 78, 200, 201 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,2

COMMENTS

The inverse permutation is given in A249279. - M. F. Hasler, Oct 24 2014

A000030(a(n+1)) mod 2 = a(n) mod 2. - Reinhard Zumkeller, Oct 27 2014

LINKS

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

Index entries for sequences that are permutations of the natural numbers

PROG

(PARI) a(n, a=0, u=0)=for(n=1, n, for(k=0, 9e9, !bittest(u, k)&&k\10^(#Str(k)-1)==Mod(a, 2)&&!print1(a=k", ")&&break); u+=1<<a); a \\ M. F. Hasler, Oct 24 2014

(Haskell)

a249278 n = a249278_list !! n

a249278_list = 0 : f 0 [1..] where

   f u vs = g vs where

     g (x:xs) = if (a000030 x) `mod` 2 == u `mod` 2

                   then x : f x (delete x vs) else g xs

-- Reinhard Zumkeller, Oct 27 2014

CROSSREFS

Cf. A000030.

Sequence in context: A323333 A076402 A053198 * A273892 A179082 A194376

Adjacent sequences:  A249275 A249276 A249277 * A249279 A249280 A249281

KEYWORD

nonn,base

AUTHOR

Eric Angelini, Oct 24 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 October 15 15:14 EDT 2019. Contains 328030 sequences. (Running on oeis4.)