OFFSET
1,2
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..16384
MathWorld, Pairing Function
PROG
(PARI)
A001511(n) = (1+valuation(n, 2));
A000265(n) = (n >> valuation(n, 2));
for(n=1, 16384, write("b286260.txt", n, " ", A286260(n)));
(Scheme) (define (A286260 n) (* (/ 1 2) (+ (expt (+ (A001511 n) (A161942 n)) 2) (- (A001511 n)) (- (* 3 (A161942 n))) 2)))
(Python)
from sympy import factorint, divisors, divisor_sigma
def T(n, m): return ((n + m)**2 - n - 3*m + 2)/2
def a000265(n): return max(list(filter(lambda i: i%2 == 1, divisors(n))))
def a161942(n): return a000265(divisor_sigma(n))
def a001511(n): return 2 + bin(n - 1)[2:].count("1") - bin(n)[2:].count("1")
def a(n): return T(a001511(n), a161942(n)) # Indranil Ghosh, May 07 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, May 07 2017
STATUS
approved