OFFSET
1,3
COMMENTS
This sequence is well defined:
- a(1) = 0,
- for any n > 1, 1/(n-1) is in reduced form, so fusc(k) = 1 and fusc(k+1) = n-1 for some k, and a(n) <= k.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..8192
Rémy Sigrist, PARI program
EXAMPLE
The first terms are:
n a(n) fusc(a(n)) fusc(a(n)+1)
--- ----- ---------- ------------
1 0 0 1
2 1 1 1
3 2 1 2
4 4 1 3
5 5 3 2
6 16 1 5
7 9 4 3
8 10 3 5
9 17 5 4
10 19 7 3
PROG
(PARI) See Links section.
(Python)
def A359050(n):
f, g, k = 0, 1, 0
while f+g-n:
k += 1
m, a = k+1, [1, 0]
while m:
a[m&1] = sum(a)
m >>=1
f, g = g, a[1]
return k # Chai Wah Wu, Dec 16 2022
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Rémy Sigrist, Dec 14 2022
STATUS
approved