login
A375484
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
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, 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, -7, -28, 6, 6, 6, -2, 6, 11, 11, 11, 11, 24, 3, 3, 3, -18, 16
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
Sequence in context: A361381 A054708 A112229 * A087419 A338095 A050979
KEYWORD
sign
AUTHOR
Michael J Norris, Aug 17 2024
STATUS
approved