login
A196747
Numbers n such that 3 does not divide swing(n) = A056040(n).
4
0, 1, 2, 6, 7, 8, 18, 19, 20, 24, 25, 26, 54, 55, 56, 60, 61, 62, 72, 73, 74, 78, 79, 80, 162, 163, 164, 168, 169, 170, 180, 181, 182, 186, 187, 188, 216, 217, 218, 222, 223, 224, 234, 235, 236, 240, 241, 242, 486, 487, 488, 492, 493, 494, 504, 505, 506, 510
OFFSET
1,3
MAPLE
SwingExp := proc(m, n) local p, q; p := m;
do q := iquo(n, p);
if (q mod 2) = 1 then RETURN(1) fi;
if q = 0 then RETURN(0) fi;
p := p * m;
od end:
Search := proc(n, L) local m, i, r; m := n;
for i in L do r := SwingExp(i, m);
if r <> 0 then RETURN(NULL) fi
od; n end:
A196747_list := n -> Search(n, [3]): # n is a search limit
MATHEMATICA
(* A naive solution *) sf[n_] := n!/Quotient[n, 2]!^2; Select[Range[0, 600], ! Divisible[sf[#], 3] &] (* Jean-François Alcover, Jun 28 2013 *)
PROG
(PARI) valp(n, p)=my(s); while(n\=p, s+=n); s
is(n)=my(t=valp(n, 3)); t%2==0 && 2*valp(n\2, 3)==t \\ Charles R Greathouse IV, Feb 02 2016
KEYWORD
nonn
AUTHOR
Peter Luschny, Oct 06 2011
STATUS
approved