login
a(n) = r in a log_2-like sequence of algebraic integers f(n) = (r+phi*s), where phi = (1+sqrt(5))/2 is the golden ratio.
1

%I #33 Sep 25 2024 09:29:40

%S 0,1,0,2,4,1,-2,3,0,5,10,2,7,-1,4,4,9,1,-7,6,-2,11,24,3,8,8,0,0,-8,5,

%T 5,5,10,10,2,2,15,-6,7,7,20,-1,-22,12,4,25,59,4,-4,9,9,9,22,1,14,1,-7,

%U -7,-28,6,6,6,-2,6,11,11,11,11,24,3,3,3,-18,16

%N a(n) = r in a log_2-like sequence of algebraic integers f(n) = (r+phi*s), where phi = (1+sqrt(5))/2 is the golden ratio.

%C The corresponding s value is A375493(n).

%C f(n) is logarithmic with f(x*y) = f(x) + f(y) and in particular this requires f(1) = 0.

%C The value of f(2) is chosen to be f(2) = 1.

%C For odd primes n, f(n) is a linear interpolation f(p) = ( f(p-1) + phi*f(p+1) ) / (1 + phi), biased towards the higher f(p+1).

%C Since 1/(1 + phi) = 2 - phi, the r and s coefficients are always integers.

%C The two sequences can also be generated by a pair of co-recursive integer functions with no reference to phi.

%C The sequence is not injective and not monotonic.

%F f(n) = a(n) + phi*A375493(n).

%e n = 87654321

%e a(n) = 441

%e A375493(n) = -256

%e f(n) = 441+phi*(-256) = 26.78329888

%e Compare log_2(87654321) = 26.38532187

%o (Python)

%o from sympy import primefactors, isprime

%o def a(n): # the present sequence

%o if n in {1,2}: return n-1

%o if isprime(n): return 2*a(n-1) + b(n+1) - (a(n+1) + b(n-1))

%o return (lambda f: a(f) + a(n//f))(primefactors(n)[0])

%o def b(n): # A375493

%o if n in {1,2}: return 0

%o if isprime(n): return b(n-1) + a(n+1) - a(n-1)

%o return (lambda f: b(f) + b(n//f))(primefactors(n)[0])

%Y Cf. A001622, A375493.

%K sign

%O 1,4

%A _Michael J Norris_, Aug 17 2024