%I #17 Dec 14 2025 14:02:52
%S 1,2,3,4,6,8,9,12,13,16,18,23,24,26,32,35,36,46,48,51,52,59,64,70,72,
%T 73,79,92,93,96,102,104,105,118,128,140,141,144,146,158,183,184,186,
%U 192,204,205,208,210,236,256,279,280,282,288,291,292,316,366,368,371,372,384,407,408,410,416,419,420,472,512
%N Numbers k such that Stern polynomial B(3*k,x) is equal to B(3,x) * B(k,x).
%C Positions of nonzero terms on the third row of array A391260.
%C If n is present, then 2*n is also present, and vice versa.
%H Antti Karttunen, <a href="/A391338/b391338.txt">Table of n, a(n) for n = 1..3094</a>
%o (PARI)
%o memo_for_ps = Map();
%o ps(n) = if(n<2, n, my(v); if(mapisdefined(memo_for_ps,n,&v), v, v = if(n%2, ps(n\2)+ps(n\2+1), 'x*ps(n\2)); if(n%2, mapput(memo_for_ps,n,v)); (v))); \\ Only memoize on odd n...
%o is_A391338(n) = (ps(3*n)==ps(3)*ps(n));
%Y Cf. A391260, A391339 (complement), A391340 (odd terms).
%Y Cf. A125184, A260443 for a description of Stern polynomials.
%Y Cf. also A391348.
%K nonn
%O 1,2
%A _Antti Karttunen_, Dec 08 2025