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.

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

This page as a plain text file.
%I A363872 #19 Aug 02 2023 11:52:52
%S A363872 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,
%T A363872 30,96,31,97,32,98,33,99,34,100,35,101,36,102,37,103,38,104,39,105,40,
%U A363872 106,41,7,42,8,43,109,44,110,45,111,46,12,47,113,48,14,49,15
%N A363872 Lexicographically earliest sequence of distinct terms > 0 such that n is a substring of a(n) + a(n+1).
%H A363872 Eric Angelini, <a href="http://cinquantesignes.blogspot.com/2023/07/echecs-et-maths.html">Échecs et Maths</a>, Personal blog, bottom of page.
%e A363872 n = 1 is a substring of the sum  1 +  9 = 10
%e A363872 n = 2 is a substring of the sum  9 +  3 = 12
%e A363872 n = 3 is a substring of the sum  3 + 10 = 13
%e A363872 n = 4 is a substring of the sum 10 +  4 = 14
%e A363872 n = 5 is a substring of the sum  4 + 11 = 15
%e A363872 n = 6 is a substring of the sum 11 +  5 = 16
%e A363872 ...
%e A363872 n = 10 is a substring of the sum 13 + 87 = 100, etc.
%p A363872 R:= 1: x:= 1: S:= {1}:
%p A363872 for n from 1 to 100 do
%p A363872   ns:= convert(n,string);
%p A363872   for y from 1 do
%p A363872     if member(y,S) then next fi;
%p A363872     if SearchText(ns,convert(x+y,string)) <> 0 then
%p A363872       R:= R,y; x:= y; S:= S union {y}; break
%p A363872     fi
%p A363872   od
%p A363872 od:
%p A363872 R;  # _Robert Israel_, Jul 04 2023
%t A363872 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 *)
%Y A363872 Cf. A299952.
%K A363872 base,nonn
%O A363872 1,2
%A A363872 _Eric Angelini_, Jul 03 2023