Skip to main content
Notice removed Reward existing answer by naffetS
Bounty Ended with lyxal's answer chosen by naffetS
Notice added Reward existing answer by naffetS
Bounty Started worth 100 reputation by naffetS
Tweeted twitter.com/StackCodeGolf/status/1598104694412435457
Became Hot Network Question
Probably not needed anymore
Source Link
The Thonnu
  • 18.7k
  • 3
  • 19
  • 76

(This is OEIS A057531.)

Your task

Given a positive integer, \$n\$, find the \$n\$th number where the digit sum equals the number of factors

Explanation

For example, let's take 22:

Its factors are \$[1, 2, 11, 22]\$ (length: 4).

Its digit sum is 4.

This means that it is a number where the digit sum equals the number of factors.

The series

The first few terms of this series are:

\$[1, 2, 11, 22, 36, 84, 101, 152, 156, 170]\$

Test cases

Note: these are 1-indexed. You may use 0-indexing.

Input Output 1 1 2 2 3 11 4 22 5 36 10 170 20 444 30 828 40 1111 50 1548 100 3588 

Clarifications

  • You may use either 0-indexing or 1-indexing
  • The sequence starts from 1, not from 0
  • The factors of a number include 1 and the number itself
  • Default rules apply - you may output the first \$n\$ terms, or the infinite sequence, or something else
  • This is , so shortest answer in bytes wins!

I have some Python solutions that I'll post in a few days if they don't get beaten:

  • 88 bytes for the infinite sequence
  • 92 bytes for the \$n\$th term
  • 126 bytes for the first \$n\$ terms

(This is OEIS A057531.)

Your task

Given a positive integer, \$n\$, find the \$n\$th number where the digit sum equals the number of factors

Explanation

For example, let's take 22:

Its factors are \$[1, 2, 11, 22]\$ (length: 4).

Its digit sum is 4.

This means that it is a number where the digit sum equals the number of factors.

The series

The first few terms of this series are:

\$[1, 2, 11, 22, 36, 84, 101, 152, 156, 170]\$

Test cases

Note: these are 1-indexed. You may use 0-indexing.

Input Output 1 1 2 2 3 11 4 22 5 36 10 170 20 444 30 828 40 1111 50 1548 100 3588 

Clarifications

  • You may use either 0-indexing or 1-indexing
  • The sequence starts from 1, not from 0
  • The factors of a number include 1 and the number itself
  • Default rules apply - you may output the first \$n\$ terms, or the infinite sequence, or something else
  • This is , so shortest answer in bytes wins!

I have some Python solutions that I'll post in a few days if they don't get beaten:

  • 88 bytes for the infinite sequence
  • 92 bytes for the \$n\$th term
  • 126 bytes for the first \$n\$ terms

(This is OEIS A057531.)

Your task

Given a positive integer, \$n\$, find the \$n\$th number where the digit sum equals the number of factors

Explanation

For example, let's take 22:

Its factors are \$[1, 2, 11, 22]\$ (length: 4).

Its digit sum is 4.

This means that it is a number where the digit sum equals the number of factors.

The series

The first few terms of this series are:

\$[1, 2, 11, 22, 36, 84, 101, 152, 156, 170]\$

Test cases

Note: these are 1-indexed. You may use 0-indexing.

Input Output 1 1 2 2 3 11 4 22 5 36 10 170 20 444 30 828 40 1111 50 1548 100 3588 

Clarifications

  • You may use either 0-indexing or 1-indexing
  • The sequence starts from 1, not from 0
  • The factors of a number include 1 and the number itself
  • Default rules apply - you may output the first \$n\$ terms, or the infinite sequence, or something else
  • This is , so shortest answer in bytes wins!
My solutions were beaten by Mukundan314
Source Link
The Thonnu
  • 18.7k
  • 3
  • 19
  • 76

(This is OEIS A057531.)

Your task

Given a positive integer, \$n\$, find the \$n\$th number where the digit sum equals the number of factors

Explanation

For example, let's take 22:

Its factors are \$[1, 2, 11, 22]\$ (length: 4).

Its digit sum is 4.

This means that it is a number where the digit sum equals the number of factors.

The series

The first few terms of this series are:

\$[1, 2, 11, 22, 36, 84, 101, 152, 156, 170]\$

Test cases

Note: these are 1-indexed. You may use 0-indexing.

Input Output 1 1 2 2 3 11 4 22 5 36 10 170 20 444 30 828 40 1111 50 1548 100 3588 

Clarifications

  • You may use either 0-indexing or 1-indexing
  • The sequence starts from 1, not from 0
  • The factors of a number include 1 and the number itself
  • Default rules apply - you may output the first \$n\$ terms, or the infinite sequence, or something else
  • This is , so shortest answer in bytes wins!

I have some Python solutions that I'll post in a few days if they don't get beaten:

    I have some Python solutions that I'll post in a few days if they don't get beaten:

    • 88 bytes for the infinite sequence
    • 92 bytes for the \$n\$th term
    • 126 bytes for the first \$n\$ terms
  • 88 bytes for the infinite sequence
  •  

    (This is OEIS A057531.)

    Your task

    Given a positive integer, \$n\$, find the \$n\$th number where the digit sum equals the number of factors

    Explanation

    For example, let's take 22:

    Its factors are \$[1, 2, 11, 22]\$ (length: 4).

    Its digit sum is 4.

    This means that it is a number where the digit sum equals the number of factors.

    The series

    The first few terms of this series are:

    \$[1, 2, 11, 22, 36, 84, 101, 152, 156, 170]\$

    Test cases

    Note: these are 1-indexed. You may use 0-indexing.

    Input Output 1 1 2 2 3 11 4 22 5 36 10 170 20 444 30 828 40 1111 50 1548 100 3588 

    Clarifications

    • You may use either 0-indexing or 1-indexing
    • The sequence starts from 1, not from 0
    • The factors of a number include 1 and the number itself
    • Default rules apply - you may output the first \$n\$ terms, or the infinite sequence, or something else
    • This is , so shortest answer in bytes wins!

    I have some Python solutions that I'll post in a few days if they don't get beaten:

    • 88 bytes for the infinite sequence
    • 92 bytes for the \$n\$th term
    • 126 bytes for the first \$n\$ terms
    • (This is OEIS A057531.)

      Your task

      Given a positive integer, \$n\$, find the \$n\$th number where the digit sum equals the number of factors

      Explanation

      For example, let's take 22:

      Its factors are \$[1, 2, 11, 22]\$ (length: 4).

      Its digit sum is 4.

      This means that it is a number where the digit sum equals the number of factors.

      The series

      The first few terms of this series are:

      \$[1, 2, 11, 22, 36, 84, 101, 152, 156, 170]\$

      Test cases

      Note: these are 1-indexed. You may use 0-indexing.

      Input Output 1 1 2 2 3 11 4 22 5 36 10 170 20 444 30 828 40 1111 50 1548 100 3588 

      Clarifications

      • You may use either 0-indexing or 1-indexing
      • The sequence starts from 1, not from 0
      • The factors of a number include 1 and the number itself
      • Default rules apply - you may output the first \$n\$ terms, or the infinite sequence, or something else
      • This is , so shortest answer in bytes wins!

      I have some Python solutions that I'll post in a few days if they don't get beaten:

      • 88 bytes for the infinite sequence
      • 92 bytes for the \$n\$th term
      • 126 bytes for the first \$n\$ terms
       
      Python answers
      Source Link
      The Thonnu
      • 18.7k
      • 3
      • 19
      • 76

      (This is OEIS A057531.)

      Your task

      Given a positive integer, \$n\$, find the \$n\$th number where the digit sum equals the number of factors

      Explanation

      For example, let's take 22:

      Its factors are \$[1, 2, 11, 22]\$ (length: 4).

      Its digit sum is 4.

      This means that it is a number where the digit sum equals the number of factors.

      The series

      The first few terms of this series are:

      \$[1, 2, 11, 22, 36, 84, 101, 152, 156, 170]\$

      Test cases

      Note: these are 1-indexed. You may use 0-indexing.

      Input Output 1 1 2 2 3 11 4 22 5 36 10 170 20 444 30 828 40 1111 50 1548 100 3588 

      Clarifications

      • You may use either 0-indexing or 1-indexing
      • The sequence starts from 1, not from 0
      • The factors of a number include 1 and the number itself
      • Default rules apply - you may output the first \$n\$ terms, or the infinite sequence, or something else
      • This is , so shortest answer in bytes wins!

      I have some Python solutions that I'll post in a few days if they don't get beaten:

      • 88 bytes for the infinite sequence
      • 92 bytes for the \$n\$th term
      • 126 bytes for the first \$n\$ terms

      (This is OEIS A057531.)

      Your task

      Given a positive integer, \$n\$, find the \$n\$th number where the digit sum equals the number of factors

      Explanation

      For example, let's take 22:

      Its factors are \$[1, 2, 11, 22]\$ (length: 4).

      Its digit sum is 4.

      This means that it is a number where the digit sum equals the number of factors.

      The series

      The first few terms of this series are:

      \$[1, 2, 11, 22, 36, 84, 101, 152, 156, 170]\$

      Test cases

      Note: these are 1-indexed. You may use 0-indexing.

      Input Output 1 1 2 2 3 11 4 22 5 36 10 170 20 444 30 828 40 1111 50 1548 100 3588 

      Clarifications

      • You may use either 0-indexing or 1-indexing
      • The sequence starts from 1, not from 0
      • The factors of a number include 1 and the number itself
      • Default rules apply - you may output the first \$n\$ terms, or the infinite sequence, or something else
      • This is , so shortest answer in bytes wins!

      (This is OEIS A057531.)

      Your task

      Given a positive integer, \$n\$, find the \$n\$th number where the digit sum equals the number of factors

      Explanation

      For example, let's take 22:

      Its factors are \$[1, 2, 11, 22]\$ (length: 4).

      Its digit sum is 4.

      This means that it is a number where the digit sum equals the number of factors.

      The series

      The first few terms of this series are:

      \$[1, 2, 11, 22, 36, 84, 101, 152, 156, 170]\$

      Test cases

      Note: these are 1-indexed. You may use 0-indexing.

      Input Output 1 1 2 2 3 11 4 22 5 36 10 170 20 444 30 828 40 1111 50 1548 100 3588 

      Clarifications

      • You may use either 0-indexing or 1-indexing
      • The sequence starts from 1, not from 0
      • The factors of a number include 1 and the number itself
      • Default rules apply - you may output the first \$n\$ terms, or the infinite sequence, or something else
      • This is , so shortest answer in bytes wins!

      I have some Python solutions that I'll post in a few days if they don't get beaten:

      • 88 bytes for the infinite sequence
      • 92 bytes for the \$n\$th term
      • 126 bytes for the first \$n\$ terms
      Source Link
      The Thonnu
      • 18.7k
      • 3
      • 19
      • 76
      Loading