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.

A299969 Lexicographic first sequence of nonnegative integers such that a(n) + a(n+1) has a digit 9, and no term occurs twice.

Original entry on oeis.org

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

Views

Author

M. F. Hasler and Eric Angelini, Feb 22 2018

Keywords

Comments

A permutation of the nonnegative integers.
It happens that from a(50) = 50 on, this sequence coincides with the variant A299979 (starting at 1 and having only positive terms). Indeed the two sequences have the property that the terms a(0..49) resp. A299979(1..49) exactly contain all numbers from 0 to 49, respectively 1 to 49. - M. F. Hasler, Feb 28 2018

Crossrefs

Cf. A299979 (analog with positive terms), A299957 (analog with digit 1), A299970, A299982, ..., A299988 (digit 0, 2, ..., 8).
Cf. A299980, A299981, A299402, A299403, A298974, A298975, A299996, A299997, A298978, A298979 for the analog using multiplication: a(n)*a(n+1) has a digit 0, resp. 1, ..., resp. 9.

Programs

  • Mathematica
    Nest[Append[#, Block[{k = 1}, While[Nand[FreeQ[#, k], DigitCount[#[[-1]] + k, 10, 9] > 0], k++]; k]] &, {0}, 90] (* Michael De Vlieger, Mar 01 2018 *)
  • PARI
    a(n,f=1,d=9,a=0,u=[a])={for(n=1,n,f&&if(f==1,print1(a","),write(f,n-1," "a));for(k=u[1]+1,oo,setsearch(u,k)&&next;setsearch(Set(digits(a+k)),d)&&(a=k)&&break);u=setunion(u,[a]);u[2]==u[1]+1&&u=u[^1]);a}