OFFSET
1,2
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..10000
Eric Weisstein's World of Mathematics, Pairing Function
FORMULA
PROG
(PARI)
A001511(n) = (1+valuation(n, 2));
for(n=1, 10000, write("b286451.txt", n, " ", A286451(n)));
(Scheme) (define (A286451 n) (if (= 1 n) 0 (* (/ 1 2) (+ (expt (+ (A286357 n) (A001511 n)) 2) (- (A286357 n)) (- (* 3 (A001511 n))) 2))))
(Python)
from sympy import divisor_sigma as D
def T(n, m): return ((n + m)**2 - n - 3*m + 2)/2
def a001511(n): return bin(n)[2:][::-1].index("1") + 1
def a(n): return 0 if n==1 else T(a001511(D(n)), a001511(n)) # Indranil Ghosh, May 14 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, May 13 2017
STATUS
approved