|
|
A034945
|
|
Successive approximations to 7-adic integer sqrt(2).
|
|
3
|
|
|
0, 3, 10, 108, 2166, 4567, 38181, 155830, 1802916, 24862120, 266983762, 1961835256, 5916488742, 19757775943, 116646786350, 9611769806236, 42844700375837, 275475214363044, 6789129606004840, 75182500718243698
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
REFERENCES
|
K. Mahler, Introduction to p-Adic Numbers and Their Functions, Cambridge, 1973, p. 35.
|
|
LINKS
|
|
|
PROG
|
(PARI) seq(n)={my(v=vector(n), i=1, k=0); while(i<#v, k++; my(t=truncate(sqrt(2 + O(7^k)))); if(t > v[i], i++; v[i]=t)); v} \\ Andrew Howroyd, Nov 03 2018
(Ruby)
ary = [0]
a, mod = 3, 7
while ary.size - 1 < n
b = a % mod
ary << b if b != ary[-1]
a = b * b + b - 2
mod *= 7
end
ary
end
(Python)
def a034945(n):
ary=[0]
a, mod=3, 7
while len(ary) - 1<n:
b=a%mod
if b!=ary[-1]: ary.append(b)
a=b**2 + b - 2
mod*=7
return ary
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|