RosettaCodeData/Task/Chowla-numbers/00-TASK.txt
2023-07-01 13:44:08 -04:00

73 lines
3.9 KiB
Text

Chowla numbers are also known as:
::*   Chowla's function
::*   chowla numbers
::*   the chowla function
::*   the chowla number
::*   the chowla sequence
The chowla number of &nbsp; <big>'''n'''</big> &nbsp; is &nbsp; (as defined by Chowla's function):
::* &nbsp; the sum of the divisors of &nbsp; <big>'''n'''</big> &nbsp; &nbsp; excluding unity and &nbsp; <big>'''n'''</big>
::* &nbsp; where &nbsp; <big>'''n'''</big> &nbsp; is a positive integer
The sequence is named after &nbsp; Sarvadaman D. S. Chowla, &nbsp; (22 October 1907 ──► 10 December 1995),
<br>a London born Indian American mathematician specializing in ''number theory''.
German mathematician Carl Friedrich Gauss (1777─1855) said:
"Mathematics is the queen of the sciences ─ and number theory is the queen of mathematics".
;Definitions:
Chowla numbers can also be expressed as:
<big>
chowla(<big>'''n'''</big>) = sum of divisors of <big>'''n'''</big> excluding unity and <big>'''n'''</big>
chowla(<big>'''n'''</big>) = sum( divisors(<big>'''n'''</big>)) <big>'''- 1 - n''' </big>
chowla(<big>'''n'''</big>) = sum( properDivisors(<big>'''n'''</big>)) <big>'''- 1''' </big>
chowla(<big>'''n'''</big>) = sum(aliquotDivisors(<big>'''n'''</big>)) <big>'''- 1''' </big>
chowla(<big>'''n'''</big>) = aliquot(<big>'''n'''</big>) <big>'''- 1''' </big>
chowla(<big>'''n'''</big>) = sigma(<big>'''n'''</big>) <big>'''- 1 - n''' </big>
chowla(<big>'''n'''</big>) = sigmaProperDivisiors(<big>'''n'''</big>) <big>'''- 1''' </big>
&nbsp;
chowla(<big>'''a'''*'''b'''</big>) = <big>'''a + b'''</big>, &nbsp; ''if'' <big>'''a'''</big> and <big>'''b'''</big> are distinct primes
if chowla(<big>'''n'''</big>) = <big>'''0'''</big>,&nbsp; and <big>'''n > 1'''</big>, then <big>'''n'''</big> is prime
if chowla(<big>'''n'''</big>) = <big>'''n - 1'''</big>, and <big>'''n > 1'''</big>, then <big>'''n'''</big> is a perfect number
</big>
;Task:
::* &nbsp; create a &nbsp; '''chowla''' &nbsp; function that returns the &nbsp; '''chowla number''' &nbsp; for a positive integer &nbsp; '''n'''
::* &nbsp; Find and display &nbsp; (1 per line) &nbsp; for the 1<sup>st</sup> &nbsp; '''37''' &nbsp; integers:
::::* &nbsp; the integer &nbsp; (the index)
::::* &nbsp; the chowla number for that integer
::* &nbsp; For finding primes, use the &nbsp; '''chowla''' &nbsp; function to find values of zero
::* &nbsp; Find and display the &nbsp; ''count'' &nbsp; of the primes up to &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; '''100'''
::* &nbsp; Find and display the &nbsp; ''count'' &nbsp; of the primes up to &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; '''1,000'''
::* &nbsp; Find and display the &nbsp; ''count'' &nbsp; of the primes up to &nbsp; &nbsp; &nbsp; &nbsp; '''10,000'''
::* &nbsp; Find and display the &nbsp; ''count'' &nbsp; of the primes up to &nbsp; &nbsp; &nbsp; '''100,000'''
::* &nbsp; Find and display the &nbsp; ''count'' &nbsp; of the primes up to &nbsp;&nbsp; '''1,000,000'''
::* &nbsp; Find and display the &nbsp; ''count'' &nbsp; of the primes up to&nbsp; '''10,000,000'''
::* &nbsp; For finding perfect numbers, use the &nbsp; '''chowla''' &nbsp; function to find values of &nbsp; '''n - 1'''
::* &nbsp; Find and display all &nbsp; perfect numbers &nbsp; up to &nbsp; '''35,000,000'''
::* &nbsp; use commas within appropriate numbers
::* &nbsp; show all output here
;Related tasks:
:* &nbsp; [[Totient_function| totient function]]
:* &nbsp; [[Perfect_numbers| perfect numbers]]
:* &nbsp; [[Proper divisors]]
:* &nbsp; [[Sieve of Eratosthenes]]
;See also:
:* &nbsp; the OEIS entry for &nbsp; [http://oeis.org/A048050 A48050 Chowla's function].
<br><br>