OFFSET
1,1
COMMENTS
The length of each side must be greater than 0 and less than the sum of the other sides.
Subset of the 0-free numbers, A052382, and eventually contains all the 0-free numbers > 9111111111.
LINKS
Maths StackExchange, The no. of possible 3 digit number abc if a,b,c are the sides of a isosceles triangle.
Wikipedia, Integer Triangle
EXAMPLE
110 is not a term since the 3rd side has a length of 0.
111 is a term since a polygon (in this case a triangle) can have sides of length 1,1,1.
112 is not a term since the length of the 3rd side is not less than the sum of the other two sides.
MATHEMATICA
Select[Range[111, 344], AllTrue[TakeDrop[#, 1] & /@ Permutations@ IntegerDigits[#], First[#1] < Total[#2] & @@ # &] &] (* Michael De Vlieger, May 01 2021 *)
PROG
(Java)
public class A343760 {
public static void main(String[] args) {
for (long n = 1; n < 1000; n++) {
if (is(n)) {
System.out.print(n + ", ");
}
}
}
public static boolean is(long n) {
String s = String.valueOf(n);
if (n < 0 || s.contains("0")) {
return false;
}
int perimeter = 0;
char[] sides = s.toCharArray();
for (int i = 0; i < sides.length; i++) {
sides[i] -= '0';
perimeter += sides[i];
}
for (int side : sides) {
if (perimeter <= 2 * side) {
return false;
}
}
return true;
}
}
CROSSREFS
KEYWORD
base,nonn
AUTHOR
John R Phelan, Apr 27 2021
STATUS
approved