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!)
A285712 a(1) = 0, and for n > 1, if n = 3k-1, then a(n) = k, otherwise a(n) = (A064216(n)+1)/2. 12

%I

%S 0,1,2,3,2,4,6,3,7,9,4,10,5,5,12,15,6,8,16,7,19,21,8,22,13,9,24,11,10,

%T 27,30,11,17,31,12,34,36,13,18,37,14,40,20,15,42,28,16,26,45,17,49,51,

%U 18,52,54,19,55,29,20,33,25,21,14,57,22,64,43,23,66,69,24,39,35,25,70,75,26,44,76,27,48,79,28,82,61,29,84,23,30,87,90,31,47,46,32

%N a(1) = 0, and for n > 1, if n = 3k-1, then a(n) = k, otherwise a(n) = (A064216(n)+1)/2.

%C For n >= 2, a(n) gives the contents of the parent node of the node containing n in binary trees like A245612.

%C Every positive integer greater than one occurs exactly twice in this sequence.

%H Antti Karttunen, <a href="/A285712/b285712.txt">Table of n, a(n) for n = 1..8192</a>

%F a(1) = 0, and for n > 1, if n = 3*k-1, then a(n) = k, otherwise a(n) = (A064216(n)+1)/2.

%F a(n) = (n+1)/3 + (3*A064216(n) - 2*n + 1)*( (n+1)^2 mod 3 )/6, for n>1. - _Ammar Khatab_, Sep 21 2020

%t a[n_] := a[n] = Which[n == 1, 0, Mod[n, 3] == 2, Ceiling[n/3], True, (Times @@ Power[If[# == 1, 1, NextPrime[#, -1]] & /@ First@ #, Last@ #] &@ Transpose@ FactorInteger[2 n - 1] + 1)/2]; Array[a, 95] (* _Michael De Vlieger_, Sep 22 2017 *)

%o (Scheme) (define (A285712 n) (cond ((<= n 1) (- n 1)) ((= 2 (modulo n 3)) (A002264 (+ 1 n))) (else (/ (+ 1 (A064216 n)) 2))))

%Y Cf. A002264, A048673, A064216, A245612, A285713, A285714.

%K nonn

%O 1,3

%A _Antti Karttunen_, Apr 25 2017

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 March 7 19:49 EST 2021. Contains 341931 sequences. (Running on oeis4.)