72
6
For a while now, I've been running into a problem when counting on my fingers, specifically, that I can only count to ten. My solution to that problem has been to count in binary on my fingers, putting up my thumb for one, my forefinger for two, both thumb and forefinger for three, etc. However, we run into a bit of a problem when we get to the number four. Specifically, it requires us to put up our middle finger, which results in a rather unfortunate gesture, which is not typically accepted in society. This type of number is a rude number. We come to the next rude number at 36, when we raise the thumb on our second hand and the middle finger of our first hand. The definition of a rude number is any number that, under this system of counting, results in us putting up only the middle finger of any hand. Once we pass 1023 (the maximum number reachable on one person, with two hands of five fingers each), assume we continue with a third hand, with additional hands added as required.
Your Task:
Write a program or function that receives an input and outputs a truthy/falsy value based on whether the input is a rude number.
Input:
An integer between 0 and 109 (inclusive).
Output:
A truthy/falsy value that indicates whether the input is a rude number.
Test Cases:
Input: Output:
0 ---> falsy
3 ---> falsy
4 ---> truthy
25 ---> falsy
36 ---> truthy
127 ---> falsy
131 ---> truthy
Scoring:
This is code-golf, so the lowest score in bytes wins.
43
assume we continue with a third hand
, When it comes to being rude, teamwork makes the dream work. – Veskah – 2019-02-27T03:24:40.2175@Veskah turns out that for the bounds of the question, you only need 3 people to make any given number. Sure beats the old kind of counting on fingers. – Gryphon – 2019-02-27T03:26:57.363
Also, I don't have the time at the moment, but if anyone could figure out an equation for this sequence, that'd be great. – Gryphon – 2019-02-27T03:30:03.793
12It's worse if you're British - 6 is rude too then! – Matthew – 2019-02-27T07:07:48.510
1Is it OK to take input in a different base than 10? – wastl – 2019-02-27T20:08:12.470
25 seems fairly rude too. Not sure anyone would say "Oh she had her thumb out, that's perfectly polite" – ale10ander – 2019-03-01T01:43:15.897
1@Matthew 6 is a lot worse than 4 ... (upvoted your comment so it wouldn't be considered rude in the uk) – Tom Tanner – 2019-03-01T11:42:24.160
and 18 means 'cuckold'.... – Tom Tanner – 2019-03-01T11:44:19.313
1I wouldn't have even thought to convert to base 32. These answers are clever. – Kyle Delaney – 2019-03-01T17:49:22.697
Is there an OEIS for this? – MickyT – 2019-03-04T03:49:36.877
@MickyT No. At least currently no. – tsh – 2019-03-04T05:12:35.697