login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A284013 a(n) = n - A002487(n). 6
0, 0, 1, 1, 3, 2, 4, 4, 7, 5, 7, 6, 10, 8, 11, 11, 15, 12, 14, 12, 17, 13, 17, 16, 22, 18, 21, 19, 25, 22, 26, 26, 31, 27, 29, 26, 32, 26, 31, 29, 37, 30, 34, 30, 39, 33, 39, 38, 46, 40, 43, 39, 47, 40, 46, 44, 53, 47, 51, 48, 56, 52, 57, 57, 63, 58, 60, 56, 63, 55, 61, 58, 68, 58, 63, 57, 69, 60, 68, 66, 77, 67, 71, 64, 76, 64 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,5

LINKS

Antti Karttunen, Table of n, a(n) for n = 0..8192

FORMULA

a(n) = n - A002487(n).

MATHEMATICA

a[n_] :=If[n<2, n, If[ EvenQ[n], a[n/2], a[(n - 1)/2] + a[(n + 1)/2]]]; Table[n - a[n], {n , 0, 100}] (* Indranil Ghosh, Mar 23 2017 *)

PROG

(Scheme) (define (A284013 n) (- n (A002487 n))) ;; Code for A002487 given under that entry.

(PARI)

A(n) = if(n<2, n, if(n%2, A(n\2) + A((n + 1)/2), A(n/2)));

for(n=0, 151, print1(n - A(n), ", ")) \\ Indranil Ghosh, Mar 23 2017

(Python)

def a(n): return n if n<2 else (a(n/2) if n%2==0 else a((n - 1)/2) + a((n + 1)/2))

print [n - a(n) for n in range(0, 101)] # Indranil Ghosh, Mar 23 2017

CROSSREFS

Cf. A002487, A265397, A283474, A284007.

Sequence in context: A033177 A175512 A240829 * A241412 A241445 A147604

Adjacent sequences:  A284010 A284011 A284012 * A284014 A284015 A284016

KEYWORD

nonn

AUTHOR

Antti Karttunen, Mar 23 2017

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified January 28 06:59 EST 2021. Contains 340490 sequences. (Running on oeis4.)