Numbers   (positive integers expressed in base ten)   that are (evenly) divisible by the number formed by the
first and last digit are known as   gapful numbers.


Evenly divisible   means divisible with   no   remainder.



All   one─   and two─digit   numbers have this property and are trivially excluded.   Only
numbers    ≥  100   will be considered for this Rosetta Code task.



Example

187   is a   gapful   number because it is evenly divisible by the
number   17   which is formed by the first and last decimal digits
of    187. 



About   7.46%   of positive integers are   gapful.



Task

   Generate and show all sets of numbers (below) on one line (horizontally) with a title,   here on this page
   Show the first   30   gapful numbers
   Show the first   15   gapful numbers    ≥           1,000,000
   Show the first   10   gapful numbers    ≥    1,000,000,000


Related tasks

   Harshad or Niven series.
   palindromic gapful numbers.
   largest number divisible by its digits.


Also see

   The OEIS entry:   A108343 gapful numbers.
   numbersaplenty gapful numbers


function is_gapful(n)
	m = n
	l = n mod 10
	while (m >= 10)
		m = int(m / 10)
	end while
	return (m * 10) + l
end function
 
subroutine muestra_gapful(n, gaps)
	inc = 0
	print "Primeros "; gaps; " números gapful >= "; n
	while inc < gaps
		if n mod is_gapful(n) = 0 then
			print " " ; n ;
			inc = inc + 1
		end if
		n = n + 1
	end while
	print chr(10)
end subroutine
 
call muestra_gapful(100, 30)
call muestra_gapful(1000000, 15)
call muestra_gapful(1000000000, 10)
call muestra_gapful(7123,25)
end