login
A377092
a(0) = 0, and for any n > 0, a(n) is the least integer (in absolute value) not yet in the sequence such that the absolute difference of a(n-1) and a(n) is a Fibonacci number (A000045); in case of a tie, preference is given to the positive value.
7
0, 1, -1, 2, 3, -2, -3, -4, 4, 5, 6, 7, -6, -5, -7, -8, -9, -10, 11, 8, 9, 10, -11, -12, -13, -14, -15, -16, -17, 17, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, -27, -19, -18, -20, -21, -22, -23, -24, -25, -26, -28, -29, -30, -31, -32, -33
OFFSET
0,4
COMMENTS
Will every integer appear in the sequence?
That question is still open, although I conjecture that the answer is Yes. This sequence could be called the Heraclitus transform of the Fibonacci numbers. For other examples of Heraclitus transforms, see A377091, etc. - N. J. A. Sloane, Feb 16 2026
EXAMPLE
The initial terms are:
n a(n) |a(n)-a(n-1)|
--- ----- ---------------
0 0 N/A
1 1 1
2 -1 2
3 2 3
4 3 1
5 -2 5
6 -3 1
7 -4 1
8 4 8
9 5 1
10 6 1
11 7 1
12 -6 13
13 -5 1
14 -7 2
The first two terms are a(0) = 0, a(1) = 1. Then a(2) = -1, which is clearly the |smallest| unused number so far, and gives |a(2)-a(1)| = 2, a Fibonacci number. - M. F. Hasler, Feb 21 2025
MATHEMATICA
A377092list[nmax_] := Module[{s, a, u = 1, fibQ},
fibQ[n_] := fibQ[n] = (IntegerQ[Sqrt[# + 4]] || IntegerQ[Sqrt[# - 4]]) & [5*n^2];
s[_] := False; s[0] = True;
NestList[(While[s[u] && s[-u], u++]; a = u; While[s[a] || !fibQ[Abs[# - a]], a = Boole[a < 0] - a]; s[a] = True; a) &, 0, nmax]];
A377092list[100] (* Paolo Xausa, Apr 19 2025 *)
PROG
(PARI) \\ See Links section.
(PARI) A377092_upto(N, U=[-1])={vector(N, n, if(n>1, for(k=U[1]+1, oo, A010056(k-N) && !setsearch(U, k) && [N=k, break]), N=0); U=setunion(U, [N]); while(#U>1&&U[1]+1==U[2], U=U[^1]); N)} \\ M. F. Hasler, Feb 21 2025
(Python)
def A377092(n):
if not getattr(A := A377092, 'N', 0): A.N = 1; A.terms = [0]
while len(A.terms) <= n:
while (k := A.N) in A.terms: A.N = (k<0)-k
while not A010056(abs(k - A.terms[-1])) or k in A.terms: k = (k<0)-k
A.terms.append(k)
return A.terms[n] # M. F. Hasler, Feb 10 2025
CROSSREFS
Cf. A000045, A377090, A377091, A380320 (first differences), A380321 (partial sums).
Cf. A010056 (characteristic function of the Fibonacci numbers).
Sequence in context: A173540 A336264 A070770 * A292599 A071487 A124071
KEYWORD
sign
AUTHOR
Rémy Sigrist, Oct 16 2024
STATUS
approved