A193408 Hill numbers.
1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, 44, 55, 66, 77, 88, 99, 111, 121, 131, 141, 151, 161, 171, 181, 191, 222, 232, 242, 252, 262, 272, 282, 292, 333, 343, 353, 363, 373, 383, 393, 444, 454, 464, 474, 484, 494, 555, 565, 575, 585, 595, 666, 676, 686, 696, 777, 787, 797, 888, 898, 999, 1111, 1221, 1231, 1241, 1251, 1261, 1271, 1281, 1291, 1321, 1331
Offset: 1
Examples
Illustration using a term of this sequence, 4566664: . . 6 6 6 6 . . 5 . . . . . 4 . . . . . 4
Programs
-
Mathematica
nonz[v_] := Select[v,#!=0 &]; hillQ[n_] := Module[{d=IntegerDigits[n]}, If[d[[1]] != d[[-1]], Return[False]]; MemberQ[{{},{0},{-2}}, nonz@ Differences@ Sign@ nonz@ Differences@d]]; Select[Range[1000], hillQ] (* Amiram Eldar, Dec 19 2018 *)
Comments