%I #8 Feb 06 2025 12:05:09
%S 3,10,14,36,51,60,136,141,248,528,819,910,1008,2080,4064,5041,8256,
%T 13107,15420,16320
%N Card numbers (not equal to a power of 2) for top card reappearing at the top after three shuffles (Monthly problem 12008).
%C Powers of 2 are excluded. If they are included we get A328092.
%H P. Korus (Proposer), <a href="https://www.jstor.org/stable/48661400">A slow shuffle</a>, Problem 12008, Amer. Math. Monthly, 126 (No. 8, 2019), pp. 756-759.
%p isA328091 := proc(n)
%p local kl,k,l,m,d ;
%p # kl is k+l
%p for kl from 0 do
%p # 2^k<=2n, 2^(k-1)<=n, k-1 <=log2(n), k<=log2(n)+1 and l<k, so k+l<=2*log2(n)+2
%p if kl > 2*ilog2(n)+2 then
%p return false ;
%p end if;
%p # kl=l+k, l < k
%p for k from floor(kl/2) to kl do
%p l := kl-k ;
%p if l < k and l >= 0 then
%p for m from 0 to k-1 do
%p d := (2^(kl+2)-2^(l+1)+1) / (2^(l+m+3)-2^(m+2)+1) ;
%p if type (d,'integer') and n = 2^m*d then
%p return true ;
%p end if;
%p end do:
%p end if:
%p end do:
%p end do:
%p end proc:
%p for n from 2 do
%p if isA328091(n) then
%p print(n) ;
%p end if;
%p end do: # _R. J. Mathar_, Feb 06 2025
%Y Cf. A328092.
%K nonn,more,changed
%O 1,1
%A _N. J. A. Sloane_, Oct 17 2019
%E Extended to 20 terms by _R. J. Mathar_, Feb 06 2025