cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

This page as a plain text file.
%I A285712 #22 Oct 24 2020 18:05:37
%S A285712 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 A285712 27,30,11,17,31,12,34,36,13,18,37,14,40,20,15,42,28,16,26,45,17,49,51,
%U A285712 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 A285712 a(1) = 0, and for n > 1, if n = 3k-1, then a(n) = k, otherwise a(n) = (A064216(n)+1)/2.
%C A285712 For n >= 2, a(n) gives the contents of the parent node of the node containing n in binary trees like A245612.
%C A285712 Every positive integer greater than one occurs exactly twice in this sequence.
%H A285712 Antti Karttunen, <a href="/A285712/b285712.txt">Table of n, a(n) for n = 1..8192</a>
%F A285712 a(1) = 0, and for n > 1, if n = 3*k-1, then a(n) = k, otherwise a(n) = (A064216(n)+1)/2.
%F A285712 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 A285712 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 A285712 (Scheme) (define (A285712 n) (cond ((<= n 1) (- n 1)) ((= 2 (modulo n 3)) (A002264 (+ 1 n))) (else (/ (+ 1 (A064216 n)) 2))))
%Y A285712 Cf. A002264, A048673, A064216, A245612, A285713, A285714.
%K A285712 nonn
%O A285712 1,3
%A A285712 _Antti Karttunen_, Apr 25 2017