A353497 The smallest prime factor of n, reduced modulo 4, with a(1) = 1.
1, 2, 3, 2, 1, 2, 3, 2, 3, 2, 3, 2, 1, 2, 3, 2, 1, 2, 3, 2, 3, 2, 3, 2, 1, 2, 3, 2, 1, 2, 3, 2, 3, 2, 1, 2, 1, 2, 3, 2, 1, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 1, 2, 1, 2, 3, 2, 3, 2, 1, 2, 3, 2, 1, 2, 3, 2, 3, 2, 3, 2, 1, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 1, 2, 3, 2, 1, 2, 3, 2, 3, 2, 1, 2, 1, 2, 3, 2, 1, 2, 3, 2, 3
Offset: 1
Keywords
Links
- Antti Karttunen, Table of n, a(n) for n = 1..65537
Programs
-
Mathematica
a[n_] := Mod[FactorInteger[n][[1, 1]], 4]; Array[a, 100] (* Amiram Eldar, Apr 26 2022 *)
-
PARI
A020639(n) = if(1==n,n,vecmin(factor(n)[, 1])); A353497(n) = (A020639(n)%4);
-
Python
from sympy import factorint def a(n): return 1 if n==1 else (2 if n%2==0 else min(factorint(n))%4) print([a(n) for n in range(1, 106)]) # Michael S. Branicky, Apr 26 2022