mersenneforum.org  

Go Back   mersenneforum.org > New To GIMPS? Start Here! > Homework Help

Reply
 
Thread Tools
Old 2010-04-06, 03:47   #1
Unregistered
 

22×3×307 Posts
Post GIMPS Programing assignment

I'm create a computer program to delete the back-up files created by GIMPS. I'm having a problem converting the eight digit number returned by GIMPS (e.g. 44117237) to the 'p' and 'q' files created for back-up (e.g. p1J17237 and q1J17237). If anyone knows where I can find information on this I would appreciate it.
  Reply With Quote
Old 2010-04-06, 06:30   #2
Batalov
 
Batalov's Avatar
 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2

9,941 Posts
Default

The answer is easy to find in the source.
The source is freely available from http://www.mersenne.org/freesoft/ (see last paragraph).

hint: you may want to look in commonc.c.
Ah, well, here:
Code:
        p = w->n;
        if (p < 80000000) {
                sprintf (buf, "p%07li", p % 10000000);
                if (p >= 10000000)      /* buf[1] ranges from A-Y */
                        buf[1] = (char) ('A' + (p / 1000000) - 10);
               if (p >= 35000000)      /* buf[2] ranges from A-Z */
                       c = buf[1], buf[1] = buf[2], buf[2] = (char)(c - 25);
                if (p >= 61000000)      /* buf[3] ranges from B-T */
                        c = buf[2], buf[2] = buf[3], buf[3] = (char)(c - 25);
        } else
                sprintf (buf, "p%ld", p);
p1J17237 -type names mean that the middle section is of interest to you.
Batalov is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Two computers, same assignment? erve02d0 PrimeNet 16 2016-05-30 04:25
new assignment esakertt PrimeNet 6 2012-11-09 19:51
Assignment key Unregistered Information & Answers 4 2012-09-24 15:34
Want New Assignment Unregistered Information & Answers 1 2012-03-28 00:02
Old Assignment Primeinator PrimeNet 4 2009-06-04 22:35

All times are UTC. The time now is 11:09.


Fri Sep 30 11:09:35 UTC 2022 up 43 days, 8:38, 0 users, load averages: 0.78, 0.98, 0.97

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.

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