1. 程式人生 > >Project euler 401 約數的平方和 (數論)

Project euler 401 約數的平方和 (數論)

題意:

約數的平方和

6的約數有1、2、3和6。
這些數的平方和是1+4+9+36=50。

我們記sigma2(n)是n的所有約數的平方和。因此sigma2(6)=50.

我們記SIGMA2是sigma2的和函式,也就是說SIGMA2(n)=∑sigma2(i),其中i=1~n。
SIGMA2的前6項為:1、6、16、37、63和113。

求SIGMA2(1015)模109取餘的值。


題解:



其中,

相關推薦

Project euler 401 約數平方和 (數論)

題意: 約數的平方和 6的約數有1、2、3和6。 這些數的平方和是1+4+9+36=50。 我們記sigma2(n)是n的所有約數的平方和。因此sigma2(6)=50. 我們記SIGMA2

Project Euler 501 Eight Divisors (數論)

sum scan 就是 ont tinc distinct class 套路 pair 題目鏈接: https://projecteuler.net/problem=501 題意: \(f(n)\) be the count of numbers not exceeding

[Project Euler 429] Sum of squares of unitary divisors(數論

blog ont namespace href 題解 str return void rap 題目鏈接:https://projecteuler.net/problem=429 題目: A unitary divisor dd of a number nn is a d

project euler 14 collatz

xiang wan urb col site asi pri hang dai Java%E5%AD%97%E8%8A%82%E3%80%81%E5%8D%81%E8%BF%9B%E5%88%B6%E3%80%81%E5%8D%81%E5%85%AD%E8%BF%9B%E5

Project Euler:problem 104

clu int hub printf div pro key urn 鏈接 題目鏈接:http://pe-cn.github.io/104/ # include <stdio.h> # include <stdlib.h> void sort(i

Project Euler:Problem 41 Pandigital prime

emp ont div track using string space number end We shall say that an n-digit number is pandigital if it makes use of all the digits

Project Euler:Problem 34 Digit factorials

class -a post ria urn back ble while [1] 145 is a curious number, as 1! + 4! + 5! = 1 + 24 + 120 = 145. Find the s

[Perl 6][Project Euler] Problem 9 - Special Pythagorean triplet

spc tid int exists post auto gsp none style [Perl 6][Project Euler] Problem 9 - Special Pythagorean triplet Description A Pythagorea

Project Euler】530 GCD of Divisors 莫比烏斯反演

rac 困難 efi pan opened can tps blank 分塊 【題目】GCD of Divisors 【題意】給定f(n)=Σd|n gcd(d,n/d)的前綴和F(n),n=10^15。 【算法】莫比烏斯反演 【題解】參考:任之洲數論函數.pdf 這個範圍

Project Euler 453 Lattice Quadrilaterals 困難的計數問題

省選模擬賽 我想 dea tdi 初始 wap 存在 hide att 這是一道很綜合的計數問題,對於思維的全面性,解法的過渡性,代碼能力,細節處理,計數問題中的各種算法,像gcd、容斥、類歐幾裏德算法都有考察.在省選模擬賽中做到了這題,然而數據範圍是n,m小於等於1000

project euler 169

ret con href .net IT pac push_back tps tor project euler 169 題目鏈接:https://projecteuler.net/problem=169 參考題解:http://tieba.baidu.com/p/2738

Flea Circus(Project Euler 213)

main bsp make 單位 targe urn %d using oid original version hackerrank programming version 題目大意是N*N的格子,每個格子一開始有1個跳蚤,每過單位時間跳蚤會等概率向四周跳,問M

project euler之最大的素因子

數字 euler class tin urn break 如果 == 素因子 from math import floor def panduan(num): if num > 1: if num > 1: #

project euler之第10001個素數

range spa span for style num count math class import math count = 0 num = 1 while count<10001: num +=1 if num > 1:

project euler之Large sum

range readline file clas pan put NPU inpu txt import fileinput f=open("1.txt","r") m=0 for i in range(100): s=f.readline() m+=in

Newcoder 40 F.珂朵莉的約數數論+莫隊演算法)

Description 珂朵莉給你一個長為 n n n的序列,有

Project Euler Problem 46

Problem 46 : Goldbach’s other conjecture It was proposed by Christian Goldbach that every odd composite number can be written as the sum of a

Project Euler Problem 45

Problem 45 : Triangular, pentagonal, and hexagonal Triangle, pentagonal, and hexagonal numbers are generated by the following formulae: Tria

Project Euler Problem 44

Problem 44 : Pentagon numbers Pentagonal numbers are generated by the formula, Pn=n(3n−1)/2. The first ten pentagonal numbers are: 1, 5, 12,

Project Euler Problem 43

Problem 43 : Sub-string divisibility The number, 1406357289, is a 0 to 9 pandigital number because it is made up of each of the digits 0 to 9