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.

A135643 Straight-line numbers > 99.

Original entry on oeis.org

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

Views

Author

Omar E. Pol, Nov 30 2007, Dec 09 2008, Nov 14 2009

Keywords

Comments

Numbers with more than two digits whose digits are in arithmetic progression. The structure of digits represents a straight line. In the graphic representation the points are connected by imaginary line segments. For a(1) to a(45) this sequence is equal to A034840. Each term of this sequence that is greater than 9876543210 is a repdigit number (A010785).
Note that the sequence of straight-line numbers starts: 10, 11, 12, ..., 98, 99, 111, 123, ... All 2-digit numbers are straight-line numbers, but here the numbers < 100 are omitted. - Omar E. Pol, Nov 14 2009

Examples

			The number 3579 is a straight-line number:
  . . . 9
  . . . .
  . . 7 .
  . . . .
  . 5 . .
  . . . .
  3 . . .
  . . . .
  . . . .
  . . . .
		

Crossrefs

Cf. A247616 (subsequence).

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