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.

A068149 Triangular numbers in which neighboring digits differ at most by 1. Allowed neighbors of 9 are 0, 8 and 9.

This page as a plain text file.
%I A068149 #24 Sep 23 2024 11:32:22
%S A068149 0,1,3,6,10,21,45,55,66,78,210,666,990,2211,3321,5565,6555,8778,10011,
%T A068149 90100,112101,222111,232221,443211,887778,5433456,5456556,5656566,
%U A068149 5676765,22221111,22321221,34565455,88877778,211099878,212210901
%N A068149 Triangular numbers in which neighboring digits differ at most by 1. Allowed neighbors of 9 are 0, 8 and 9.
%C A068149 Includes (2 * 10^(2*k) - 10^k - 1)/9 and (8 * 10^(2*k) - 10^(k+1) + 2)/9 for k >= 1, and (2 * 10^(2*k) + 89 * 10^k + 989)/9 for k >= 2. - _Robert Israel_, Sep 22 2024
%H A068149 Robert Israel, <a href="/A068149/b068149.txt">Table of n, a(n) for n = 1..95</a> (n = 1 .. 65 from Andrew Howroyd)
%p A068149 f:= proc(n) local i;
%p A068149    seq(10*n+i, i= sort([n-1, n, n+1] mod 10))
%p A068149 end proc:
%p A068149 istri:= proc(n) issqr(1+8*n) end proc:
%p A068149 S:= [$1..9]: R:= 0,1,3,6: count:= 4:
%p A068149 for i from 1 while count < 95 do
%p A068149   for k from i to i+1 do
%p A068149     for s in S do
%p A068149       tmin:= ceil(sqrt(8*s*10^k+1));
%p A068149       if tmin::even then tmin:= tmin+1 fi;
%p A068149       for t from tmin to floor(sqrt(8*(s+1)*10^k-7)) by 2 do
%p A068149         x:= (t-1)/2; y:= x*(x+1)/2;
%p A068149         L:= convert(y,base,10);
%p A068149         if convert(L[2..-1]-L[1..-2] mod 10, set) subset {0,1,9} then
%p A068149           R:= R,y; count:= count+1;
%p A068149   fi od od od;
%p A068149   if count < 95 then S:= map(f, S) fi;
%p A068149 od:
%p A068149 R; # _Robert Israel_, Sep 23 2024
%t A068149 Do[a = IntegerDigits[n(n + 1)/2]; k = 1; l = Length[a]; While[k < l && (Abs[a[[k]]- a[[k + 1]]] < 2 || Abs[a[[k]] - a[[k + 1]]] > 8), k++ ]; If[k == l, Print[n(n + 1)/2]], {n, 0, 10^5} ]
%t A068149 Select[Accumulate[Range[0,30000]],Max[Select[Abs[Differences[ IntegerDigits[ #]]], #!=9&]]<2&] (* _Harvey P. Dale_, Oct 09 2013 *)
%Y A068149 Intersection of A000217 and A376425.
%K A068149 base,easy,nonn
%O A068149 1,3
%A A068149 _Amarnath Murthy_, Feb 23 2002
%E A068149 Edited and extended by _Robert G. Wilson v_ and _Sascha Kurz_, Mar 01 2002
%E A068149 Offset changed by _Andrew Howroyd_, Sep 22 2024