Register FAQ Search Today's Posts Mark Forums Read

 2018-06-27, 04:46 #1 devarajkandadai     May 2004 22·79 Posts pari and p-adic numbers On page 19 of " number theory" by Borevich and Shefarevich you will find a sequence that leads to 7-adic numbers. The sequence depends on the solution of a linear equation at every stage. An alternate method using pari is illustrated below: 10 = = 3 (mod 7) 108== 10(mod 7^2) 451 = = 108 (mod 7^3) we now use code: {is(n) = Mod((108 + 343*n),7^4)^2 = = 2}; select (is,[1..100]). we get a sequence of numbers satisfying the code. The smallest value of n obtained is 6 leading to the next member of above sequence: 2166. Thus we have obtained a sequence ( using pari) without having to solve any linear equation.This can be continued indefinitely.
 2018-06-27, 04:56 #2 VBCurtis     "Curtis" Feb 2005 Riverside, CA 15FE16 Posts Why did you use 108 rather than 59 in the second congruence?
2018-06-27, 12:29   #3
CRGreathouse

Aug 2006

5,987 Posts

Quote:
 Originally Posted by devarajkandadai On page 19 of " number theory" by Borevich and Shefarevich you will find a sequence that leads to 7-adic numbers. The sequence depends on the solution of a linear equation at every stage. An alternate method using pari is illustrated below: 10 = = 3 (mod 7) 108== 10(mod 7^2) 451 = = 108 (mod 7^3) we now use code: {is(n) = Mod((108 + 343*n),7^4)^2 = = 2}; select (is,[1..100]). we get a sequence of numbers satisfying the code. The smallest value of n obtained is 6 leading to the next member of above sequence: 2166. Thus we have obtained a sequence ( using pari) without having to solve any linear equation.This can be continued indefinitely.
So instead of solving a linear equation, you had gp solve 100 linear equations.

2018-06-27, 14:04   #4
Dr Sardonicus

Feb 2017
Nowhere

5×11×113 Posts

Quote:
 Originally Posted by CRGreathouse So instead of solving a linear equation, you had gp solve 100 linear equations.
Why not use polhensellift() or factorpadic()?

2018-06-27, 14:25   #5
CRGreathouse

Aug 2006

5,987 Posts

Quote:
 Originally Posted by Dr Sardonicus Why not use polhensellift() or factorpadic()?
The GP code in A034945 just uses the built-in p-adic type. It takes 9 milliseconds to find the 100,000-th term on my machine. devaraj, feel free to compare to your code, I'm not sure how to extend it to that case. As a quick check my answer has 84,510 decimal digits and is of the form
Code:
259265345916500277712186481134963754311965201010586807205594069157787134361146417423434312945701993552539489...9746222274903009641714981399405417166669775352016495125084837567091444060752850366048748957882425104
where the ... represents about 84,300 digits.

In fairness, it errors out if I ask for the millionth term:
Code:
> a(10^6)
*** _+_: Warning: increasing stack size to 40000000.
*** _+_: Warning: increasing stack size to 80000000.
***   at top-level: a(10^6)
***                 ^-------
***   in function a: truncate(sqrt(2+O(7^n)))
***                                 ^---------
*** _+_: overflow in precp().
***   Break loop: type 'break' to go back to GP prompt
So maybe you can improve on this!

Last fiddled with by CRGreathouse on 2018-06-27 at 14:51

2018-06-28, 03:03   #6

May 2004

31610 Posts

Quote:
 Originally Posted by VBCurtis Why did you use 108 rather than 59 in the second congruence?
Because 59^2 not congruent to 2 (mod 7^3)

2018-06-28, 10:51   #7

May 2004

4748 Posts

Quote:
 Originally Posted by CRGreathouse So instead of solving a linear equation, you had gp solve 100 linear equations.
I cannot pretend to be a good pari code writer; even the little knowledge i picked up from you.

2018-06-28, 11:21   #8
science_man_88

"Forget I exist"
Jul 2009
Dartmouth NS

2·3·23·61 Posts

Quote:
 Originally Posted by devarajkandadai I cannot pretend to be a good pari code writer; even the little knowledge i picked up from you.

 Similar Threads Thread Thread Starter Forum Replies Last Post devarajkandadai Software 0 2017-09-23 04:31 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 CRGreathouse Software 2 2009-03-13 04:22

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

Mon Jan 30 15:11:02 UTC 2023 up 165 days, 12:39, 1 user, load averages: 1.01, 1.25, 1.19