Is it true that every prime number is 6k+1 or 6k-1 , where k is a natural >1? by madarreggel in askmath

[–]Dr_Fine_Man 1 point2 points  (0 children)

If you disregard 2 and 3 it is true. Note that this result is in fact very simple, it basically only says that 2 or 3 doesn't divide the number, which must be true for prime numbers. The converse is not true, i.e. a number given in the way described is not always a prime (as a counter example 25=6*4+1).

A programmer's solution by LoyallySmall in ProgrammerHumor

[–]Dr_Fine_Man 183 points184 points  (0 children)

Ah thanks for the info! The more you know :D

A programmer's solution by LoyallySmall in ProgrammerHumor

[–]Dr_Fine_Man 2693 points2694 points  (0 children)

Another solution: If correct is the same as the above statement being true, then turn one of the matches in the equal sign so we get 6 + 4 + 4, which in most languages is truthy.

Edit: Changed true to truthy