login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A213714 Inverse function for injection A005187. 24
0, 1, 0, 2, 3, 0, 0, 4, 5, 0, 6, 7, 0, 0, 0, 8, 9, 0, 10, 11, 0, 0, 12, 13, 0, 14, 15, 0, 0, 0, 0, 16, 17, 0, 18, 19, 0, 0, 20, 21, 0, 22, 23, 0, 0, 0, 24, 25, 0, 26, 27, 0, 0, 28, 29, 0, 30, 31, 0, 0, 0, 0, 0, 32, 33, 0, 34, 35, 0, 0, 36, 37, 0, 38, 39, 0, 0, 0, 40, 41, 0, 42, 43, 0, 0, 44, 45, 0, 46, 47, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,4
COMMENTS
a(0)=0; thereafter if n occurs as a term of A005187, a(n)=its position in A005187, otherwise zero. This works as an "inverse" function for A005187 in a sense that a(A005187(n)) = n for all n.
a(n)*A234017(n) = 0 for all n.
LINKS
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
Can be used when computing A213715, A213723, A213724, A233275, A233277. Cf. A005187, A046699, A079559, A234017, A230414.
Sequence in context: A072741 A131360 A338780 * A242011 A353612 A368243
KEYWORD
nonn
AUTHOR
Antti Karttunen, Oct 26 2012
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 18 22:56 EDT 2024. Contains 370952 sequences. (Running on oeis4.)