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.

Showing 1-2 of 2 results.

A299957 The sum a(n) + a(n+1) always has at least one digit "1". Lexicographically first such sequence of nonnegative integers without duplicate term.

Original entry on oeis.org

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

Views

Author

Eric Angelini, Feb 22 2018

Keywords

Comments

The sequence starts with a(0) = 0 and is always extended with the smallest integer not yet present that does not lead to a contradiction. The sequence is a permutation of the natural numbers.
Originally the sequence was defined starting with a(1) = 1 and using only positive integers. This leads to the same sequence restricted to positive indices, which yields a permutation of the positive integers. - M. F. Hasler, Feb 28 2018

Examples

			1 + 9 = 10; 9 + 2 = 11; 2 + 8 = 10; 8 + 3 = 11; 3 + 7 = 10; 7 + 4 = 11; 4 + 6 = 10; 6 + 5 = 11; etc.
		

Crossrefs

Cf. A299952 (different constraint: a(n) + a(n+1) must be substring of concatenation of a(1..n+1)).
Cf. A299970, A299982, ..., A299988, A299969 (nonnegative analog with digit 0, 2, ..., 9), A299971, A299972, ..., A299979 (positive analog with digit 0, 2, ..., 9).
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[k + #[[-1]], 10, 1] > 0], k++]; k]] &, {1}, 98] (* Michael De Vlieger, Feb 22 2018 *)
  • PARI
    a(n, f=1, a=0, u=[a])={for(n=a+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)),1)&&(a=k)&&break); u=setunion(u, [a]); u[2]==u[1]+1&&u=u[^1]); a} \\ M. F. Hasler, Feb 22 2018

Extensions

Extended to a(0) = 0 by M. F. Hasler, Feb 28 2018

A363872 Lexicographically earliest sequence of distinct terms > 0 such that n is a substring of a(n) + a(n+1).

Original entry on oeis.org

1, 9, 3, 10, 4, 11, 5, 2, 6, 13, 87, 23, 89, 24, 90, 25, 91, 26, 92, 27, 93, 28, 94, 29, 95, 30, 96, 31, 97, 32, 98, 33, 99, 34, 100, 35, 101, 36, 102, 37, 103, 38, 104, 39, 105, 40, 106, 41, 7, 42, 8, 43, 109, 44, 110, 45, 111, 46, 12, 47, 113, 48, 14, 49, 15
Offset: 1

Views

Author

Eric Angelini, Jul 03 2023

Keywords

Examples

			n = 1 is a substring of the sum  1 +  9 = 10
n = 2 is a substring of the sum  9 +  3 = 12
n = 3 is a substring of the sum  3 + 10 = 13
n = 4 is a substring of the sum 10 +  4 = 14
n = 5 is a substring of the sum  4 + 11 = 15
n = 6 is a substring of the sum 11 +  5 = 16
...
n = 10 is a substring of the sum 13 + 87 = 100, etc.
		

Crossrefs

Cf. A299952.

Programs

  • Maple
    R:= 1: x:= 1: S:= {1}:
    for n from 1 to 100 do
      ns:= convert(n,string);
      for y from 1 do
        if member(y,S) then next fi;
        if SearchText(ns,convert(x+y,string)) <> 0 then
          R:= R,y; x:= y; S:= S union {y}; break
        fi
      od
    od:
    R;  # Robert Israel, Jul 04 2023
  • Mathematica
    a[1] = 1; a[n_] := a[n] = Module[{k = 2}, While[! FreeQ[Array[a, n - 1], k] || ! StringContainsQ[ToString[a[n - 1] + k], ToString[n - 1]], k++]; k]; Array[a, 100] (* Amiram Eldar, Jul 04 2023 *)
Showing 1-2 of 2 results.