= 5 ) ? 5 : $ichien % 5; // あり得る場合だけ出力 for( $i = 1; $i <= $max; $i++ ){ if( $i % 5 <= $komakaino ){ printf( "%d\n", $i ); } }