login
A359050
a(n) is the least k such that fusc(k) + fusc(k+1) = n, where "fusc" is Stern's diatomic series (A002487).
2
0, 1, 2, 4, 5, 16, 9, 10, 17, 19, 18, 22, 21, 34, 36, 46, 38, 37, 41, 94, 42, 70, 69, 76, 75, 73, 77, 133, 74, 82, 86, 139, 137, 85, 141, 157, 138, 268, 162, 148, 146, 289, 150, 154, 182, 166, 149, 283, 165, 169, 276, 274, 281, 637, 170, 292, 282, 307, 314
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.
FORMULA
A002487(a(n)) + A002487(a(n)+1) = n.
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
Cf. A002487.
Sequence in context: A370959 A328230 A229131 * A071316 A056401 A056406
KEYWORD
nonn,look
AUTHOR
Rémy Sigrist, Dec 14 2022
STATUS
approved