A135643 Straight-line numbers > 99.
111, 123, 135, 147, 159, 210, 222, 234, 246, 258, 321, 333, 345, 357, 369, 420, 432, 444, 456, 468, 531, 543, 555, 567, 579, 630, 642, 654, 666, 678, 741, 753, 765, 777, 789, 840, 852, 864, 876, 888, 951, 963, 975, 987, 999, 1111, 1234
Offset: 1
Examples
The number 3579 is a straight-line number: . . . 9 . . . . . . 7 . . . . . . 5 . . . . . . 3 . . . . . . . . . . . . . . .
Links
- Jens Kruse Andersen, Table of n, a(n) for n = 1..168
Crossrefs
Programs
-
Haskell
a135643 n = a135643_list !! (n-1) a135643_list = filter f [100..] where f x = all (== 0) ws where ws = zipWith (-) (tail vs) vs vs = zipWith (-) (tail us) us us = map (read . return) $ show x -- Reinhard Zumkeller, Sep 21 2014
-
Mathematica
Select[Range[100,1300],Length[Union[Differences[IntegerDigits[#]]]]==1&] (* Harvey P. Dale, May 09 2012 *)
-
PARI
is(n) = my (d=digits(n), cvx=0, ccv=0, str=0); for (i=1, #d-2, my (x=d[i]+d[i+2]-2*d[i+1]); if (x>0, cvx++, x<0, ccv++, str++)); return (cvx==0 && ccv==0 && str>0) \\ Rémy Sigrist, Aug 09 2017
-
Python
from itertools import count, islice def agen(): progressions = ["".join(map(str, range(i, j+1, d))) for i in range(10) for d in range(1, 10-i) for j in range(i+2*d, 10)] s = [p for p in progressions if p[0] != "0"] # up s += [p[::-1] for p in progressions] # down s += [d*i for d in "123456789" for i in range(3, 11)] # flat yield from sorted(set(int(w) for w in s)) yield from (int(f*d) for d in count(11) for f in "123456789") print(list(islice(agen(), 178))) # Michael S. Branicky, Aug 03 2022
Comments