https://projecteuler.net/problem=21
Let d(n) be defined as the sum of proper divisors of n (numbers less than n which divide evenly into n).
If d(a) = b and d(b) = a, where a ≠ b, then a and b are an amicable pair and each of a and b are called amicable numbers.
For example, the proper divisors of 220 are 1, 2, 4, 5, 10, 11, 20, 22, 44, 55 and 110; therefore d(220) = 284. The proper divisors of 284 are 1, 2, 4, 71 and 142; so d(284) = 220.
Evaluate the sum of all the amicable numbers under 10000.
私の考え
for 1≦a≦n
□□b ← d(i)
□□if d(b) = i
□□□□sum ← sum + a + b
お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!
似たような質問が見つかりました
- C言語・C++・C# Project Euler #6 Sum square difference 至急教えてください。 1 2022/09/17 16:16
- C言語・C++・C# [至急]Project Euler:#17Number letter countsコード入力出力解説 2 2022/09/24 02:46
- 英語 できるだけ直訳で英語の翻訳をお願いします。(英語→日本語) 1 2022/10/15 20:59
- 戦争・テロ・デモ ウクライナ、メル友に五千円要求されてさ 1 2022/04/02 09:38
- 英語 The latter has been the experience at the New York 2 2023/03/23 08:52
- 大学受験 英作文の添削をお願いしたいです。 2 2022/08/19 20:37
- TOEFL・TOEIC・英語検定 With its architecture and gardens and a wealth of 0 2022/12/17 16:11
- 英語 英文の添削をお願いします 4 2023/05/23 11:10
- 公的扶助・生活保護 保証人? 1 2022/05/17 22:42
- 英語 この英文は格調高いのでしょうか? 3 2022/06/03 18:55
関連するカテゴリからQ&Aを探す
おすすめ情報
デイリーランキングこのカテゴリの人気デイリーQ&Aランキング
-
エクセルVBAついて ①if•••••the...
-
vb2010webページのリンクをクリ...
-
Verilogの文法
-
sublimit textっていうエディタ...
-
エクセルVBAでテキストボッ...
-
Excel VBAでsub,dimは何の略?
-
Functionの戻り値を配列にした...
-
プログラムの素朴な質問です 分...
-
VBA public変数はどのようなこ...
-
「ずっと憧れていました」は英...
-
Excel vba で複数のテキストの...
-
VBAでcallで呼び出したsubを終...
-
Matlabでsin波を使って矩形波を...
-
ClickとChangeイベントの違いは...
-
Can you text me your business...
-
共有フォルダの「共有のアクセ...
-
texで図と表を並べたい
-
FlexGridで文字色を変更。
-
String型の値にスラッシュをつ...
-
テキストボックスかラベル上の...
マンスリーランキングこのカテゴリの人気マンスリーQ&Aランキング
-
レコードセットにnullの場合
-
タイムアウトする仕組みを作りたい
-
subsequentとnextの違いってな...
-
vbsのmsgboxランダム表示について
-
日付の重複
-
verilogのcase文
-
片方のみ成り立つif分岐
-
TreeViewのTag情報取得
-
【FPGA】VHDLのprocessとevent
-
Verilogの文法
-
なんで? cEn-P^-1AP=P^-1(cEn-AP)
-
[至急]Project Euler:#21Amicab...
-
直線検出のハフ変換プログラム(...
-
pascalでの二分探索(バイナリ...
-
パスカル言語
-
Pascal言語
-
EXCEL VBA 文字 アドレス 検...
-
エクセルVBAついて ①if•••••the...
-
delphi
-
sublimit textっていうエディタ...
おすすめ情報