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.

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.

This page as a plain text file.
%I A249278 #20 Dec 23 2024 14:53:44
%S A249278 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,
%T A249278 29,17,18,40,41,19,30,42,43,31,32,44,45,33,34,46,47,35,36,48,49,37,38,
%U A249278 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
%N 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.
%C A249278 The inverse permutation is given in A249279. - _M. F. Hasler_, Oct 24 2014
%C A249278 A000030(a(n+1)) mod 2 = a(n) mod 2. - _Reinhard Zumkeller_, Oct 27 2014
%H A249278 Reinhard Zumkeller, <a href="/A249278/b249278.txt">Table of n, a(n) for n = 0..10000</a>
%H A249278 Éric Angelini, <a href="https://web.archive.org/web/*/http://list.seqfan.eu/oldermail/seqfan/2014-October/013865.html">Commas squeezed between two same parity digits</a>, SeqFan mailing list, Oct 24 2014
%H A249278 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%o A249278 (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
%o A249278 (Haskell)
%o A249278 a249278 n = a249278_list !! n
%o A249278 a249278_list = 0 : f 0 [1..] where
%o A249278    f u vs = g vs where
%o A249278      g (x:xs) = if (a000030 x) `mod` 2 == u `mod` 2
%o A249278                    then x : f x (delete x vs) else g xs
%o A249278 -- _Reinhard Zumkeller_, Oct 27 2014
%Y A249278 Cf. A000030, A249494 (variant starting with 1).
%K A249278 nonn,base
%O A249278 0,2
%A A249278 _Eric Angelini_, Oct 24 2014