|
|
A096488
|
|
Number of different terms in a period of continued fraction for square root of n-th repunit.
|
|
1
|
|
|
2, 3, 2, 8, 2, 37, 2, 76, 2, 217, 2, 870, 2, 583, 2, 5034, 2, 28494, 2, 10058, 2, 187966, 2, 383291, 2, 340992, 2
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
2,1
|
|
LINKS
|
|
|
MATHEMATICA
|
Do[Print[Length[Union[Last[ContinuedFraction[((-1+10^n)/9)^(1/2)]]]]], {n, 2, 18}]
|
|
PROG
|
(Python)
from sympy.ntheory.continued_fraction import continued_fraction
from sympy import sqrt
def A096488(n): return len(set(continued_fraction(sqrt((10**n-1)//9))[-1])) # Chai Wah Wu, Mar 30 2021
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,more
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|