text:
Is this number a repdigit?
Challenge
A repdigit is a non-negative integer whose digits are all equal.
Create a function or complete program that takes a single integer as input and outputs a truthy value if the input number is a repdigit in base 10 and falsy value otherwise.
The input is guaranteed to be a positive integer.
You may take and use input as a string representation in base 10 with impunity.
Test cases
These are all repdigits below 1000.
1
2
3
4
5
6
7
8
9
11
22
33
44
55
66
77
88
99
111
222
333
444
555
666
777
888
999

A larger list can be found on OEIS.
Winning
The shortest code in bytes wins. That is not to say that clever answers in verbose languages will not be welcome.

Related.

@AidanF.Pierce What's the biggest number the input will be?

Brachylog, 1 byte
=

Try it online!
This acts on integers.
From src/predicates.pl#L1151:
brachylog_equal('integer':0, 'integer':0, 'integer':0).
brachylog_equal('integer':0, 'integer':I, 'integer':I) :-
    H #\= 0,
    integer_value('integer':_:[H|T], I),
    brachylog_equal('integer':0, [H|T], [H|T]).

I've decided to accept this one because it's the earliest 1-byte submission.

C (gcc), 33 30 29 bytes
f(n){n=n%100%11?9/n:f(n/10);}

Try it online!

Very nice trick with the recursion and assignment instead of return (think I'm going to steal the latter for my answer :) ).

@Doorknob Go ahead. :) You'll have to specify a compiler though; I expect this to be pretty much gcc/tcc only.

Did you know beforehand that gcc with -O0 will write final result to n from exactly eax, so as to make it the return value? Could you elaborate on the logic why you knew it would work?

@Ruslan I'm not sure why gcc behaves like this, but the last variable assignment inside a function winds up in eax more often than not. If I had to guess, I'd say it's because it allows return n to be a nop, and there's no reason to assign to a local variable at the end of a function if you're not going to return the result.

COBOL, 139 BYTES
I feel like COBOL doesn't get any love in code golfing (probably because there is no way it could win) but here goes:
IF A = ALL '1' OR ALL '2' OR ALL '3' OR ALL '4' OR ALL '5' OR
ALL '6' OR ALL '7' OR ALL '8' OR ALL '9' DISPLAY "TRUE" ELSE
DISPLAY "FALSE".

A is defined as a PIC 9(4).

You can golf this by changing TRUE and FALSE to 1 and 0 respectively

05AB1E, 1 byte
Ë

Checks if all digits are equal
Try it online!

Python 3, 25, 24 19 bytes.
len({*input()})>1>t

A stdin => error code variant.
Returns error code 0 if it's a repdigit - or an error on failure.
Thanks to Dennis for helping me in the comments.

Since exit code 0 indicates success, I think you should test >1 rather than <2. Raising an actual error would be shorter than using exit btw.

I was wondering about that. The challenge says "a truthy value". I'll change it to raise an error.

Yes, if python3 repdigit.py; then echo truthy; else echo falsy; fi has to work according to out definition, so 0 is truthy and everything else is falsy.

That makes sense. Ok I'll make that change too.

<2 or t was correct as t is only referenced if the comparison is false. >1 and t would also work, but len(set(input()))>1>t is shorter. Also, in Python 3.5+, set(input()) can become {*input()}. https://tio.run/##HY3BCsMgEETP8Sv2ppYelN4Czb8Ys22FdBXdQELot1vNZWBmeDPp4E@kR/VxQXiClLKuSOq8BUobK/3Tk524tlyIV8xAEAiyozcqewdrjNGjGDgfTYeLaSur@86LG6FwVqRbgTt61S@6STkQXznuHhN3MrlS6h8

Good points. Thanks for your help - I've updated it again.

@Dennis What does the * do?

@Arc676 Unary * unpacks an iterable. For example, {*'123'} generates the set {'1','2','3'}.

If you change it to "exit code 0 = failure" (which kind of makes more sense, since 0 is a falsey value) you can shorten it to [*{*input()}][1] which is only 16 bytes.

@mypetlion - a good idea, but the rules seem pretty set on that one (I think it's well justified in the above comments). Can you think of a way to shorten it but with the current behaviour?

Mathematica, 27 bytes
AtomQ@Log10[9#/#~Mod~10+1]&

It doesn't beat Equal@@IntegerDigits@#&, but it beats the other arithmetic-based Mathematica solution.
Repdigits are of the form n = d (10m-1) / 9 where m is the number of digits and d is the repeated digit. We can recover d from n by taking it modulo 10 (because if it's a rep digit, it's last digit will be d). So we can just rearrange this as m = log10(9 n / (n % 10) + 1) and check whether m is an integer.

Haskell, 15 bytes
all=<<(==).head

Try it online! Takes string input.
Equivalent to \s->all(==head s)s. Narrowly beats out alternatives:
f s=all(==s!!0)s
f s=s==(s!!0<$s)
f(h:t)=all(==h)t
f(h:t)=(h<$t)==t
f s=(s<*s)==(s*>s)
f(h:t)=h:t==t++[h]

f s=(s<*s)==(s*>s) is a very interesting idea, I wasn't aware of this behaviour of <*before.

Slashalash, 110 bytes
/11/1//22/2//33/3//44/4//55/5//66/6//77/7//88/8//99/9//1/.//2/.//3/.//4/.//5/.//6/.//7/.//8/.//9/.//T..///.//T

Try it online!
The /// language doesn't have any concept of truthy and falsey, so this outputs "T" if the input is a repdigit, and does not output any characters if the input is not a repdigit.

PHP, 25 28 25
<?=!chop($argn,$argn[0]);

remove all chars from the right that are equal to the first and print 1 if all chars were removed.

Jelly, 2 1 byte
E

Try it online!

Umm...do 1-9 count as repdigits?

According to the OP's answer, yes. Wolfram and OEIS agree.

C (gcc), 41 bytes
f(char*s){s=!s[strspn(s,s+strlen(s)-1)];}

This is a function that takes input as a string and returns 1 if it is a repdigit and 0 otherwise.
It does this by making use of the strspn function, which takes two strings and returns the length of the longest prefix of the first string consisting of only characters from the second string. Here, the first string is the input, and the second string is the last digit of the input, obtained by passing a pointer to the last character of the input string.
Iff the input is a repdigit, then the result of the call to strspn will be strlen(s). Then, indexing into s will return a null byte if this is the case (str[strlen(str)] is always \0) or the first digit that doesn't match the last digit otherwise. Negating this with ! results in whether s represents a repdigit.
Try it online!
Thanks to @Dennis for indirectly reminding me of the assign-instead-of-return trick via his insanely impressive answer, saving 4 bytes!

You can shorten this a bit further by avoiding strlen and creating a new string from *s: c;f(char*s){c=*s;c=!s[strspn(s,&c)];} for 37.

R, 31 bytes
function(x)grepl("^(.)\\1*$",x)

This functions works with string inputs and uses a regular expression to determine whether the input is a repdigit.
Example
> f <- function(x)grepl("^(.)\\1*$",x)
> x <- c("1", "2", "11", "12", "100", "121", "333")
> f(x)
[1]  TRUE  TRUE  TRUE FALSE FALSE FALSE  TRUE

28 bytes by switching from function(x) to using scan(,'') tio.run/##K/r/P70otSBHQylOQ08zJsZQS0VJpzg5MU9DR11dU/O/paXlfwA

Regex (ECMAScript), 31 bytes
^(x{0,9})((x+)\3{8}(?=\3$)\1)*$

Try it online!
Takes input in unary, as usual for math regexes (note that the problem is trivial with decimal input: just ^(.)\1*$).
Explanation:
^(x{0,9})           # \1 = candidate digit, N -= \1
(                   # Loop the following:
  (x+)\3{8}(?=\3$)  # N /= 10 (fails and backtracks if N isn’t a multiple of 10)
  \1                # N -= \1
)* $                # End loop, assert N = 0

Try it online!

@Deadcode Whoops I forgot to put that in, thanks!

C#, 42 33  28 bytes
i=>i.Replace(i[0]+"","")==""

i has to be a string.
Shaved down a lot thanks to @LethalCoder

i[0].ToString() can be shortened to i[0]+"", <1 is shorter than ==0.

Also .Length<1 can just be ==""

APL, 5 bytes
2 bytes saved thanks to @KritixiLithos
⍕≡1⌽⍕

Try it online!

You can golf the 7-byte solution to 5 bytes by using a train ⊢≡1⌽⊢.

@KritixiLithos thanks!

Replace ⊢ with ⍕ to handle both strings and numbers.

@Adám thanks! I didn't think of formatting as a way of getting array of digits.

Octave, 11 bytes
@(s)s==s(1)

Try it online!
Takes the input as a string.
It checks all characters for equality with the first characters. If all are equal, the result will be a vector with only 1 (true in Octave), otherwise there will be at least one 0 (false in Octave).
Here's a proof.

Wouldn't you need to wrap it in all(...) to get a truthy/falsy value output?

Did you test the proof? That's piece of code is the  definition (meta consensus) of true/false on ppcg.

grep, 17 bytes
grep -xP '(.)\1*'

Matches any string that's a repetition of its first character.

I think this would be bash.

In what way, @S.S.Anne?  There's nothing in that command that isn't valid portable shell.

Well, any shell. I didn't mean specifically bash.

JavaScript (ES6), 23 21 bytes
Saved 2 bytes thanks to Neil
Takes input as either an integer or a string. Returns a boolean.
n=>/^(.)\1*$/.test(n)

Demo

let f =

n=>/^(.)\1*$/.test(n)

console.log(f(444))
console.log(f(12))

Doesn't usingtest instead of !!exec save 2 bytes?

(Although, for a string-only input, porting the PHP answer is even shorter.)

@Neil I don't know what I was thinking. Thanks!

Japt, 4 bytes
¥çUg

Try it online!

Braingolf, 6 bytes
iul1-n

Try it online!
Unfortunately, Braingolf's implicit input from commandline args can't accept an all-digits input as a string, it will always cast it to a number, so instead the solution is to pass it via STDIN, which adds 1 byte for reading STDIN (i)
Explanation:
iul1-n
i       Read from STDIN as string, push each codepoint to stack
 u      Remove duplicates from stack
  l     Push length of stack
   1-   Subtract 1
     n  Boolean negate, replace each item on stack with 1 if it is a python falsey value
        replace each item on stack with 0 if it is a python truthy value
        Implicit output of last item on stack

After u, the length of the stack equals the number of unique characters in the input, subtracting 1 means it will be 0 if and only if there is exactly 1 unique character in the input, 0 is the only falsey number in Python, so n will replace 0 with 1, and everything else with 0.

Ohm, 4 bytes
Ul2<

Try it online!
Explanation
 Ul2<
 U    # Push uniquified input
  l   # Length
   2< # Is it smaller than 2?

I think Ul≤should work.

@Christoph Yee I had that but I wasn't sure if 0 counts as a truthy value. (Quite new to this codegolf thing ^^)

Ah damn 0 is falsey and every other number is truthy. I just noticed that we need exactly the opposite for this challenge (often we're allowed to swap as long as we declare which case is truthy and which is falsey). Truthy is defined by "would take a brench".

Ul1E should also work (though I don't know Ohm) because it doesn't need to handle 0.

Java, 38 33 23 bytes
n->n.matches("(.)\\1*")

n is a String, naturally.
Note that there is no need for ^...$ in the regex since it's automatically used for exact matching (such as the match method), compared to finding in the string.
Try it!
Saves

-5 bytes: used String since "You may take and use input as a string with impunity."
-10 bytes: regex is apparently a good fit.

Was about to post this exact solution, including the explanation about the matches not requiring ^$ because it matches the entire String. So a definite +1 from me. ;)

Java, 21 bytes:
l->l.toSet().size()<2

l is a MutableList<Character> from eclipse collections.

l could also be a CharAdapter.

@DonaldRaab oooh, I've never seen that class.  Nice find.

There is CodePointAdapter and CodePointList as well.

@DonaldRaab I use eclipse collections quite a bit, but I always struggle to find anything outside of the standard List/Map/Set collections.  Is your knowledge based off of development of the libraries, or is there somewhere (other than the javadoc) I can find a better reference for everything EC provides?

Glad to hear it.  I am a committer for the framework... I wrote these particular String related classes a year or so ago. There is a Reference Guide which many folks don't know about.  There is a mind-map I recently put together to help folks learn and navigate through the the plethora of features in the library.  It's the last link in the TOC of the Ref. Guide.  https://github.com/eclipse/eclipse-collections/blob/master/docs/guide.md

There are also a bunch of presentations from conferences and meetups linked from the EC wiki - https://github.com/eclipse/eclipse-collections/wiki/Conference-talks-and-meetups

Kotlin, 28 19 bytes
{it.toSet().size<2}

Try it online!
Takes input as a String because

You may take and use input as a string representation in base 10 with impunity.

Explanation
{
    it.toSet()     // create a Set (collection with only unique entries)
                   // out of the characters of this string
        .size < 2  // not a repdigit if the set only has one entry
}

If you don't like the fact it takes a String, you can have one that takes an Int for 24 bytes.
{(""+it).toSet().size<2}

Neim, 1 byte

Simply checks that all elements are equal.
Without builtin, 2 bytes:

Explanation:
     Calculate unique digits
     Get the length

This works because only 1 is considered truthy in Neim, and everything else is falsy.
Alternatively, for 4 bytes:
μ

Explanation:
      Calculate unique digits
       Join list into an integer
      Check that is is less than
  μ    Ten.

Try it!

PHP, 30 bytes
<?=($a=$argn).$a[0]==$a[0].$a;

@Dada No. It will compare 4344 and 4434.

Oh right, my bad. thanks

QBasic 4.5, 55 bytes
INPUT a
FOR x=1TO LEN(STR$(a))
c=c*10+1
NEXT
?a MOD c=0

I've mathed it! The FOR-loop checks the number of digits in the input, then creates c, which is a series of 1's of length equal to the input. A number then is repdigit if it modulo the one-string == 0.
Try it online! Note that the online interpreter is a bit quirky and I had to write out a couple of statements that the DOS-based QBasic IDE would expand automatically.

C, 38 bytes
f(char*s){return*s^s[1]?!s[1]:f(s+1);}

Recursively walks a string.  If the first two characters differ (*s^s[1]) then we succeed only if we're at the end of the string (!s[1]) otherwise we repeat the test at the next position (f(s+1)).
Test program
#include <stdio.h>
int main(int argc, char **argv)
{
    while (*++argv)
        printf("%s: %s\n", *argv, f(*argv)?"yes":"no");
}

R, 25 bytes
grepl("^(.)\\1*$",scan())

Try it online
Best non-regex solution I could come up with was 36 bytes:
is.na(unique(el(strsplit(x,"")))[2])

for another option on the non-regex rle(charToRaw(scan(,'')))$v[2]<1

Cubix, 15 bytes
uOn@ii?-?;.$@<_

Try it online!
    u O
    n @
i i ? - ? ; . $
@ < _ . . . . .
    . .
    . .

Watch It Run
Outputs 1 for truthy and nothing for falsey
Very simply read reads in the input one character at a time.  It takes the current character away from the previous.  If a non zero result then it halts immediately.  Otherwise it continues inputting and comparing until the EOI.  On EOI (-1), negate and exit

MATL (6 5 bytes or 2 bytes for Luis Mendo solution)
Vun1=

Try it online!
Explanation
V     % convert to string
un    % find unique characters and count them
1=    % if there is only one unique character, then we pass.

Luis Mendo solution (see comments):
&=

Outputs a truthy array (all 1's) if repdigit, or a falsy array (some 0 in the array) if not a perfect repdigit.
Try it online!

Since any truthy/falsy outputs are valid, you can use V&=; or j&= to avoid floating-point limitations. Or even &=, since inputting a string is allowed

Hmm, I'm afraid I can't follow. I tried replacing "1=" with "&=" and it didn't work. Also tried "V&=" as the whole code, in case that's what you meant.

I mean just &=. A non-empty array containing only ones is truthy, and an array containing some zero is falsy (see link in my previous comment for explanation about truthy/falsy)

Wow, ok. That's a very simple solution then. Will add.

Excel, 24 bytes (assuming Tab is 1 byte)
=LEFT(B1,1);=A1&B1=B1&A1

Excel, 28 27 bytes
=A1=MID(A1,2,A1)&LEFT(A1,1)

J, 6 bytes
1=#@~.

Try it online!
Take unique elements; does its length equal 1?
/:-:\:

Try it online!
Does ascending sorting order equal descending sorting order?
-:##{.

Try it online!
Does the first element, duplicated to the length, equal the original?
-:1&|.

Try it online!
Does the input, rotated once, equal itself?

brainfuck, 21 bytes
,<,[[>->+<<-]>[>],]>.

With a little formatting:
,<,
[
  [>->+<<-]
  >[>]
  ,
]
>.

Try it online
Prints the repeated digit for true, and NUL for false.
Compares adjacent digits in a loop, and in the case of inequality, shifts pointer so that all subsequent comparisons will also result in inequality, and the cell to the right will be zero upon exiting the loop.
Variant for stricter output rules, 25 bytes
,<,[[>->+<<-]>[>>->],]<+.

Formatted:
,<,
[
  [>->+<<-]
  >[>>->]
  ,
]
<+.

Try it online
This version prints \x01 for true.

Ruby, 13 bytes (12 + '-n' flag)
p~/^(.)\1*$/

Try it online!

Clojure, 17 12 bytes

You may take and use input as a string representation in base 10 with impunity.

Oh in that case:
#(apply = %)

Original:
#(apply =(str %))

Python, 27 22 bytes:
Just to get things started.
lambda x:len(set(x))<2

Converts to a string, converts the string into a set of all distinct characters in that string, and checks whether there aren't multiple elements in the set.
5 bytes saved thanks to @LeakyNun's reminder.

Please specify the version of Python.

@LeakyNun It's not customary to specify a version if the code works in all recent ones.

@Dennis If it is Python 2, I can suggest a golf.

Now that the input specs are more lax, you can replace str(x) with x.

In Python 3.6+ this can be len({*x})<2

Python 3, 23 bytes
lambda s:s==s[0]*len(s)

Try it online!
Not shorter than @shadow's answer, but I thought it was interesting. Should work in Python 2 as well.

QBIC, 36 23 bytes
[_l!:$||p=p*z+1]?b%p=0

Explanation
    :     Read a number from the cmd line
   ! $    cast it to string
 _l   |   Take its length
[      |  And run a FOR-loop from 1 to that length
p=        p starts out as 0. set it to
  p*z       itself multiplied by 10 (z=10 in QBIC) (still 0 on the first run
  +1        then add 1. On consecutive FOR-loops yields 1, 11, 111, ....
]         Close the FOR loop
?b%p=0    PRINT -1 if b mod p is 0 (ie 444 % 111 = 0), or 0 otherwise

C#, 38 bytes
using System.Linq;s=>s.All(c=>c==s[0])

Or alternatively for 44 bytes:
using System.Linq;s=>s.Distinct().Count()==1

I'm no C# developer, but do you really require using System.Linq? I've seen plenty of C# lambda answers without that.

@OlivierGrégoire Linq is required for All, it's like needing an external package in C and requiring to import it. If I am using Linq I must include the using.

><>, 26 24 bytes
!vi:0(?v::&r&=?
 >0n;n1<

Reads the input as a string and reads every character in a loop
  i               // Take the next character and pushes it onto the stack
   :0(?v          // If the end of the input has been reached, goto the successful termination code
        ::        // Duplicate the top of the stack twice
!v         &r&=?  // Pop the top of the stack, pop the bottom of the stack, and compare them. If they are not equal, goto the failure termination code
 >0n;            // Failure termination code. Prints a 0 and terminates
    ;n1<         // Success termination code. Prints a 1 and terminates

Perl 6, 12 bytes
{[==] .comb}

Reduces the list of characters in the input number with the numeric equality operator.

AWK, 33 bytes
BEGIN{FS=""}{$0=NF==gsub($1,"")}1

Try it online!
Replaces all characters in the input with the first character and compares the changed count to the total number of characters.

PowerShell, 23 bytes
"$args"-match'^(.)\1*$'

Save as repdigit.ps1 and run with PS C:\wherever\repdigit.ps1 444, outputs True or False.
If you want the Python len(set(input))==1 style, it costs more at 32 bytes:
@($args-split''|group).count-eq2

(Noting that the split on the space between chars also outputs an empty start and end string as well as the characters).

PHP, 28 bytes
<?=!count_chars($argn,3)[1];

count_chars with mode=3 creates a string with all different characters in $argn.
If there is only one, the second character will be empty == falsy.
Run as pipe with -F.

Smalltalk, 21 19 bytes
[:s|s asSet size<2]

Try it online!
You can execute the block above by sending the message value: to the block with a String.  A String in Smalltalk is written with single quotes.  A longer version of the block could accept an Integer.  It would take 30 28 bytes.
[:i|i asString asSet size<2]

I tried both solutions in the current online version of Amber Smalltalk and Pharo Smalltalk version 6.0.
Thanks to the suggestion in the comments I was able to remove the spaces before and after the <.  It's been many years since I wrote Smalltalk but I doubt I ever tried that in practice.  The shorter version worked in both versions of Smalltalk I tested.

Are the spaces around the < necessary? I haven't used small talk very much, but most languages wont require that sort of thing.

Yes, the spaces are necessary.  The syntax of Smalltalk is Objectmessage.  I was able to remove two spaces before and after the block separator |.

I stand corrected.  I tried removing the spaces before and after the < and it seems to work.

Check, 135 134 132 124 bytes
 [r            #v
#:>10%:]R+r->\#v#?
#v
# >10-\)\#     # ?
d #             ^
 #R:
:>=r,#v
#ddd[=#(:@:@=R-?
d\:!:R *
o>]=d#^

Input should be passed as a command-line argument. Outputs some unprintables for truthy and only zero bytes for falsey. Always terminates with an IndexError due to the fact that it abuses an interpreter bug.
How does it work?
This code is divided into two segments. The first half turns the input integer into a list of digits, and the second half checks that all of its digits are equal to the first digit (i.e. they are all equal).
It roughly corresponds to the following pseudocode:

Read input and call it i.
Create an empty array and store it in the register. ([r)
If i is 0, go to step 13.
Take the number modulo 10. Call it x.
Prepend x to the register and store it back in the register.
Subtract x from i.
Create a counter, starting at 0.
If i is 0, go to step 12.
Increment the counter.
Decrement i by 10.
Go back to step 8.
Set i to whatever value is now in the counter.
Go back to step 3.
Load the register, which is now an array containing the digits of the input. Call this d.
Get the first element in d and store it in the register.
Create a counter called j, initialized to the length of d.
Decrement j.
If the jth element of d is not equal to the value of the register, crash the program. (We found a digit that is not correct.)
Otherwise, print some random junk !j times. This only prints something if j == 0.
Create an array of length 1 and get the !jth element. This will crash the program if j == 0.
If the program has not yet crashed, j must not yet be zero, so go back to step 17.

F#, 38 bytes
let f n=Seq.length(Seq.countBy id n)=1

Try it online!

Julia, 30 bytes
f(n)=length(Set(string(n)))==1

QBasic, 37 32 bytes
INPUT n$
?n$=STRING$(LEN(n$),n$)

-5 bytes thanks to steenbergh
The STRING$ function takes two arguments, a number n and a string s$, and constructs a string consisting of n copies of the first character of s$.* So this code reads our number as a string n$, generates a string consisting of LEN(n$) copies of n$'s first character, and checks to see if it is equal to n$.
* The second argument can also be an integer codepoint, in which case it repeats the character corresponding to that codepoint.

Are you sure you need the ASC? Often QBasic simply takes the 1st char of a string when it expects only 1 char but the string itself is longer. I think, but can't test atm, that this will work fine too: INPUT n$:?n$=STRING$(LEN(n$),n$)

Confirmed on QB4.5: if we input n$ as 123, then STRING$(3, n$) is 111.

@steenbergh [facepalm] I just read that in the help file, too. Thanks!

Pepe, 69 60 bytes
REeErEEEEEREEEeeEREEEEeEeEREEEEEEeREEEeREEEEEerrEEreEErEereE

Try it online!
How it works?
It takes the greatest digit and subtracts it from the least digit. Repdigit numbers always evaluate to 0.
REeE             # Takes a number (stack r)
rEEEEEREEEeeE    # Splits by digits
REEEEeEeE        # Sorts them
REEEEEEe         # Copies first digit to other stack
REEEe            # Move pointer to last in stack r
REEEEEe          # Subtract stack R to stack r
rrEErEEEEErEereE # Print if 0, else none

Whitespace, 96 93 bytes
[S S S N
_Push_0][S N
S _Duplicate][T N
T   T   _Read_STDIN_as_integer][T   T   T   _Retrieve][N
S S N
_Create_Label_LOOP][S N
S _Duplicate][S S S T   T   S S T   S S N
_Push_100][T    S T T   _Modulo][S S S T    S T T   N
_Push_11][T S T T   _Modulo][N
T   S S N
_If_0_Jump_to_label_NEXT][S S S T   S S T   N
_Push_9][S N
T   _Swap_top_two][T    S T S _Integer_division][T  N
S T _Print_as_integer][N
S S S N
_Create_Label_NEXT][S S S T S T S N
_Push_10][T S T S _Integer_division][N
S N
N
_Jump_to_Label_LOOP]

Letters S (space), T (tab), and N (new-line) added as highlighting only.
[..._some_action] added as explanation only.
Port of @Dennis♦' C answer, so also outputs a positive digit ([1,9]) as truthy and 0 as falsey.
Try it online (with raw spaces, tabs and new-lines only).
Pseudo-code:
Integer i = STDIN as integer
Start LOOP:
  If(i modulo-100 modulo-11 == 0):
    i = i integer-divided by 10
    Go to next iteration of LOOP
  i = 9 / i
  Print i to STDOUT as integer
  Stop the program with an error

Pascal (FPC), 81 75 68 bytes
var n:string;begin read(n);write(n=StringOfChar(n[1],length(n)))end.

Try it online!
It seems that taking a number as string is shorter.

75 bytes - taking the number as integer:
Thanks to @Ørjan Johansen for -6 bytes - mod 100 mod 11 trick
var n:word;begin read(n);while n mod$64mod$B=0do n:=n div$A;write(n<=9)end.

Try it online!
$64, $B and $A are hexadecimal constants, they eliminate some whitespace that would be needed for their decimal counterparts.

I think you can shave off a bit with the mod 100 mod 11 trick some others are using.

@ØrjanJohansen Thanks, a good one!

Taxi, 730 706 bytes
-24 bytes by eliminating linebreaks.
Clever answer in a verbose language? Check and check.
Go to Post Office:w 1 l 1 r 1 l.Pickup a passenger going to Chop Suey.Go to Chop Suey:n 1 r 1 l 4 r 1 l.Pickup a passenger going to Cyclone.[B]Switch to plan D if no one is waiting.Pickup a passenger going to Crime Lab.Go to Cyclone:n 1 l 3 l.Pickup a passenger going to Crime Lab.Pickup a passenger going to Crime Lab.Go to Crime Lab:n 2 r 2 r.Switch to plan C if no one is waiting.Pickup a passenger going to Cyclone.Go to Fueler Up:n.Go to Chop Suey:n 3 r 1 l.Switch to plan B.[C]0 is waiting at Writer's Depot.Go to Writer's Depot:n 4 l 2 l.Pickup a passenger going to Cyclone.Go to Chop Suey:n 3 r 3 r.[D]Go to Cyclone:n 1 l 3 l.Pickup a passenger going to Post Office.Go to Post Office:s 1 l 2 r 1 l.

Try it online!
Try it online with linebreaks!
Doesn't return to the Taxi Garage after the program ends, so the boss fires me, and it exits with an error.
What this program actually does is checks whether or not the input consists of any repeating character, and outputs that character if it does, or 0 if it doesn't.
Alternative solution, 602 582 541 445 bytes
-20 bytes by eliminating linebreaks.
-41 bytes by having the program error out upon a false result.
-96 bytes by having the program output via error message.
Go to Post Office:w 1 l 1 r 1 l.Pickup a passenger going to Chop Suey.Go to Chop Suey:n 1 r 1 l 4 r 1 l.Pickup a passenger going to Cyclone.[B]Switch to plan C if no one is waiting.Pickup a passenger going to Crime Lab.Go to Cyclone:n 1 l 3 l.Pickup a passenger going to Crime Lab.Pickup a passenger going to Crime Lab.Go to Crime Lab:n 2 r 2 r.Pickup a passenger going to Cyclone.Go to Fueler Up:n.Go to Chop Suey:n 3 r 1 l.Switch to plan B.[C]

Try it online!
Try it online with linebreaks!
This alternative solution errors out with The boss couldn't find your taxi in the garage.  You're fired! if the input is a repdigit, and no outgoing passengers found if the input is not a repdigit (meaning this also works with 0...or 00, or 000...).

For the second program? Sure, I could exit another way.

I know, I made the modification.

Note that a program can output via exit code, so theoretically you could have it crash if not a repdigit and exit normally otherwise instead of outputting

Could it crash in two different ways depending on result?

I think so? Relevant meta, but I don't see any reason not to allow it, since it is easily observable. Edit: ah, I realise it would be two different outputs to STDERR, so you're good

Pepe, 48 bytes
rrEEreeeEEeeeErEeREEeREEREEEEEEErEEEEreErEEEeReE

Outputs 1 if number is a repdigit, nothing otherwise.
Try it online!
Explanation
(for input 45. 52 and 53 are charcodes of digits)
rrEE          # Create label 0, implicitly push 0 to the second stack [] [0]
  reeeEEeeeE    # Print "1"
rEe           # Return

REEe          # Start: Take input as charcodes to the first stack [52,52,53] [0]
REE           # Create label I (1)
  REEEEEEE      # Move first item in first stack to the other [52,53] [0, 52]
  rEEEE         # Reset second stack pointer position [>52, 53] [>0, 52]
  reE           # If item in first stack equals the first item in the second stack (0),
                #   call label 0. It will only be true if first stack is empty
                #   because it will implicitly give 0.
rEEEe           # Move second stack pointer to the end [>52, 52] [0, >52]
ReE           # Repeat if items are the same (52 == 52), end program otherwise
reeeEEeeee    # Optional: Print 0.

naz, 50 bytes
2a2x1v1r2x2v1x1f1r3x1v2e3x2v1e0m1o0x1x2f0m1a1o0x1f

Works for any input integer, provided it's passed as a file terminated with the control character STX (U+0002).
Explanation (with 0x commands removed)
2a2x1v                 # Set variable 1 equal to 2
1r2x2v                 # Read the first byte of input and store it in variable 2
1x1f                   # Function 1
    1r                 # Read a byte of input
      3x1v2e           # Jump to function 2 if it equals variable 1
            3x2v1e     # Jump back to the start of the function if it equals variable 2
                  0m1o # Otherwise, output 0
1x2f                   # Function 2
    0m1a1o             # Output 1
1f                     # Call function 1

Pip, 3 bytes
$=a

fold by equality.
Try it online!

Swift (24 / 17 bytes)
Console App (24 bytes):
Set(readLine()!).count<2

Function (17 bytes):
{Set($0).count<2}

Usage example:
let isRepdigit: (String) -> Void = {Set($0).count<2}
print(isRepdigit("234")) // prits false
print(isRepdigit("66666")) // prints true

Vyxal, 1 byte
≈

Try it Online!
Simply checks if all the digits are equal to each other

Scratch 3.0, 20 blocks/148 bytes

define(z)
set[o v]to(1
set[i v]to(1
repeat(length of(z)
if <not<(letter(i)of(z))=(letter(1)of(z))>>then
set[o v]to(0
end
set[i v]to((i)+(1
end
say(o

Try it on Scratch
I did the most logical thing and answer this with scratch. Essentially, we loop through every character and see if it equals the first character. If any character doesn't equal the first, the output is set to falsey

JavaScript (Node.js), 26 27 bytes
(Solutions without regex. They all take input as a string. Luckily for some of them, OP guaranteed that the input can't be zero)

-1 byte thanks to @Shaggy

Checking that there is no character different from the first :
s=>![...s].some(c=>c-s[0])

Try it online!

Checking that every character is the same as the first (27 bytes) :
s=>[...s].every(c=>c==s[0])

Checking that the parameter is equal to the first character repeated parameter.length times (27 bytes) :
s=>s==s[0].repeat(s.length)

Checking that the parameter divided by its first character is equal to 1 repeated parameter.length times (31 bytes) :
s=>s/s[0]=="1".repeat(s.length)

More mathematical ways (could probably be a lot shorter in other languages ?) :

There is a special rule that only repdigits follow.
For example, 4444 +1 in base 4+1 gives 10000 in the same base, and we can recognize this particular pattern (still without using regex).

Using the same example, checking that 10000 (made from concatenation and repetition) from base 4+1 to base 10, minus 4444 (the parameter) with same base conversion, gives exactly 1. The 4 for the base conversion comes from the first character of the parameter (63 bytes) :
s=>parseInt(1+"0".repeat(s.length),a=s[0]*1+1)-parseInt(s,a)==1

Using the same example, checking that 4444 (the parameter) from base 4+1 to base 10, plus 1, converted back to its original base, gives a number that when inverted from right to left (to get rid of the previously trailing zeroes), is exactly 1. The 4 for the base conversion comes from the highest digit of the parameter (76 bytes) :
s=>[...(parseInt(s,a=Math.max(...s)+1)+1).toString(a)].reverse().join``*1==1

26 bytes

@Shaggy Nice one! A colleague told me nearly the same thing about !none but i didn't think about the subtraction. For now i'll add it to my solutions with full credits to you, but if you want to post it as your own answer, don't hesitate to tell me and i'll remove it :)

It's a simple golf of your 27 byte solution.

Rockstar, 76 bytes
listen to N
cut N
roll N in D
O's 1
while N and O
let O be D's roll N

say O

Try it (Code will need to be pasted in)

Arturo, 15 bytes
$->x[{}=x--x\0]

Try it!
$->x[       ; a function taking an input x
    {}=     ; is the empty string equal to...
    x--x\0  ; x without its first element
]           ; end function

Thunno 2, 1 byte
ạ

Attempt This Online!
Built-in that works on numbers.

Tcl, 53 bytes
proc r n {expr 1==1[string trim $n [string in $n 0]]}

"string trim" removes leading and trailing occurrences of all its second argument's characters from its first argument (usually used for whitespace). Second argument here is the first digit of $n. For a repdigit an empty string remains, and attaching that to 1 remains 1. For number 42424, 242 would remain after the trim, so 1 is not equal to 1242.
PS: attaching to 1 is a golfing-thing that saved two bytes versus comparing the trim with empty string.

Pyke, 3 bytes
}t!

Try it here!
}   -   uniquify(input)
 t  -  ^[:-1]
  ! - not ^

Noether, 39 bytes
""~bI~aL(ai/~c{bc/}{}{bc+~b}i1+~i)bL1=P

Try it here!
It takes input as a number enclosed in quotation marks.
This works by looping through the input string, and, at the start, adding the first character to the string, B. As it loops, if the current character in the input isn't in B, it is appended to B. At the end, if the number is a repdigit, B will only be one character long.
Outputs 1 for true, 0 for false.

PHP, 34 bytes
<?=preg_match('#^(.)\1*$#',$argn);

Try it online!

Cheddar, 16 bytes
s->s.len*s[0]==s

Try it online!
Integer input, 29 bytes
n->(s->s.len*s[0]==s)("%d"%n)

Try it online!

Excel, 31 bytes
=MOD(A2,10)*(10^LEN(A2)-1)/9=A2

V, 13 bytes
ylÍ"/.
ñ/ä
d

Try it online!
Leaves a string of .s if truthy, nothing if falsy (empty strings are truthy in Vim/V and vice versa)

V, 6 bytes
ø^ˆ±*$

Try it online!
Hexdump:
00000000: f85e 88b1 2a24                           .^..*$

This uses a brand new operator that I haven't used in any PPCG answers before. The ø operator will count the number of matches of a given regex. In this case, the (compressed) regex is:
/^\(.\)\1*$/

That is, any character at the start of the line, followed by only that character until the end of the line.

Swift , 53 Bytes
var s=readLine()!,r=Set(s.characters);r.count>1 ?0:1

TI-BASIC, 17 16 bytes
log(1+.9X/fPart(.1X:Ans=int(Ans

Takes input on X. TI-BASIC is token based, all tokens are one byte.

CJam, 6 bytes
qL|,1=

Explanation:
q  e# Get the input: "1311211"
L| e# Get unique elements: "132"
,  e# Length: 3
1= e# Equal to 1: 0 (false)

Batch, 177 bytes
@echo off
set s=
set z=
<nul set/p=.%1>t
for /f "usebackq" %%G in ('t')do set z=%%~zG
for /l %%G in (2,1,%z%)do call set s=1%%s%%
set/ar=%1%%%s%
if %r%==0 echo %r%&exit/b
echo 1

Not properly golfed, yet.

Replace @echo off with @ in front of every command. Furthermore, there is no need for "" around usebackq, which can be abbreviated to useback, which shaves another 5 bytes off.

Pushy, 5 bytes
sK=P#

Try it online!
                                              Falsy Example:      Truthy Example:
       \ Implicit: Input on stack             [22121]             [5555]
s      \ Split into digits                    [2, 2, 1, 2, 2]     [5, 5, 5, 5]
 K=    \ Pop last, compare with all others    [1, 1, 0, 1]        [1, 1, 1]
   P#  \ Print the stack's product            PRINT: 0            PRINT: 1

6 bytes
I prefer this method as it's sweet and simple, but unfortunately it's one byte longer:
suLtn#

Try it online!
        \ Implicit: Input on stack
s       \ Split into digits
 u      \ Make stack into a set of itself
  Lt    \ Get the stack length - 1
        \ This will be 0 for a valid repdigit, a positive value otherwise
    n   \ Boolean negate: this maps 0 -> 1, and everything else to 0.
     #  \ Print result.

Tcl, 48 bytes
proc R n {expr 1[regsub -all ^(.)\\1* $n ""]==1}

Try it online!

Tcl, 52 bytes
proc R n {expr [llength [lsort -u [split $n ""]]]<2}

Try it online!

><>, 12 bytes
1l2=?n@:}=*!

Try it online!
Takes input through the -s flag and checks whether every digit is the same.

Pari/GP, 21 bytes
n->#Set(digits(n))==1

Try it online!

SmileBASIC 3, 26 bytes
INPUT N$?N$[0]*LEN(N$)==N$

Takes input as a string, prints 0 for false and 1 for true. If we repeat the first character of the input length(input) times and that is equal to the input, then it's a repdigit.

PHP, 42 Bytes
Try it online
(42 Bytes because i forgot Towel day on may 25)
Code
<?=!(($a=$argv)%str_repeat(1,strlen($a)));

Explanation
Every number like 11, 22222,5555555555 always will be dvisible by 1 times the number length it just checks that, if the % between the numbers is 0 outputs 1 else empty.

Forth (gforth), 87 bytes
: m 10 /mod swap ; : f 1 swap m >r begin ?dup 0> while m r@ = rot * swap repeat rdrop ;

Try it online!
Explanation
The algorithm is approximately:

Divide by 10, take remainder and store on return stack
Repeatedly divide by 10 and compare remainder to stored value
When quotient equals 0, stop loop and clean return stack

Code Explanation
: m 10 /mod swap ;        \ helper to grab the quotient and remainder after dividing by 10

1 swap                    \ place 1 as a result value on the stack and move to the bottom
m >r                      \ divide by 10 and place remainder on the return stack
begin                     \ start an indefinite loop
  ?dup 0>                 \ duplicate if not equal to 0 and check if greater than 0
while                     \ if greater than 0 execute loop body, else go the end of the loop
  m r@ =                  \ divide by 10, check if remainder equals our check value
  rot *                   \ move the result value to the top and multiply by result
  swap                    \ move the result value back to the boottom
repeat                    \ end the loop body
rdrop                     \ clean the return stack

Pyth, 4 3 bytes
!t{

Try it online!
-1 thanks to Erik the Outgolfer!
Takes input as a string.

You don't need l.

@EriktheOutgolfer huh. Not how i expected t to behave, but certainly useful. Thanks!

Some of Pyth's built-ins are type-overloaded.

APL(NARS), 16 chars, 32 bytes
{(⍴w)=+/w=↑w←⍕⍵}

test:
  {(⍴w)=+/w=↑w←⍕⍵}¨1 2 23 33 93 9999999
 1  1  0  1  0  1

MathGolf, 3 bytes
▀£┴

Try it online!
Takes input as a string.
Explanation:
▀    Get unique characters
 £   Get length of list
  ┴  Is equal to one?

Pyt, 2 bytes
ą≡

Try it online!
Explanation:
   Implicit input
ą  Split digits
 ≡ Are all elements equal?

Stax, 4 bytes
ë@╛α

Run and debug it
Unpacked
Eu%v!

EuD! is 3 when packed

Prolog, 43 bytes
f(N,D):-N==0;O is N//10,D is N-O*10,f(O,D).

Run the query with f(666,D) (or whatever other number you have). If it's a repdigit, it will return a value for D, otherwise, it will return false.
Try it in SWISH (By the way, I think if you make changes directly without creating a new notebook, it may modify the original, so please don't mess with it :))

Zsh --extendedglob, 14 bytes
>$1
: ^{1..9}#

Try it online!
Outputs via exit code: 0 is not a repdigit, 1 is a repdigit.

>$1 - create the file according to the input
^{1..9}# - construct the string ^1# ^2# ... ^9#
then find a file matching all of the patterns ^1# ^2# ... ^9#

# means zero or more of the preceding digit (but since a file must be at least 1 character, it actually means 1 or more)
^ means logical NOT

by DeMorgan's law, this creates a logical OR of the patterns ^1# ^2# ... ^9# (just with inverted output, but we can cope with that)

if no file matching all of these patterns exists - that is, the file is not not a repeated digit - there will be an error and the exit code will be 1.

: - and do nothing with it (otherwise it would try to execute the file as a command, which would also exit with an error)

--extendedglob is required to enable the ^ and # glob operators.

Factor, 19 bytes
[ present all-eq? ]

Try it online!

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Counting N-bit integer multiplication overflows
Given a positive integer N, output the number of pairs of integers 0 <= a <= b < 2**N such that a*b >= 2**N.
Rules

You may assume that N is less than or equal to the maximum bit width for integers in your language (e.g. for C, N will not exceed 32 or 64, depending on the architecture of the machine). If your language is capable of handling arbitrary-width integers, then there is no upper bound on N.

Test Cases
1 0
2 3
3 19
4 96
5 437
6 1876
7 7804
8 31904
9 129170
10 520135
11 2088143
12 8369175
13 33512744
14 134128704
15 536681553
16 2147082274

Note: I'm working on generating larger test cases now. My brute force approach is really slow.

@user202729 You're duplicating some pairs by not following the a <= b condition.

Some more testcases: {0, 3, 19, 96, 437, 1876, 7804, 31904, 129170, 520135, 2088143, 8369175, 33512744, 134128704, 536681553, 2147082274, 8589086503, 34357951447}

Isn't there likely to be closed form formula for this  problem? I must have missed something.

@Lembik There probably is. I don't know what it is, though.

I take it back. The answer is approximately  (1/2)M^2 - M - (1/2)M ln(M) where M = 2**N.

Closely related: https://en.wikipedia.org/wiki/Divisor_summatory_function. There is no closed form known.

Does ordering matter? If 2 and 3 work for example, does that count as one or two? Because that could be expressed by a=2,b=3 or a=3,b=2

@Cyoce Because of the 0 <= a <= b < 2**N requirement, only (2, 3) would be considered.

@Mego right. Didn't read that part I guess

@Lembik:  If there is, it isn't in OEIS.  This was posted to math.se where there is an approximate solution but nobody has made an exact one.

@RossMillikan Yes. Hence "I take it back." above :)  The 2^{N/3} solution is pretty cool! Someone should implement that here.

Python 2, 75 68 bytes
n=input()
a=1<<n
s=~-a*a/2
x=y=0
while y<1:s+=y;x-=1;y=a/x-x
print s

Try it online!
This runs in O(2n/2) operations rather than O(2n) or O(22·n), so it works on much larger inputs.
(Note that an even faster O(2n/3) algorithm exists.)
1 0
2 3
3 19
4 96
5 437
6 1876
7 7804
8 31904
9 129170
10 520135
11 2088143
12 8369175
13 33512744
14 134128704
15 536681553
16 2147082274
17 8589086503
18 34357951447
19 137435198086
20 549747939928
21 2199006781125
22 8796058620153
23 35184300378083
24 140737339120148
25 562949643323164
26 2251799170232606
27 9007197921321922
28 36028794259096612
29 144115182370060793
30 576460740519709546
31 2305842984902014765
32 9223371986742908935
33 36893488044218344323
34 147573952377320833218
35 590295809922086353118
36 2361183240537767708679
37 9444732963897547996897
38 37778931859178411534913
39 151115727444080615797321
40 604462909791437463796926
41 2417851639196741979223299
42 9671406556850476410936322
43 38685626227531971124247499
44 154742504910394112443480979
45 618970019642121099638818409
46 2475880078569598086230187969
47 9903520314280668496162705117
48 39614081257127323838921620439
49 158456325028518790167805606609
50 633825300114094540502620959956
51 2535301200456417702087608942034
52 10141204801825751449333352568660
53 40564819207303170200956592005599
54 162259276829213015854387448792578
55 649037107316852746005301421147606
56 2596148429267412374169967907532731
57 10384593717069652326923914077600197
58 41538374868278615068076777292632146
59 166153499473114471992855423428749242
60 664613997892457911812090466987383188
61 2658455991569831695728843704244440740
62 10633823966279326881474627069404687424
63 42535295865117307726213589942623257944

Very nice improvement!

You can swap x=0;y=0 for x=y=0

It would be super cool if you implemented the 2^{N/3} solution too.

A full program would be 4 bytes shorter.

Swapping some signs saves one more byte. https://tio.run/##Jc1BDoIwEEDRNXOK2QFKgyVhA53DjFqlCQ4NYOxsvHqNuv7J@1H3aZHORI2ab8uKgkFwZbn7yjZ9Xw9QxDXIjtJAESQ@dySc@XG@8oAChU/@gmVZZqFfrWpgss4JbPQ2fOC2g0RKJ3hNYfaozg7bkXRMhuyoxG0yCf6LLX@hDw

@Dennis Indeed, thanks!

Jelly, 12 10 bytes
2*ṖµṀ:«ạ¹S

Finishes the combined test cases in under 3 seconds.
Try it online!
How it works
2*ṖµṀ:«ạ¹S  Main link. Argument: n

2*          Yield 2ⁿ.
  Ṗ         Pop; yield A := [1, ..., 2ⁿ-1].
   µ        New monadic chain. Argument: A
    Ṁ       Maximum; yield 2ⁿ-1.
     :      Divide 2ⁿ-1 by each k in A.
      «     Dyadic minimum; yield min((2ⁿ-1)/k, k) for each k in A.
        ¹   Identity; yield A.
       ạ    Absolute difference; yield k - min((2ⁿ-1)/k, k) for each k in A.
         S  Take the sum.

MATL, 10 9 bytes
Wqt:&*R<z

Try it online!
This tries all possible pairs. It runs out of memory in the online interpreter for input exceeding 12.
Explanation
W      % Implicitly input N. Push 2^N ('^' denotes power)
q      % Subtract 1: gives 2^N-1
t:     % Duplicate, range: pushes [0 1 2 ... 2^N-1]
&*     % Matrix of all pair-wise products
R      % Upper triangular part (including diagonal)
<      % Less-than comparison; element-wise. This gives true for products
       % that are greater than 2^N-1
z      % Number of non-zeros- Implicitly display

Brachylog, 21 bytes
;2↔^P>B≥Aℕ;B C×≥P∧C≜ᶜ

Try it online!

You don't need to explicitly give the name A to that variable, saving one byte.

JavaScript (ES7), 70 65 60 bytes
n=>[...Array(k=2**n-1)].reduce(p=>p+=k<++i*i&&i-(k/i|0),i=0)

Test cases

let f =

n=>[...Array(k=2**n-1)].reduce(p=>p+=k<++i*i&&i-(k/i|0),i=0)

for(n = 1; n <= 16; n++) {
  console.log(n, f(n))
}

05AB1E, 13 12 bytes
-1 byte thanks to Emigna
oDL<ã€{ÙP›_O

Try it online!
Explanation
oDL<ã€{ÙP›_O   Argument n
oD             2^n, push twice to the stack
  L<           List: [0 .. a]
    ã          Cartesian product with itself
     €{        Sort each element
       Ù       Uniquify
        P      Total product of each element
         ›_    Each element is greater or equal than 2^n
           O   Total sum

Just P is enough here.

@Emigna it is, thanks. I will edit that

Mathematica, 37 bytes
Sum[#-⌈#/a⌉~Max~a,{a,#-1}]&[2^#]&

Try it online at http://sandbox.open.wolframcloud.com. Mathematica does not have limit on integers, and this algorithm run in time 2n, so it is very slow for large n.

Clojure, 78 bytes
#(count(for[l[(bit-shift-left 1 %)]a(range l)b(range a l):when(>=(* a b)l)]1))

Actually, 13 bytes
╙;r⌠;R*i⌡M♀≥Σ

Try it online!
A literal implementation of the problem. Quite slow.

13: ╙;r;∙♂S╔♂π♀≥Σ (minor edit to the version I posted in chat)

@Mego I don't feel like copying your code.

PHP, 62 bytes
for($x=$n=2**$argn;$y=--$x;)for(;$y;)$x*$y--<$n?:$r++;echo+$r;

Try it online!

Python 2, 53 bytes
lambda n:sum(k-min(~-2**n/k,k)for k in range(1,2**n))

Try it online!

Jelly, 11 bytes
2*’©ŒċP€>®S

Try it online!
A literal implementation of the problem. Quite slow.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/