For questions regarding counting the number of occurrences of some characteristic.

learn more… | top users | synonyms

-1
votes
11answers
499 views

Count the unique fractions with only integers

Count the number of unique fractions with numerators and denominators from 1 to 100, and print the counted number. Example: 2/3 = 4/6 = ... Rules: You must actually count in some way. Only integers ...
11
votes
38answers
2k views

Count occurrences of an integer

Based on the question How many positive integers < 1,000,000 contain the digit 2?. I'm looking for the most creative solution to count all the Integers from X to Y containing the Integer Z. Z can ...
12
votes
33answers
2k views

Display number of occurrences for every character in an input string

The code should take a string as input from keyboard: The definition of insanity is quoting the same phrase again and again and not expect despair. The output should be like this(not sorted in any ...
0
votes
8answers
460 views

Create a programs that counts the 0's in numbers from 0 to a billion [duplicate]

This will be my very first post on stackexchange so bear with me. Create a program that counts from 0 to 1,000,000,000. Now the trick is to not print all these characters but to only print how many ...
-4
votes
6answers
246 views

Return the number of digits in any given number [closed]

Objective Given any terminating, rational number, return the number of digits the number contains. Do not count zeros if they're the last digits. Examples 0 returns 1 -1 returns 1 6.23 returns 3 ...
6
votes
6answers
548 views

Count the number of cyclic words in an input

Cyclic Words Problem Statement We can think of a cyclic word as a word written in a circle. To represent a cyclic word, we choose an arbitrary starting position and read the characters in ...
5
votes
4answers
452 views

Convert from binary to unary in 7x7 Manufactoria

In the game manufactoria, take in a binary number and output that number of red pieces. The catch? The board-size is only 7x7: Here's the manufactoria code for the problem: ...
5
votes
8answers
493 views

Square-free semiprime counting

Definition A square-free semiprime is a natural number that is the product of two distinct prime numbers. The task Given a natural number n, count all square-free semiprimes less than or equal ...