YentzenPuzzle.frink

View or download YentzenPuzzle.frink in plain text format

/* A sequence of natural numbers is determined by the following formula,
A[n+1] = a[n] + f(n) Where f(n) is the product of digits in a[n]. Is
there an a[1] such that the above sequence is unbounded? */


for n = 175 million to billion
{
   a = n
   smallest = a
   do
   {
      lasta = a
      a = a + product[integerDigits[a]]
      print["$a "]
   } while a > smallest and a > lasta
   println[]
}


View or download YentzenPuzzle.frink in plain text format


This is a program written in the programming language Frink.
For more information, view the Frink Documentation or see More Sample Frink Programs.

Alan Eliasen was born 17592 days, 15 hours, 29 minutes ago.