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.

A254044 a(1) = 1, for n>1: a(n) = a(A253889(n)) + (1 if n is of the form 3n or 3n+1, otherwise 0).

This page as a plain text file.
%I A254044 #15 Jan 26 2015 08:23:41
%S A254044 1,1,2,2,1,3,3,2,3,2,2,3,2,1,4,4,3,4,5,3,3,3,2,4,3,3,5,3,2,4,5,2,2,5,
%T A254044 3,3,4,2,3,3,1,5,4,4,4,5,4,4,4,3,3,4,4,5,5,5,5,4,3,2,3,3,4,4,3,7,4,2,
%U A254044 3,3,4,4,3,3,4,4,3,5,5,5,6,5,3,4,5,2,5,4,4,5,5,5,5,5,2,5,7,2,3,4,5,5,6,3,6,5,3,6,3,4,5,5,2,7,5,3,5,2,3,5,7,1,4,6,5,5,3,4
%N A254044 a(1) = 1, for n>1: a(n) = a(A253889(n)) + (1 if n is of the form 3n or 3n+1, otherwise 0).
%H A254044 Antti Karttunen, <a href="/A254044/b254044.txt">Table of n, a(n) for n = 1..8192</a>
%F A254044 a(1) = 1, for n>1: a(n) = a(A253889(n)) + [n is of the form 3n or 3n+1, i.e., in A032766] (Here [ ] is Iverson bracket).
%F A254044 a(1) = 0, thereafter, if n = 3k+2, then a(n) = a((n+1)/3), otherwise a(n) = 1 + a(A253889(n)).
%F A254044 a(n) = A000120(A064216(n)). [Binary weight of terms of A064216.]
%F A254044 a(n) = A253894(n) - A254045(n).
%F A254044 Other identities:
%F A254044 a(A007051(n)) = 1 for all n >= 0. [And no 1's in any other positions.]
%o A254044 (Scheme, two versions using memoization-macro definec)
%o A254044 (definec (A254044 n) (if (= 1 n) 1 (+ (A254044 (A253889 n)) (- 1 (floor->exact (/ (modulo n 3) 2))))))
%o A254044 (definec (A254044 n) (cond ((= 1 n) 1) ((= 2 (modulo n 3)) (A254044 (/ (+ 1 n) 3))) (else (+ 1 (A254044 (A253889 n))))))
%o A254044 ;; Alternatively:
%o A254044 (define (A254044 n) (A000120 (A064216 n)))
%Y A254044 Positions of ones: A007051.
%Y A254044 Cf. A000120, A032766, A064216, A253889, A253894, A254045.
%K A254044 nonn
%O A254044 1,3
%A A254044 _Antti Karttunen_, Jan 23 2015