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.

Showing 1-4 of 4 results.

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

A135642 Concave numbers.

Original entry on oeis.org

110, 120, 121, 122, 130, 131, 132, 133, 134, 140, 141, 142, 143, 144, 145, 146, 150, 151, 152, 153, 154, 155, 156, 157, 158, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182
Offset: 1

Views

Author

Omar E. Pol, Nov 30 2007

Keywords

Comments

The structure of digits represents a concave function or a concave object. In the graphic representation the points are connected by imaginary line segments from left to right.
Only strictly concave numbers are included in this sequence; the interpolation between at least one pair of digits must be strictly less than some intermediate digit. - Franklin T. Adams-Watters, Jan 26 2014
Also numbers where the second difference of consecutive digits is at most 0 and at least one of the second differences is negative. - David A. Corneth, Aug 02 2022

Examples

			The number 12221 is a concave number. Note that the number of this sequence (A135642) is also a concave number as shown below:
.
9     . . . . . .      . . . . . .
8     . . . . . .      . . . . . .
7     . . . . . .      . . . . . .
6     . . . x . .      . . . 6 . .
5     . . x . . .      . . 5 . . .
4     . . . . x .      . . . . 4 .
3     . x . . . .      . 3 . . . .
2     . . . . . x      . . . . . 2
1     x . . . . .      1 . . . . .
0     . . . . . .      . . . . . .
.
Another example is 1342. On the other hand, 3124 is not in the sequence, it's in A135641. 1234 is not in the sequence, it's in A135643. 1243 is not in the sequence, it's in A163278. - _Omar E. Pol_, Jan 29 2014
		

Crossrefs

Programs

  • Mathematica
    concaveQ[n_] := With[{dd = IntegerDigits[n]}, AllTrue[SequencePosition[dd, {, , _}][[All, 1]], dd[[#]] + dd[[#+2]] < 2 dd[[#+1]]&]];
    Select[Range[100, 200], concaveQ] (* Jean-François Alcover, Nov 01 2018 *)
  • PARI
    { isconcave(n) = my(t,r); t=eval(Vec(Str(n))); r=0; for(i=1, #t, for(j=i+2, #t, for(k=i+1, j-1, if( t[k]*(j-i) < t[i]*(j-k) + t[j]*(k-i), return(0)); if( t[k]*(j-i) > t[i]*(j-k) + t[j]*(k-i), r=1); ))); r } /* Franklin T. Adams-Watters and Max Alekseyev, Jan 30 2014 */
    
  • PARI
    is(n) = if(n<100, return(0)); my(d=digits(n), v=vector(#d-2, i, d[i+2] - 2*d[i+1] + d[i])); v=Set(v); v[1] < 0 && v[#v] <= 0 \\ David A. Corneth, Aug 02 2022

A135641 Convex numbers.

Original entry on oeis.org

100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 112, 113, 114, 115, 116, 117, 118, 119, 124, 125, 126, 127, 128, 129, 136, 137, 138, 139, 148, 149, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 211, 212, 213, 214, 215, 216, 217
Offset: 1

Views

Author

Omar E. Pol, Nov 30 2007

Keywords

Comments

The structure of digits represents a convex function or a convex object. In the graphic representation the points are connected by imaginary line segments from left to right.

Examples

			The number 742235 is a convex number.
  . . . . . .
  . . . . . .
  7 . . . . .
  . . . . . .
  . . . . . 5
  . 4 . . . .
  . . . . 3 .
  . . 2 2 . .
  . . . . . .
  . . . . . .
		

Crossrefs

Cf. A135642 (concave numbers), A135643 (straight line numbers), A163278 (concave-convex numbers).

Programs

  • Mathematica
    convexQ[n_] := With[{dd = IntegerDigits[n]}, AllTrue[SequencePosition[dd, {, , _}][[All, 1]], dd[[#]] + dd[[#+2]] > 2 dd[[#+1]]&]];
    Select[Range[100, 300], convexQ] (* Jean-François Alcover, Nov 01 2018 *)
  • 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) \\ Rémy Sigrist, Aug 09 2017

A167846 Concave-convex primes.

Original entry on oeis.org

1021, 1031, 1033, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423
Offset: 1

Views

Author

Omar E. Pol, Nov 13 2009

Keywords

Comments

Primes in A163278.
Prime numbers with more than three digits that are not straight-line numbers (A135643), concave numbers (A135642) or convex numbers (A135641).

Crossrefs

Extensions

More terms from Rémy Sigrist, May 22 2019
Showing 1-4 of 4 results.