mersenneforum.org summation in pari gp
 User Name Remember Me? Password
 Register FAQ Search Today's Posts Mark Forums Read

 2022-08-12, 07:51 #1 Adrian   Aug 2022 1 Posts 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
 2022-08-12, 09:48 #2 LaurV Romulan Interpreter     "name field" Jun 2011 Thailand 2·11·467 Posts 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)

 Similar Threads Thread Thread Starter Forum Replies Last Post User133 PARI/GP 46 2020-06-15 11:29 paul0 Programming 2 2015-11-17 13:04 skan Miscellaneous Math 0 2012-12-16 00:13 devarajkandadai Programming 21 2012-08-31 18:08 roger Math 2 2008-04-18 07:04

All times are UTC. The time now is 20:42.

Mon Jan 30 20:42:16 UTC 2023 up 165 days, 18:10, 0 users, load averages: 0.88, 1.06, 1.01

Copyright ©2000 - 2023, 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.

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