[VA] SRC#001 - Spiky Integral
07-19-2018, 12:27 AM
Post: #33
 Thomas Klemm Senior Member Posts: 1,447 Joined: Dec 2013
RE: [VA] SRC#001 - Spiky Integral
(07-18-2018 05:32 PM)ijabbott Wrote:  Is there a neat formula for just the constant term when converting the product to a sum?

From A058377:
Quote:FORMULA
a(n) is half the coefficient of q^0 in product('(q^(-k)+q^k)', 'k'=1..n) for n >= 1.

Thus I doubt there is a "neat formula".
However here's a table of n, a(n) for n = 1..3342

From this we can calculate the value of I(1000) in accordance with Valentin's result:
Code:
>>> pi * 233854293495526890065238464248235751245240100131956760799187425375936277246​90522222877561004003130584906467004224646067900127143577719083836763175003199331​52618246357256959031783393818502766544769519367557819335776078670054986664044830​87885857942123647648138674089597298681941927332215904466338708 / 2**998 0.00027425815360837894

Since I had trouble with the Python program with bigger numbers I implemented it in Clojure:
Code:
(defn zeros [k]   (replicate k 0)) (defn spiky [n]   (loop [k 2 a '(0 1)]     (if (> k n) (first a)          (let [s (count a)               [b c] (split-at k a)               u (concat (zeros k) a)               v (concat (conj (reverse b) 0) (zeros (dec s)))               w (concat c (zeros (* 2 k)))]            (recur (inc k) (map +' u v w))))))
You may notice similarities to the implementation in RPL.

It's fast for n=100, takes a couple of seconds for n=200 and multiple minutes for n=1000.
I've tried it for n=2000 and after a while that felt like eternity the correct result was given.
From these measurements I would assume that it would take days or even weeks to calculate the value for n=20,000. Thus I refrained from trying.

Kind regards
Thomas
 « Next Oldest | Next Newest »

 Messages In This Thread [VA] SRC#001 - Spiky Integral - Valentin Albillo - 07-10-2018, 10:10 PM RE: [VA] SRC#001 - Spiky Integral - pier4r - 07-11-2018, 11:10 AM RE: [VA] SRC#001 - Spiky Integral - Valentin Albillo - 07-12-2018, 10:43 PM RE: [VA] SRC#001 - Spiky Integral - Gerson W. Barbosa - 07-13-2018, 03:54 AM RE: [VA] SRC#001 - Spiky Integral - Gerson W. Barbosa - 07-12-2018, 04:23 AM RE: [VA] SRC#001 - Spiky Integral - Massimo Gnerucci - 07-12-2018, 06:10 AM RE: [VA] SRC#001 - Spiky Integral - Gerson W. Barbosa - 07-12-2018, 08:29 PM RE: [VA] SRC#001 - Spiky Integral - Pjwum - 07-12-2018, 10:32 AM RE: [VA] SRC#001 - Spiky Integral - Gerson W. Barbosa - 07-12-2018, 08:10 PM RE: [VA] SRC#001 - Spiky Integral - ijabbott - 07-13-2018, 06:52 PM RE: [VA] SRC#001 - Spiky Integral - rprosperi - 07-14-2018, 01:30 AM RE: [VA] SRC#001 - Spiky Integral - ijabbott - 07-14-2018, 01:39 AM RE: [VA] SRC#001 - Spiky Integral - ijabbott - 07-14-2018, 02:08 PM RE: [VA] SRC#001 - Spiky Integral - Thomas Klemm - 07-14-2018, 08:38 PM RE: [VA] SRC#001 - Spiky Integral - Gerson W. Barbosa - 07-15-2018, 02:53 PM RE: [VA] SRC#001 - Spiky Integral - Valentin Albillo - 07-15-2018, 09:03 PM RE: [VA] SRC#001 - Spiky Integral - Gerson W. Barbosa - 07-15-2018, 09:55 PM RE: [VA] SRC#001 - Spiky Integral - Valentin Albillo - 07-14-2018, 10:54 PM RE: [VA] SRC#001 - Spiky Integral - Thomas Klemm - 07-15-2018, 06:26 PM RE: [VA] SRC#001 - Spiky Integral - Gerson W. Barbosa - 07-15-2018, 07:35 PM RE: [VA] SRC#001 - Spiky Integral - DavidM - 07-15-2018, 07:53 PM RE: [VA] SRC#001 - Spiky Integral - John Keith - 07-15-2018, 09:22 PM RE: [VA] SRC#001 - Spiky Integral - Gerson W. Barbosa - 07-15-2018, 10:16 PM RE: [VA] SRC#001 - Spiky Integral - Gerson W. Barbosa - 07-16-2018, 12:31 AM RE: [VA] SRC#001 - Spiky Integral - Valentin Albillo - 07-18-2018, 12:36 AM RE: [VA] SRC#001 - Spiky Integral - Gerson W. Barbosa - 07-18-2018, 03:07 AM RE: [VA] SRC#001 - Spiky Integral - Valentin Albillo - 07-18-2018, 11:39 PM RE: [VA] SRC#001 - Spiky Integral - Gerson W. Barbosa - 07-19-2018, 01:31 AM RE: [VA] SRC#001 - Spiky Integral - Valentin Albillo - 07-19-2018, 09:07 PM RE: [VA] SRC#001 - Spiky Integral - Albert Chan - 07-20-2018, 08:06 PM RE: [VA] SRC#001 - Spiky Integral - Gerson W. Barbosa - 07-21-2018, 04:06 AM RE: [VA] SRC#001 - Spiky Integral - Albert Chan - 07-21-2018, 04:00 PM RE: [VA] SRC#001 - Spiky Integral - Valentin Albillo - 07-22-2018, 12:33 AM RE: [VA] SRC#001 - Spiky Integral - Albert Chan - 07-22-2018, 04:50 AM RE: [VA] SRC#001 - Spiky Integral - Gerson W. Barbosa - 07-15-2018, 07:10 PM RE: [VA] SRC#001 - Spiky Integral - Thomas Klemm - 07-16-2018, 03:27 AM RE: [VA] SRC#001 - Spiky Integral - John Keith - 07-16-2018, 01:18 PM RE: [VA] SRC#001 - Spiky Integral - Werner - 07-18-2018, 06:17 AM RE: [VA] SRC#001 - Spiky Integral - ijabbott - 07-18-2018, 05:32 PM RE: [VA] SRC#001 - Spiky Integral - Thomas Klemm - 07-19-2018 12:27 AM RE: [VA] SRC#001 - Spiky Integral - Gerson W. Barbosa - 07-19-2018, 01:22 AM RE: [VA] SRC#001 - Spiky Integral - Albert Chan - 07-20-2018, 02:30 PM RE: [VA] SRC#001 - Spiky Integral - Albert Chan - 07-22-2018, 02:01 PM RE: [VA] SRC#001 - Spiky Integral - Valentin Albillo - 07-22-2018, 09:06 PM RE: [VA] SRC#001 - Spiky Integral - Albert Chan - 07-24-2018, 12:13 AM

User(s) browsing this thread: 1 Guest(s)