#Java 7, 47 bytes int c(double n){return n>1?1+c(Math.log(n)):0;} **Ungolfed & test cases:** [Try it here.](https://ideone.com/emhVB8) class Main{ static int c(double n){ return n > 1 ? 1 + c(Math.log(n)) : 0; } public static void main(String[] a){ System.out.println(c(0)); System.out.println(c(1)); System.out.println(c(2)); System.out.println(c(3)); System.out.println(c(4)); System.out.println(c(15)); System.out.println(c(16)); System.out.println(c(3814279)); System.out.println(c(3814280)); } } **Output:** 0 0 1 2 2 2 3 3 4