Function to return the count of sequences of length K having alet terms divisible by its preceding term
function countSeq ( N , K ) { let i , j , k ; let dp = new Array ( 109 ) ; for ( let i = 0 ; i < dp . length ; i ++ ) { dp [ i ] = new Array ( 2 ) ; } for ( i = 1 ; i <= N ; i ++ ) {