OFFSET
0,4
COMMENTS
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..8192
FORMULA
a(0)=0, for n>0, a(n) = A079559(n) * (A046699(n+2)-1) [With A046699's October 2012 starting offset. Incorrect indexing shown in this formula corrected by Antti Karttunen, Dec 18 2013]
PROG
(MIT/GNU Scheme)
(define (A213714 n) (if (< n 1) 0 (* (A079559 n) (- (A046699 (+ n 2)) 1)))) ;; With A046699's October 2012 starting offset.
(Haskell)
import Data.List (genericIndex)
a213714 n = genericIndex a213714_list n
a213714_list = f [0..] a005187_list 0 where
f (x:xs) ys'@(y:ys) i | x == y = i : f xs ys (i+1)
| otherwise = 0 : f xs ys' i
-- Reinhard Zumkeller, May 01 2015
(Python)
from sympy import factorial
def a046699(n):
if n<3: return 1
s=1
while factorial(2*s)%(2**(n - 1))>0: s+=1
return s
def a053644(n): return 0 if n==0 else 2**(len(bin(n)[2:]) - 1)
def a043545(n):
x=bin(n)[2:]
return int(max(x)) - int(min(x))
def a079559(n): return 1 if n==0 else a043545(n + 1)*a079559(n + 1 - a053644(n + 1))
def a(n): return 0 if n==0 else a079559(n)*(a046699(n + 2) - 1) # Indranil Ghosh, Jun 11 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Oct 26 2012
STATUS
approved