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.

A116623 a(0)=1, a(2n) = a(n)+A000079(A000523(2n)), a(2n+1) = 3*a(n) + A000079(A000523(2n+1)+1).

This page as a plain text file.
%I A116623 #18 Jul 09 2025 04:25:44
%S A116623 1,5,7,19,11,29,23,65,19,49,37,103,31,85,73,211,35,89,65,179,53,143,
%T A116623 119,341,47,125,101,287,89,251,227,665,67,169,121,331,97,259,211,601,
%U A116623 85,223,175,493,151,421,373,1087,79,205,157,439,133,367,319,925,121
%N A116623 a(0)=1, a(2n) = a(n)+A000079(A000523(2n)), a(2n+1) = 3*a(n) + A000079(A000523(2n+1)+1).
%C A116623 Viewed as a binary tree, this is (1); 5; 7,19; 11,29,23,65; ... Related to the parity vectors of Collatz and Terras trajectories.
%H A116623 <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a>
%p A116623 A116623 := proc(n)
%p A116623     option remember;
%p A116623     if n = 0 then
%p A116623         1;
%p A116623     elif type(n,'even') then
%p A116623         procname(n/2)+2^A000523(n) ;
%p A116623     else
%p A116623         3*procname(floor(n/2))+2^(1+A000523(n)) ;
%p A116623     end if;
%p A116623 end proc: # _R. J. Mathar_, Nov 28 2016
%t A116623 a[n_] := a[n] = Which[n == 0, 1, EvenQ[n], a[n/2] + 2^Floor@Log2[n], True, 3a[Floor[n/2]] + 2^(1 + Floor@Log2[n])];
%t A116623 Table[a[n], {n, 0, 56}] (* _Jean-François Alcover_, Sep 01 2023 *)
%o A116623 (MIT/GNU Scheme)
%o A116623 (define (A116623 n) (cond ((zero? n) 1) ((even? n) (+ (A116623 (/ n 2)) (expt 2 (A000523 n)))) (else (+ (* 3 (A116623 (/ (- n 1) 2))) (expt 2 (+ 1 (A000523 n)))))))
%Y A116623 Cf. a(n) = A116640(A059893(n)). a(A000225(n)) = A001047(n+1). For n>= 1 a(A000079(n)) = A062709(n+1). A116641 gives the terms in ascending order and without duplicates.
%K A116623 nonn,tabf
%O A116623 0,2
%A A116623 _Antti Karttunen_, Feb 20 2006. Proposed by Pierre Lamothe (plamothe(AT)aei.ca), May 21 2004