Skip to main content
Commonmark migration
Source Link

#Pyth, 23 20 bytes

Pyth, 23 20 bytes

This is 1-indexed.

WhQ=-QqsPZsPhZ=+Z1;Z 

Test Suite or Try it online!


#Explanation

Explanation

 WhQ=-QqsPZsPhZ=+Z1;Z - Full program. Takes input from Standard input. WhQ - While Q is still higher than 0. sPZ - Sum of the prime factors of Z. sPhZ - Sum of the prime factors of Z+1. q - If the above are equal: =-Q - Decrement Q by 1 if they are equal, and by 0 if they are not. =+Z1; - Increment Z on each iteration. Z - Output Z. 

#Pyth, 23 20 bytes

This is 1-indexed.

WhQ=-QqsPZsPhZ=+Z1;Z 

Test Suite or Try it online!


#Explanation

 WhQ=-QqsPZsPhZ=+Z1;Z - Full program. Takes input from Standard input. WhQ - While Q is still higher than 0. sPZ - Sum of the prime factors of Z. sPhZ - Sum of the prime factors of Z+1. q - If the above are equal: =-Q - Decrement Q by 1 if they are equal, and by 0 if they are not. =+Z1; - Increment Z on each iteration. Z - Output Z. 

Pyth, 23 20 bytes

This is 1-indexed.

WhQ=-QqsPZsPhZ=+Z1;Z 

Test Suite or Try it online!


Explanation

 WhQ=-QqsPZsPhZ=+Z1;Z - Full program. Takes input from Standard input. WhQ - While Q is still higher than 0. sPZ - Sum of the prime factors of Z. sPhZ - Sum of the prime factors of Z+1. q - If the above are equal: =-Q - Decrement Q by 1 if they are equal, and by 0 if they are not. =+Z1; - Increment Z on each iteration. Z - Output Z. 
added 496 characters in body
Source Link
Mr. Xcoder
  • 42.9k
  • 9
  • 87
  • 221

#Pyth, 2323 20 bytes

This is 1-indexed.

WhQIqsPZsPhZ=WhQ=-Q1)=+Z1;ZQqsPZsPhZ=+Z1;Z 

Test SuiteTest Suite or Try it online!Try it online!


#Explanation

 WhQ=-QqsPZsPhZ=+Z1;Z - Full program. Takes input from Standard input. WhQ - While Q is still higher than 0. sPZ - Sum of the prime factors of Z. sPhZ - Sum of the prime factors of Z+1. q - If the above are equal: =-Q - Decrement Q by 1 if they are equal, and by 0 if they are not. =+Z1; - Increment Z on each iteration. Z - Output Z. 

#Pyth, 23 bytes

This is 1-indexed.

WhQIqsPZsPhZ=-Q1)=+Z1;Z 

Test Suite or Try it online!

#Pyth, 23 20 bytes

This is 1-indexed.

WhQ=-QqsPZsPhZ=+Z1;Z 

Test Suite or Try it online!


#Explanation

 WhQ=-QqsPZsPhZ=+Z1;Z - Full program. Takes input from Standard input. WhQ - While Q is still higher than 0. sPZ - Sum of the prime factors of Z. sPhZ - Sum of the prime factors of Z+1. q - If the above are equal: =-Q - Decrement Q by 1 if they are equal, and by 0 if they are not. =+Z1; - Increment Z on each iteration. Z - Output Z. 
Source Link
Mr. Xcoder
  • 42.9k
  • 9
  • 87
  • 221

#Pyth, 23 bytes

This is 1-indexed.

WhQIqsPZsPhZ=-Q1)=+Z1;Z 

Test Suite or Try it online!