%I #22 May 21 2024 08:46:12
%S 1,1,2,1,3,1,2,2,4,1,3,1,3,2,4,2,5,3,3,1,5,1,4,2,4,3,5,2,6,4,4,6,6,1,
%T 7,1,5,1,5,1,7,2,3,1,8,1,6,2,5,3,7,2,9,2,4,3,8,2,8,4,6,4,10,2,7,9,3,5,
%U 11,1,5,3,7,1,6,1,10,1,3,4,9,2,7,1,5,1,5,2,12,2,3,2,11,1,6,8,6,9,7,2,12,3,4
%N Number of values of k, 0 <= k <= n, satisfying A002487(k) = A002487(n).
%C This sequence is the ordinal transform of A002487. - _Rémy Sigrist_, Dec 28 2022
%H Rémy Sigrist, <a href="/A091948/b091948.txt">Table of n, a(n) for n = 0..8192</a>
%H Rémy Sigrist, <a href="/A091948/a091948.gp.txt">PARI program</a>
%H <a href="/index/St#Stern">Index entries for sequences related to Stern's sequences</a>
%F a(n) = 1 iff n belongs to A091945. - _Rémy Sigrist_, Dec 28 2022
%p b:= proc(n) option remember; `if`(n<2, n,
%p (q-> b(q)+(n-2*q)*b(n-q))(iquo(n, 2)))
%p end:
%p p:= proc() 0 end:
%p a:= proc(n) option remember; local t;
%p t:= b(n); p(t):= p(t)+1
%p end:
%p seq(a(n), n=0..100); # _Alois P. Heinz_, Dec 31 2022
%t b[n_] := b[n] = If[n < 2, n,
%t Function[q, b[q] + (n - 2*q)*b[n - q]][Quotient[n, 2]]];
%t p[_] = 0;
%t a[n_] := a[n] = With[{t = b[n]}, p[t] = p[t]+1];
%t Table[a[n], {n, 0, 100}] (* _Jean-François Alcover_, May 20 2024, after _Alois P. Heinz_ *)
%o (PARI) \\ See Links section.
%Y Cf. A002487, A091945.
%K nonn,look
%O 0,3
%A _Benoit Cloitre_, Mar 11 2004
%E a(0) = 1 prepended and name adapted by _Rémy Sigrist_, Dec 28 2022
|