20180627, 04:46  #1 
May 2004
2^{2}×79 Posts 
pari and padic numbers
On page 19 of " number theory" by Borevich and Shefarevich you will find a sequence that leads to 7adic 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. 
20180627, 04:56  #2 
"Curtis"
Feb 2005
Riverside, CA
3^{3}·191 Posts 
Why did you use 108 rather than 59 in the second congruence?

20180627, 12:29  #3  
Aug 2006
3·1,993 Posts 
Quote:


20180627, 14:04  #4 
Feb 2017
Nowhere
2×5^{2}×107 Posts 

20180627, 14:25  #5 
Aug 2006
3·1,993 Posts 
The GP code in A034945 just uses the builtin padic type. It takes 9 milliseconds to find the 100,000th 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 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 toplevel: 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 Last fiddled with by CRGreathouse on 20180627 at 14:51 
20180628, 03:03  #6 
May 2004
2^{2}×79 Posts 

20180628, 10:51  #7 
May 2004
474_{8} Posts 

20180628, 11:21  #8 
"Forget I exist"
Jul 2009
Dumbassville
2^{6}×131 Posts 

Thread Tools  
Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
pari padic numbers  devarajkandadai  Software  0  20170923 04:31 
LLL in GP/Pari  paul0  Programming  2  20151117 13:04 
PARI vs GAP  skan  Miscellaneous Math  0  20121216 00:13 
pari  devarajkandadai  Programming  21  20120831 18:08 
64bit Pari?  CRGreathouse  Software  2  20090313 04:22 