A091948 Number of values of k, 0 <= k <= n, satisfying A002487(k) = A002487(n).
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, 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, 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
Offset: 0
Links
- Rémy Sigrist, Table of n, a(n) for n = 0..8192
- Rémy Sigrist, PARI program
- Index entries for sequences related to Stern's sequences
Programs
-
Maple
b:= proc(n) option remember; `if`(n<2, n, (q-> b(q)+(n-2*q)*b(n-q))(iquo(n, 2))) end: p:= proc() 0 end: a:= proc(n) option remember; local t; t:= b(n); p(t):= p(t)+1 end: seq(a(n), n=0..100); # Alois P. Heinz, Dec 31 2022
-
Mathematica
b[n_] := b[n] = If[n < 2, n, Function[q, b[q] + (n - 2*q)*b[n - q]][Quotient[n, 2]]]; p[_] = 0; a[n_] := a[n] = With[{t = b[n]}, p[t] = p[t]+1]; Table[a[n], {n, 0, 100}] (* Jean-François Alcover, May 20 2024, after Alois P. Heinz *)
-
PARI
\\ See Links section.
Formula
a(n) = 1 iff n belongs to A091945. - Rémy Sigrist, Dec 28 2022
Extensions
a(0) = 1 prepended and name adapted by Rémy Sigrist, Dec 28 2022
Comments