-
Running a fortran program from java
Read more: Running a fortran program from javaIn this post I write an example about how to launch a fortran executable form a java program passing some arguments and getting back a result. The chosen example uses code written in fortran to get primes, it is from Sieve of Eratosthenes.
-
Getting the variables of the outer class from an inner class
Read more: Getting the variables of the outer class from an inner classThe inner classes, and then not static, can access even if with some limitation to the variables of the outer class.
-
Truncatable primes
Read more: Truncatable primesProject Euler Problem 37: The number 3797 has an interesting property. Being prime itself, it is possible to continuously remove digits from left to right, and remain prime at each stage: 3797, 797, 97, and 7. Similarly we can work from right to left: 3797, 379, 37, and 3. Find the sum of the only…
-
Double-base palindromes
Read more: Double-base palindromesFrom the Project Euler Problem 36: The decimal number, 585 = 10010010012 (binary), is palindromic in both bases. Find the sum of all numbers, less than one million, which are palindromic in base 10 and base 2. (Please note that the palindromic number, in either base, may not include leading zeros.) checked
-
Circular primes
Read more: Circular primesFrom the Project Euler Problem 35: The number, 197, is called a circular prime because all rotations of the digits: 197, 971, and 719, are themselves prime. There are thirteen such primes below 100: 2, 3, 5, 7, 11, 13, 17, 31, 37, 71, 73, 79, and 97. How many circular primes are there below…
-
Digit factorials
Read more: Digit factorialsFrom the Project Euler Problem 34: 145 is a curious number, as 1! + 4! + 5! = 1 + 24 + 120 = 145. Find the sum of all numbers which are equal to the sum of the factorial of their digits. Note: as 1! = 1 and 2! = 2 are not sums…
-
Digit canceling fractions
Read more: Digit canceling fractionsFrom the Project Euler Problem 33: The fraction 49/98 is a curious fraction, as an inexperienced mathematician in attempting to simplify it may incorrectly believe that 49/98 = 4/8, which is correct, is obtained by cancelling the 9s. We shall consider fractions like, 30/50 = 3/5, to be trivial examples. There are exactly four non-trivial…