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.

A297216 a(0)=1; a(1)=1; for n >= 2, a(n) = a(n-A000120(n)) + a(n-1-A023416(n)).

This page as a plain text file.
%I A297216 #21 Jun 02 2025 12:23:36
%S A297216 1,1,2,3,4,6,8,12,16,20,28,36,48,64,84,120,156,184,240,312,396,480,
%T A297216 624,792,1020,1248,1584,2040,2496,3288,4080,5664,7248,8160,10536,
%U A297216 12912,16200,18696,23448,29112,36360,42144,52560,65472,78504,94704,118032,147264,183504,212736
%N A297216 a(0)=1; a(1)=1; for n >= 2, a(n) = a(n-A000120(n)) + a(n-1-A023416(n)).
%C A297216 for n >= 6, a(n) = k(n) * (a(0) + 3*a(1)).
%H A297216 B. Balamohan, A. Kuznetsov and S. Tanny, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL10/Tanny/tanny3.html">On the behavior of a variant of Hofstadter's Q-sequence</a>, J. Integer Sequences, Vol. 10 (2007), Article 07.7.1.
%H A297216 Nathaniel D. Emerson, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL9/Emerson/emerson6.html">A Family of Meta-Fibonacci Sequences Defined by Variable-Order Recursions</a>, J. Integer Sequences, Vol. 9 (2006), Article 06.1.8.
%e A297216 n=7, A000120(7)=3, A023416(7)=0. a(7) = a(4)+a(6) = a(3)+a(1)+a(4)+a(4) = 3*(a(3)+a(1)) = 3*(a(1)+a(2)+a(1)) = 3*(a(0)+3*a(1)). a(7)=12; k(7)=3.
%p A297216 A297216 := proc(n)
%p A297216     option remember ;
%p A297216     if n <=1 then
%p A297216         1;
%p A297216     else
%p A297216         procname(n-wt(n))+procname(n-1-A023416(n)) ;
%p A297216     end if;
%p A297216 end proc:
%p A297216 seq(A297216(n),n=0..30) ; # _R. J. Mathar_, Jun 19 2021
%t A297216 a[0] = a[1] = 1; a[n_] := a[n] = a[n - DigitCount[n, 2, 1]] + a[n - 1 - DigitCount[n, 2, 0]]; Array[a, 50, 0] (* _Amiram Eldar_, Aug 01 2023 *)
%o A297216 (PARI) a(n) = if (n<=1, 1, a(n-hammingweight(n)) + a(n-1-(#binary(n)-hammingweight(n)))); \\ _Michel Marcus_, Dec 27 2017
%Y A297216 Cf. A000120, A023416.
%K A297216 nonn,base
%O A297216 0,3
%A A297216 _Ctibor O. Zizka_, Dec 27 2017
%E A297216 More terms from _Michel Marcus_, Dec 27 2017
%E A297216 Offset corrected by _R. J. Mathar_, Jun 19 2021