OFFSET
1,1
FORMULA
a(n) = n + O(x^0.915), where the exponent is the log(k)/log(10) with k the largest root of x^5 - 9x^4 + 4x^3 + 21x^2 - 9x - 5. - Charles R Greathouse IV, Mar 11 2014
EXAMPLE
1998 is a term because 8 and 9 differ by 1.
MATHEMATICA
Select[Range[250], MemberQ[Abs[Differences[IntegerDigits[#]]], 1]&] (* Harvey P. Dale, Apr 07 2018 *)
PROG
(PARI) isok(n) = (d = digits(n)) && (sum(i=1, #d-1, abs(d[i] - d[i+1])==1) >= 1); \\ Michel Marcus, Mar 11 2014
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Anonymous, Apr 15 2003
EXTENSIONS
120 added by Zak Seidov, Mar 11 2014
Name clarified by Jon E. Schoenfield, Oct 29 2022
STATUS
approved