# Tag Info

### Determine repeating number of a given number and corresponding position

If you have Mma version >= 10.1 , this does the job : ...
• 18.2k

### How to total the amount of zeros in a binary matrix

ClearAll[countZ] countZ = 1 ## & @@ Dimensions @ # - Total[#, 2] &; countZ@binarym 17 Timings: ...
• 392k
Accepted

### How do I count the number of elements in a list which are between two determined values?

n = 10000; list = RandomReal[{0, 1}, n]; a = 0.3; b = 0.6; UnitStep[list - a].UnitStep[b - list]

• 46.9k

### Determine repeating number of a given number and corresponding position

This one's just for fun, kind of a reverse-codegolf ...
• 67.9k
Accepted

### Count does not tally with total

It's because each time you Count (that is, for each element of Range[6]) you're creating a new array of ...
• 5,424

### Loop over a list of strings and increment letter count in a corresponding sublist

I can propose two things that speed up the letter counting tremendously: 1.) Use ToCharacterCode to convert your strings to packed arrays of integers. 2.) Use a ...
Accepted

### How can I get the count of how many times a string appears in my list?

You can try Tally lst = {"aa bb", "cc dd", "aa bb", "aa bb", "cc dd", "ww ss", "ss ss", "kk mm"}; Tally[lst] Edit by ...
• 142k

### Program that can count deficient numbers

Count[ILDDeficientNumberQ /@ Range[100], True] 76 Alternatively, you can use DivisorSigma[1, n] or ...
• 392k

### Values of counting functions

You can use SparseArray and Accumulate to assemble a vector cvec so that ...
Accepted

...
• 49k
Accepted

### Repeated consecutive values above a threshold

Fundamental operation: ...
• 137k

### Loop over a list of strings and increment letter count in a corresponding sublist

You can use LetterCounts as follows: ...
• 392k

### Count number of occurences of particular numbers in list

res = Lookup[Counts[napajecky], Range[5, 80, 5], 0] {7, 8, 12, 3, 6, 7, 2, 1, 0, 1, 0, 0, 0, 0, 0, 0}
• 20.2k

### Program that can count deficient numbers

From Wikipedia In number theory, a deficient number or defective number is a number n for which the sum of divisors σ(n)<2n Therefore ...
• 142k

### Count for SparseArray`

saCount[s_SparseArray, a_] := Block[{v = s["NonzeroValues"] }, Count[v, a] + If[a == s["Background"], Times @@ Dimensions[s] - Length@v, 0]] saCount[a, 0] <...
• 392k

### How do I count zeros in sublists?

Try this example matrix=RandomInteger[1,{5,5}] returns this {{0,1,0,1,1},{0,1,0,0,1},{1,0,1,0,1},{1,1,1,0,0},{0,0,0,1,0}} ...
• 11.9k

### Determine repeating number of a given number and corresponding position

You could use Position[] and Split[_, #2 - #1 == 1 &] ...
• 605

### Determine repeating number of a given number and corresponding position

It seems that I'm late to the party, yet another one-liner: Thread[{Most@Prepend[Accumulate@# + 1, 1], #}][[3/2-data[[1]]/2;; ;; 2]] &[Length /@ Split@data]
• 9,558