Skip to main content
added 38 characters in body
Source Link
emanresu A
  • 43.8k
  • 5
  • 100
  • 239

Vyxal, 1716 bytes

ƛEDẊ²Ṡ√>∑;¦2Nȯ4NβƛEDẊ²Ṡ√>∑;¦÷$4*ε

Try it Online!Try it Online!

Mostly a port of UnrelatedString's Jelly answer. There's got to be a wayThere's got to be a way to save a byte on the last bit -1 thanks to save a byte on the last bitUnrelatedString.

ƛ        ;        # Over 1...n
        ∑         # Count the number of 
  DẊ              # Pairs
 E                # Of 1...2^m
    ²Ṡ√           # Whose squared sums, sqrt'd
       >          # Are less than
 E                # 2^m
          ¦       # Take the cumulative sum
           2Nȯ÷   ε # TakeSubtract from the last two itemsitem
             $4* 4Nβ # AndThe convertsecond-to-last fromitem basetimes -4

Vyxal, 17 bytes

ƛEDẊ²Ṡ√>∑;¦2Nȯ4Nβ

Try it Online!

Mostly a port of UnrelatedString's Jelly answer. There's got to be a way to save a byte on the last bit.

ƛ        ;        # Over 1...n
        ∑         # Count the number of 
  DẊ              # Pairs
 E                # Of 1...2^m
    ²Ṡ√           # Whose squared sums, sqrt'd
       >          # Are less than
 E                # 2^m
          ¦       # Take the cumulative sum
           2Nȯ    # Take the last two items
              4Nβ # And convert from base -4

Vyxal, 16 bytes

ƛEDẊ²Ṡ√>∑;¦÷$4*ε

Try it Online!

Mostly a port of UnrelatedString's Jelly answer. There's got to be a way to save a byte on the last bit -1 thanks to UnrelatedString.

ƛ        ;       # Over 1...n
        ∑        # Count the number of 
  DẊ             # Pairs
 E               # Of 1...2^m
    ²Ṡ√          # Whose squared sums, sqrt'd
       >         # Are less than
 E               # 2^m
          ¦      # Take the cumulative sum
           ÷   ε # Subtract from the last item
            $4*  # The second-to-last item times 4
added 10 characters in body
Source Link
emanresu A
  • 43.8k
  • 5
  • 100
  • 239

Vyxal, 17 bytes

ƛE²DẊ²Ṡ>∑;¦2Nȯ4NβƛEDẊ²Ṡ√>∑;¦2Nȯ4Nβ

Try it Online!Try it Online!

Mostly a port of UnrelatedString's Jelly answer. There's got to be a way to save a byte on the last bit.

ƛ        ;        # Over 1...n
        ∑         # Count the number of 
   DẊ              # Pairs
 E                # Of 1...4^m2^m
     ²Ṡ²Ṡ√           # Whose squared sums, sqrt'd
       >          # Are less than
 E                # 4^m2^m
          ¦       # Take the cumulative sum
           2Nȯ    # Take the last two items
              4Nβ # And convert from base -4

Vyxal, 17 bytes

ƛE²DẊ²Ṡ>∑;¦2Nȯ4Nβ

Try it Online!

Mostly a port of UnrelatedString's Jelly answer. There's got to be a way to save a byte on the last bit.

ƛ        ;        # Over 1...n
        ∑         # Count the number of 
   DẊ             # Pairs
                # Of 1...4^m
     ²Ṡ           # Whose squared sums
       >          # Are less than
                # 4^m
          ¦       # Take the cumulative sum
           2Nȯ    # Take the last two items
              4Nβ # And convert from base -4

Vyxal, 17 bytes

ƛEDẊ²Ṡ√>∑;¦2Nȯ4Nβ

Try it Online!

Mostly a port of UnrelatedString's Jelly answer. There's got to be a way to save a byte on the last bit.

ƛ        ;        # Over 1...n
        ∑         # Count the number of 
  DẊ              # Pairs
 E                # Of 1...2^m
    ²Ṡ√           # Whose squared sums, sqrt'd
       >          # Are less than
 E                # 2^m
          ¦       # Take the cumulative sum
           2Nȯ    # Take the last two items
              4Nβ # And convert from base -4
Source Link
emanresu A
  • 43.8k
  • 5
  • 100
  • 239

Vyxal, 17 bytes

ƛE²DẊ²Ṡ>∑;¦2Nȯ4Nβ

Try it Online!

Mostly a port of UnrelatedString's Jelly answer. There's got to be a way to save a byte on the last bit.

ƛ        ;        # Over 1...n
        ∑         # Count the number of 
   DẊ             # Pairs
 E²               # Of 1...4^m
     ²Ṡ           # Whose squared sums
       >          # Are less than
 E²               # 4^m
          ¦       # Take the cumulative sum
           2Nȯ    # Take the last two items
              4Nβ # And convert from base -4