login
(Factors of 4 removed from n) modulo 8.
5

%I #18 Aug 01 2023 15:14:25

%S 1,2,3,1,5,6,7,2,1,2,3,3,5,6,7,1,1,2,3,5,5,6,7,6,1,2,3,7,5,6,7,2,1,2,

%T 3,1,5,6,7,2,1,2,3,3,5,6,7,3,1,2,3,5,5,6,7,6,1,2,3,7,5,6,7,1,1,2,3,1,

%U 5,6,7,2,1,2,3,3,5,6,7,5,1,2,3,5,5,6,7,6,1,2,3,7,5,6,7,6

%N (Factors of 4 removed from n) modulo 8.

%C a(n) <> 7 iff n equals the sum of 3 integer squares.

%C a(A004215(k)) = 7 for k>0;

%H Antti Karttunen, <a href="/A072400/b072400.txt">Table of n, a(n) for n = 1..10000</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/SquareNumber.html">Square Numbers.</a>

%F a(n) = A065883(n) mod 8.

%F A072401(n) = 1 - A057427(7 - a(n)).

%e From _Michael De Vlieger_, May 08 2017: (Start)

%e a(4) = 1 since 4 = 1 * 4^1 and 4 / 4^1 = 1; 1 = 1 (mod 8).

%e a(5) = 5 since it is not a multiple of 4; 5 = 5 (mod 8).

%e a(12) = 3 since 12 = 3 * 4^1 and 12 / 4^1 = 3; 3 = 3 (mod 8).

%e a(44) = 3 since 44 = 11 * 4^1 and 44 / 4^1 = 11; 3 = 11 (mod 8).

%e a(64) = 1 since 64 = 1 * 4^3 and 64 / 4^3 = 1; 1 = 1 (mod 8).

%e (End)

%t Array[Mod[If[Mod[#, 4] == 0, #/4^IntegerExponent[#, 4], #], 8] &, 96] (* _Michael De Vlieger_, May 08 2017 *)

%o (Python)

%o def A072400(n): return (n>>((~n&n-1).bit_length()&-2))&7 # _Chai Wah Wu_, Aug 01 2023

%Y Cf. A000378, A004215, A057427, A065883, A072401, A286366.

%K nonn

%O 1,2

%A _Reinhard Zumkeller_, Jun 16 2002

%E Offset corrected (from 0 to 1) by _Antti Karttunen_, May 08 2017