OFFSET
1,2
COMMENTS
This sequence contains, in addition to the information contained in A286364 (which packs the values of A286361(n) and A286363(n) to a single value with the pairing function A000027), also the highest power of 2 dividing n. Note that this is more information than A286365, as it stores only the parity of the exponent of 2.
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..10000
Eric Weisstein's World of Mathematics, Pairing Function
PROG
(Scheme) (define (A286367 n) (* (/ 1 2) (+ (expt (+ (A001511 n) (A286364 n)) 2) (- (A001511 n)) (- (* 3 (A286364 n))) 2)))
(Python)
from sympy import factorint
from operator import mul
def P(n):
f = factorint(n)
return sorted([f[i] for i in f])
def a046523(n):
x=1
while True:
if P(n) == P(x): return x
else: x+=1
def A(n, k):
f = factorint(n)
return 1 if n == 1 else reduce(mul, [1 if i%4==k else i**f[i] for i in f])
def T(n, m): return ((n + m)**2 - n - 3*m + 2)/2
def a286364(n): return T(a046523(n/A(n, 1)), a046523(n/A(n, 3)))
def a001511(n): return 2 + bin(n - 1)[2:].count("1") - bin(n)[2:].count("1")
def a(n): return T(a001511(n), a286364(n)) # Indranil Ghosh, May 09 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, May 08 2017
STATUS
approved