mersenneforum.org  

Go Back   mersenneforum.org > Math Stuff > Computer Science & Computational Number Theory > PARI/GP

Reply
 
Thread Tools
Old 2022-08-12, 07:51   #1
Adrian
 
Aug 2022

1 Posts
Default summation in pari gp

Is there any command to evaluate in PARI GP such sum: \(\sum\limits_{\substack{2\leq d\leq n \\ (d, n)=1}}\frac{a\left(n\right)}{d}\)?


In other words: how to add to command

sum(d=2, n, \frac{a(n)}{d})

condition from second line $(d,n)=1$) (or more such conditions)

Last fiddled with by LaurV on 2022-08-12 at 09:40 Reason: fixed the formula
Adrian is offline   Reply With Quote
Old 2022-08-12, 09:48   #2
LaurV
Romulan Interpreter
 
LaurV's Avatar
 
"name field"
Jun 2011
Thailand

2·5·1,013 Posts
Default

you mean this?

Code:
gp > sum(d=1,20,if(d%2==0&&d%3==0,1./d,0),0)
%1 = 0.30555555555555555555555555555555555556
gp > 1./6+1/12+1/18
%2 = 0.30555555555555555555555555555555555556
gp >
Pari is a programing language, how you combine the stuff is up to you
(p.s. I also edited your post and fixed your formula)
LaurV is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help pari gp User133 PARI/GP 46 2020-06-15 11:29
LLL in GP/Pari paul0 Programming 2 2015-11-17 13:04
PARI vs GAP skan Miscellaneous Math 0 2012-12-16 00:13
pari devarajkandadai Programming 21 2012-08-31 18:08
Σ summation increments roger Math 2 2008-04-18 07:04

All times are UTC. The time now is 18:53.


Wed Oct 5 18:53:24 UTC 2022 up 48 days, 16:21, 0 users, load averages: 0.97, 1.21, 1.21

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.

≠ ± ∓ ÷ × · − √ ‰ ⊗ ⊕ ⊖ ⊘ ⊙ ≤ ≥ ≦ ≧ ≨ ≩ ≺ ≻ ≼ ≽ ⊏ ⊐ ⊑ ⊒ ² ³ °
∠ ∟ ° ≅ ~ ‖ ⟂ ⫛
≡ ≜ ≈ ∝ ∞ ≪ ≫ ⌊⌋ ⌈⌉ ∘ ∏ ∐ ∑ ∧ ∨ ∩ ∪ ⨀ ⊕ ⊗ 𝖕 𝖖 𝖗 ⊲ ⊳
∅ ∖ ∁ ↦ ↣ ∩ ∪ ⊆ ⊂ ⊄ ⊊ ⊇ ⊃ ⊅ ⊋ ⊖ ∈ ∉ ∋ ∌ ℕ ℤ ℚ ℝ ℂ ℵ ℶ ℷ ℸ 𝓟
¬ ∨ ∧ ⊕ → ← ⇒ ⇐ ⇔ ∀ ∃ ∄ ∴ ∵ ⊤ ⊥ ⊢ ⊨ ⫤ ⊣ … ⋯ ⋮ ⋰ ⋱
∫ ∬ ∭ ∮ ∯ ∰ ∇ ∆ δ ∂ ℱ ℒ ℓ
𝛢𝛼 𝛣𝛽 𝛤𝛾 𝛥𝛿 𝛦𝜀𝜖 𝛧𝜁 𝛨𝜂 𝛩𝜃𝜗 𝛪𝜄 𝛫𝜅 𝛬𝜆 𝛭𝜇 𝛮𝜈 𝛯𝜉 𝛰𝜊 𝛱𝜋 𝛲𝜌 𝛴𝜎𝜍 𝛵𝜏 𝛶𝜐 𝛷𝜙𝜑 𝛸𝜒 𝛹𝜓 𝛺𝜔