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.

A224780 Strings of ascending digits in A007376.

This page as a plain text file.
%I A224780 #15 Apr 28 2013 01:34:33
%S A224780 123456789,12,12,23,23,34,34,45,45,56,56,67,67,78,78,89,89,12,12,12,
%T A224780 123,12,12,12,12,12,12,34,45,56,67,78,89,12,12,12,23,23,23,123,23,234,
%U A224780 23,23,23,23,23,12,45,12,56,12,67,12,78,12,89,12,23,123,23,23,23,34,34,34,34,234,34,345,34,34,34,34,23,56,23,67,23,78,23,89
%N A224780 Strings of ascending digits in A007376.
%C A224780 We sample each digit in A007376 in turn; accept the longest string for which A(n+1)-A(n)=1, A(n+2)-A(n+1)=1 and so on.
%C A224780 We recognize only strings of length >=2 and not strings with leading zeros.
%C A224780 Series is infinite, but there are only 36 possible consecutive strings: 12, 123, 1234,...,123456789 (eight beginning with 1), 23, 234, 2345,...,23456789 (seven beginning with 2) and so on.
%e A224780 The 1st five terms imbedded in A007376 in brackets: [123456789]1011[12]13141516171819202[12]2[23]24252627282930313[23]
%p A224780 A007376 := [] :
%p A224780 for n from 1 to 400 do
%p A224780     nb := convert(n,base,10) ;
%p A224780     A007376 := [op(A007376),op(ListTools[Reverse](nb))] ;
%p A224780 end do:
%p A224780 str := 1 :
%p A224780 while true do
%p A224780     for a from 1 do
%p A224780         if op(str+a,A007376) <> 1+op(str+a-1,A007376) then
%p A224780             break;
%p A224780         end if;
%p A224780     end do:
%p A224780     L := ListTools[Reverse]([op(str..str+a-1,A007376)]) ;
%p A224780     if nops(L) > 1 and op(-1,L) > 0 then
%p A224780         add( op(i,L)*10^(i-1),i=1..nops(L)) ;
%p A224780         printf("%d,",%) ;
%p A224780     end if;
%p A224780     str := str+a ;
%p A224780 end do: # _R. J. Mathar_, Apr 26 2013
%K A224780 nonn,base
%O A224780 1,1
%A A224780 _Dave Durgin_, Apr 17 2013