OFFSET
1,3
COMMENTS
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
LINKS
Robert Israel, Table of n, a(n) for n = 1..95 (n = 1 .. 65 from Andrew Howroyd)
MAPLE
f:= proc(n) local i;
seq(10*n+i, i= sort([n-1, n, n+1] mod 10))
end proc:
istri:= proc(n) issqr(1+8*n) end proc:
S:= [$1..9]: R:= 0, 1, 3, 6: count:= 4:
for i from 1 while count < 95 do
for k from i to i+1 do
for s in S do
tmin:= ceil(sqrt(8*s*10^k+1));
if tmin::even then tmin:= tmin+1 fi;
for t from tmin to floor(sqrt(8*(s+1)*10^k-7)) by 2 do
x:= (t-1)/2; y:= x*(x+1)/2;
L:= convert(y, base, 10);
if convert(L[2..-1]-L[1..-2] mod 10, set) subset {0, 1, 9} then
R:= R, y; count:= count+1;
fi od od od;
if count < 95 then S:= map(f, S) fi;
od:
R; # Robert Israel, Sep 23 2024
MATHEMATICA
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} ]
Select[Accumulate[Range[0, 30000]], Max[Select[Abs[Differences[ IntegerDigits[ #]]], #!=9&]]<2&] (* Harvey P. Dale, Oct 09 2013 *)
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Amarnath Murthy, Feb 23 2002
EXTENSIONS
Edited and extended by Robert G. Wilson v and Sascha Kurz, Mar 01 2002
Offset changed by Andrew Howroyd, Sep 22 2024
STATUS
approved