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.

A249494 Lexicographically earliest permutation of the positive integers such that the parity of the first digit of a(n+1) equals that of a(n)'s last digit.

Original entry on oeis.org

1, 3, 5, 7, 9, 10, 2, 4, 6, 8, 20, 21, 11, 12, 22, 23, 13, 14, 24, 25, 15, 16, 26, 27, 17, 18, 28, 29, 19, 30, 40, 41, 31, 32, 42, 43, 33, 34, 44, 45, 35, 36, 46, 47, 37, 38, 48, 49, 39, 50, 60, 61, 51, 52, 62, 63, 53, 54, 64, 65, 55, 56, 66, 67, 57, 58, 68, 69, 59, 70, 80, 81, 71, 72, 82, 83, 73, 74, 84, 85, 75, 76, 86, 87, 77, 78, 88, 89, 79, 90, 200
Offset: 1

Views

Author

M. F. Hasler, Oct 30 2014

Keywords

Comments

See A249506 for the inverse permutation.
See A249278 (and inverse A249279) for the variant based on nonnegative integers. A162501 is a variant based not on parity but on equality.

Crossrefs

Cf. A249506 (inverse permutation), A249278 (variant starting with 0), A249279 (inverse thereof), A162501 (variant based on equality of digits).
Cf. A000030 (initial digit), A010879 (final digit of n).

Programs

  • PARI
    a(n,a=1,u=0)=for(n=1,n,for(k=1,9e9, !bittest(u,k)&& k\10^(#Str(k)-1)==Mod(a,2)&& !print1(a=k",")&& break);u+=1<