cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A072400 (Factors of 4 removed from n) modulo 8.

Original entry on oeis.org

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, 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, 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
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 16 2002

Keywords

Comments

a(n) <> 7 iff n equals the sum of 3 integer squares.
a(A004215(k)) = 7 for k>0;

Examples

			From _Michael De Vlieger_, May 08 2017: (Start)
a(4) = 1 since 4 = 1 * 4^1 and 4 / 4^1 = 1; 1 = 1 (mod 8).
a(5) = 5 since it is not a multiple of 4; 5 = 5 (mod 8).
a(12) = 3 since 12 = 3 * 4^1 and 12 / 4^1 = 3; 3 = 3 (mod 8).
a(44) = 3 since 44 = 11 * 4^1 and 44 / 4^1 = 11; 3 = 11 (mod 8).
a(64) = 1 since 64 = 1 * 4^3 and 64 / 4^3 = 1; 1 = 1 (mod 8). (End)
		

Crossrefs

Programs

  • Mathematica
    Array[Mod[If[Mod[#, 4] == 0, #/4^IntegerExponent[#, 4], #], 8] &, 96] (* Michael De Vlieger, May 08 2017 *)
  • PARI
    a(n) = (n >> (2*valuation(n, 4))) % 8; \\ Amiram Eldar, May 15 2025
  • Python
    def A072400(n): return (n>>((~n&n-1).bit_length()&-2))&7 # Chai Wah Wu, Aug 01 2023
    

Formula

a(n) = A065883(n) mod 8.
A072401(n) = 1 - A057427(7 - a(n)).
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 4. - Amiram Eldar, May 15 2025

Extensions

Offset corrected (from 0 to 1) by Antti Karttunen, May 08 2017