OFFSET
1,4
COMMENTS
The corresponding s value is A375493(n).
f(n) is logarithmic with f(x*y) = f(x) + f(y) and in particular this requires f(1) = 0.
The value of f(2) is chosen to be f(2) = 1.
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).
Since 1/(1 + phi) = 2 - phi, the r and s coefficients are always integers.
The two sequences can also be generated by a pair of co-recursive integer functions with no reference to phi.
The sequence is not injective and not monotonic.
FORMULA
f(n) = a(n) + phi*A375493(n).
EXAMPLE
n = 87654321
a(n) = 441
A375493(n) = -256
f(n) = 441+phi*(-256) = 26.78329888
Compare log_2(87654321) = 26.38532187
PROG
(Python)
from sympy import primefactors, isprime
def a(n): # the present sequence
if n in {1, 2}: return n-1
if isprime(n): return 2*a(n-1) + b(n+1) - (a(n+1) + b(n-1))
return (lambda f: a(f) + a(n//f))(primefactors(n)[0])
def b(n): # A375493
if n in {1, 2}: return 0
if isprime(n): return b(n-1) + a(n+1) - a(n-1)
return (lambda f: b(f) + b(n//f))(primefactors(n)[0])
CROSSREFS
KEYWORD
sign
AUTHOR
Michael J Norris, Aug 17 2024
STATUS
approved