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-10 of 16 results. Next

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

A135602 Right-angled numbers with an internal digit as the vertex.

Original entry on oeis.org

101, 121, 212, 232, 323, 343, 434, 454, 545, 565, 656, 676, 767, 787, 878, 898, 989, 1012, 1210, 1232, 2101, 2123, 2321, 2343, 3212, 3234, 3432, 3454, 4323, 4345, 4543, 4565, 5434, 5456, 5654, 5676, 6545, 6567, 6765, 6787, 7656, 7678, 7876, 7898, 8767, 8789, 8987
Offset: 1

Views

Author

Omar E. Pol, Dec 02 2007

Keywords

Comments

The structure of digits represents a right angle. The vertex is an internal digit. In the graphic representation the points are connected by imaginary line segments from left to right. This sequence is finite. The final term has 19 digits: 9876543210123456789.

Examples

			Illustration using the final term of this sequence:
  9 . . . . . . . . . . . . . . . . . 9
  . 8 . . . . . . . . . . . . . . . 8 .
  . . 7 . . . . . . . . . . . . . 7 . .
  . . . 6 . . . . . . . . . . . 6 . . .
  . . . . 5 . . . . . . . . . 5 . . . .
  . . . . . 4 . . . . . . . 4 . . . . .
  . . . . . . 3 . . . . . 3 . . . . . .
  . . . . . . . 2 . . . 2 . . . . . . .
  . . . . . . . . 1 . 1 . . . . . . . .
  . . . . . . . . . 0 . . . . . . . . .
		

Crossrefs

Programs

  • Python
    ups = list(tuple(range(i, j)) for i in range(9) for j in range(i+2, 11))
    s = set(L[::-1] + R[1:] for L in ups for R in ups if L[0] == R[0])
    s |= set(L[:-1] + R[::-1] for L in ups for R in ups if L[-1] == R[-1])
    afull = sorted(int("".join(map(str, t))) for t in s if t[0] != 0)
    print(afull[:47]) # Michael S. Branicky, Aug 02 2022

A135601 Acute-angled numbers with an internal digit as the vertex.

Original entry on oeis.org

102, 103, 104, 105, 106, 107, 108, 109, 120, 130, 131, 132, 140, 141, 142, 143, 150, 151, 152, 153, 154, 160, 161, 162, 163, 164, 165, 170, 171, 172, 173, 174, 175, 176, 180, 181, 182, 183, 184, 185, 186, 187, 190, 191, 192, 193, 194, 195
Offset: 1

Views

Author

Omar E. Pol, Dec 02 2007

Keywords

Comments

The structure of digits represents an acute angle. The vertex is an internal digit. In the graphic representation the points are connected by imaginary line segments from left to right. This sequence is finite. The final term has 14 digits: 98765432102468.

Examples

			Illustration using the final term of this sequence:
  9 . . . . . . . . . . . . .
  . 8 . . . . . . . . . . . 8
  . . 7 . . . . . . . . . . .
  . . . 6 . . . . . . . . 6 .
  . . . . 5 . . . . . . . . .
  . . . . . 4 . . . . . 4 . .
  . . . . . . 3 . . . . . . .
  . . . . . . . 2 . . 2 . . .
  . . . . . . . . 1 . . . . .
  . . . . . . . . . 0 . . . .
		

Crossrefs

Programs

  • Python
    progressions = set(tuple(range(i, j+1, d)) for i in range(10) for d in range(1, 10-i) for j in range(i+d, 10))
    s = set()
    for left in progressions:
        for right in progressions:
            dl, dr = left[1] - left[0], right[1] - right[0]
            if dl + dr > 2:
                if left[-1] == right[-1]: s.add(left[:-1] + right[::-1])
                if left[0] == right[0]: s.add(left[::-1] + right[1:])
    afull = sorted(int("".join(map(str, t))) for t in s if t[0] != 0)
    print(afull[:53]) # Michael S. Branicky, Aug 02 2022

Formula

If a(n) does not end in 0, then A004086(a(n)) is a term; if a(n) does not start with 9, then A061601(a(n)) is a term. - Michael S. Branicky, Aug 02 2022

A135603 Obtuse-angled numbers with an internal digit as the vertex.

Original entry on oeis.org

100, 110, 112, 113, 114, 115, 116, 117, 118, 119, 122, 124, 125, 126, 127, 128, 129, 133, 134, 136, 137, 138, 139, 144, 145, 146, 148, 149, 155, 156, 157, 158, 166, 167, 168, 169, 177, 178, 179, 188, 189, 199, 200, 211, 220, 221, 223, 224, 225, 226, 227, 228, 229, 233
Offset: 1

Views

Author

Omar E. Pol, Dec 02 2007

Keywords

Comments

The structure of digits represents an obtuse angle. The vertex is an internal digit. In the graphic representation the points are connected by imaginary line segments from left to right.
For each k >= 11, there are 354 k-digit terms. - Michael S. Branicky, Aug 03 2022

Examples

			Illustration of the number 9753111:
  9 . . . . . .
  . . . . . . .
  . 7 . . . . .
  . . . . . . .
  . . 5 . . . .
  . . . . . . .
  . . . 3 . . .
  . . . . . . .
  . . . . 1 1 1
  . . . . . . .
		

Crossrefs

Programs

  • Python
    from itertools import count, islice
    def ok3(n):
        if n < 100: return False
        d = list(map(int, str(n)))
        m1, m2 = (d[1]-d[0], d[-1]-d[-2])
        return len({m1, m2}) == 2 and m1*m2 >= 0
    def agen():
        seeds = [k for k in range(100, 1000) if ok3(k)]
        for digits in count(4):
            yield from sorted(seeds)
            new, pow10 = set(), 10**(digits-1)
            for q in seeds:
                d = list(map(int, str(q)))
                e1, e2 = d[0] - (d[1]-d[0]), d[-1] + (d[-1]-d[-2])
                if 9 >= e1 > 0: new.add(e1*pow10 + q)
                if 9 >= e2 >= 0: new.add(10*q + e2)
            seeds = new
    print(list(islice(agen(), 54))) # Michael S. Branicky, Aug 03 2022

Extensions

a(49) and beyond from Michael S. Branicky, Aug 03 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

A135600 Angled numbers with an internal digit as the vertex.

Original entry on oeis.org

100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147
Offset: 1

Views

Author

Omar E. Pol, Dec 02 2007

Keywords

Comments

The structure of digits represents an angle. The vertex is an internal digit. In the graphic representation the points are connected by imaginary line segments from left to right. The last acute-angled number of this sequence has 14 digits: 98765432102468. The last right-angled number of this sequence has 19 digits: 9876543210123456789. All 3-digit numbers are terms of this sequence. Next terms are 1000, 1012, 1024, 1036, 1048, 1110, 1111, 1112, 1113, 1114, ....
For each k >= 20, there are 363 k-digit terms: 354 obtuse-angled and 9 straight-angled.- Michael S. Branicky, Aug 03 2022

Examples

			The acute-angled number 12342 (see A135601):
  . . . . .
  . . . 4 .
  . . 3 . .
  . 2 . . 2
  1 . . . .
The right-angled number 12343 (see A135602):
  . . . . .
  . . . 4 .
  . . 3 . 3
  . 2 . . .
  1 . . . .
The obtuse-angled number 12344 (see A135603):
  . . . . .
  . . . 4 4
  . . 3 . .
  . 2 . . .
  1 . . . .
The straight-angled (or straight-line) number 12345 (see A135643):
  . . . . 5
  . . . 4 .
  . . 3 . .
  . 2 . . .
  1 . . . .
		

Crossrefs

Programs

  • PARI
    \\ See PARI link. David A. Corneth, Aug 02 2022
    
  • Python
    from itertools import count, islice
    def agen():
        seeds = [k for k in range(100, 1000)]
        for digits in count(4):
            yield from sorted(seeds)
            new, pow10 = set(), 10**(digits-1)
            for q in seeds:
                d = list(map(int, str(q)))
                e1, e2 = d[0] - (d[1]-d[0]), d[-1] + (d[-1]-d[-2])
                if 9 >= e1 > 0: new.add(e1*pow10 + q)
                if 9 >= e2 >= 0: new.add(10*q + e2)
            seeds = new
    print(list(islice(agen(), 50))) # Michael S. Branicky, Aug 03 2022

A138141 Numbers with digits in ascending order that differ exactly by 1.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 23, 34, 45, 56, 67, 78, 89, 123, 234, 345, 456, 567, 678, 789, 1234, 2345, 3456, 4567, 5678, 6789, 12345, 23456, 34567, 45678, 56789, 123456, 234567, 345678, 456789, 1234567, 2345678, 3456789, 12345678, 23456789, 123456789
Offset: 1

Views

Author

Omar E. Pol, Mar 19 2008

Keywords

Comments

This finite sequence has 45 members. The last member is 123456789. There are 10-k members with k digits. See A052017 for primes in this sequence. All members with 3 or more digits are straight-line numbers A135643.

Crossrefs

Programs

  • Mathematica
    Table[FromDigits/@Partition[Range[9],n,1],{n,9}]//Flatten (* Harvey P. Dale, Mar 19 2017 *)

Formula

a(n) = floor(((9*t^2 - 189*t + 18*n + 182) * (10^t - 1) - 18*t) / 162), where t = floor((21 - sqrt(369 - 8*n)) / 2). - Christopher J. Thomas, Feb 14 2024

A163278 Concave-convex numbers.

Original entry on oeis.org

1010, 1011, 1020, 1021, 1022, 1023, 1030, 1031, 1032, 1033, 1034, 1035, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071
Offset: 1

Views

Author

Omar E. Pol, Oct 16 2009

Keywords

Comments

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

Examples

			The number of this sequence (A163278) is a concave-convex number:
. . . . . .
. . . . . 8
. . . . 7 .
. 6 . . . .
. . . . . .
. . . . . .
. . 3 . . .
. . . 2 . .
1 . . . . .
. . . . . .
		

Crossrefs

Programs

  • 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

A138142 Nonnegative numbers with digits in descending order that differ exactly by 1.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 21, 32, 43, 54, 65, 76, 87, 98, 210, 321, 432, 543, 654, 765, 876, 987, 3210, 4321, 5432, 6543, 7654, 8765, 9876, 43210, 54321, 65432, 76543, 87654, 98765, 543210, 654321, 765432, 876543, 987654
Offset: 1

Views

Author

Omar E. Pol, Mar 19 2008

Keywords

Comments

This finite sequence has 55 members. The last member is 9876543210. There are 11-k members with k digits. See A052016 for primes in this sequence. All members with 3 or more digits are straight-line numbers A135643.

Examples

			Last 10 members of this finite sequence:
a(45)=6543210
a(46)=7654321
a(47)=8765432
a(48)=9876543
a(49)=76543210
a(50)=87654321
a(51)=98765432
a(52)=876543210
a(53)=987654321
a(54)=9876543210
		

Crossrefs

Programs

  • Mathematica
    fQ[n_]:=Module[{id=IntegerDigits[n]}, n<10 || Union[Differences[id]]=={-1}]; Select[Range[0, 100000], fQ] (* Vladimir Joseph Stephan Orlovsky, Dec 29 2010 *)
    Sort[Flatten[With[{t=Range[9,0,-1]},Table[FromDigits/@Partition[t,n,1],{n,10}]]]] (* Harvey P. Dale, Oct 31 2013 *)

Extensions

Examples corrected by Omar E. Pol, Dec 06 2008
Showing 1-10 of 16 results. Next