-
Longest Collatz sequence
Read more: Longest Collatz sequenceFrom the Project Euler Problem 14: The following iterative sequence is defined for the set of positive integers: n → n/2 (n is even) n → 3n + 1 (n is odd) Using the rule above and starting with 13, we generate the following sequence: 13 → 40 → 20 → 10 → 5 →…
-
Attaching shared javascript and css code in a lotus form
Read more: Attaching shared javascript and css code in a lotus formThe javascript and css code used in a lotus form can also be useful in other forms, and so it is best to save it only one time in a shared place. The pages works well for this purpose and in this post I explain how to create page containing JavaScript code and css and…
-
Varargs: passing a variable number of arguments to a method
Read more: Varargs: passing a variable number of arguments to a methodFrom version 5 of Java you can call a method passing a variable number of arguments. A variable of this type is called varargs, you can only use in a method signature and its syntax is the primitive type or object type followed by 3 dots (ellipsis).
-
Large sum
Read more: Large sumFrom the Project Euler Problem 13: Work out the first ten digits of the sum of the following one-hundred 50-digit numbers.
-
Validation of an Edit Box control in the XPages
Read more: Validation of an Edit Box control in the XPagesIn the XPages the “Edit Box” controls have some settings that allow you to perform simple validations. These settings are under the label “Validation” of the control and depend on the value of “Display Type” under the label “Data”; in the figure you can see a screenshot of the validation of an Edit Box control…
-
Highly divisible triangular number
Read more: Highly divisible triangular numberFrom the Project Euler Problem 12: The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would be: 1, 3, 6, 10, 15, 21, 28, 36, 45,…
-
Largest product in a grid
Read more: Largest product in a gridFrom the Project Euler Problem 11: In the 20×20 grid below, four numbers along a diagonal line have been marked in red. 08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08 49 49 99 40 17 81 18 57 60 87 17 40 98…