a(n) = n mod (spf(n)+1), where spf(n) is the smallest prime dividing n (A020639).

A080063

a(n) = n mod (spf(n)+1), where spf(n) is the smallest prime dividing n (A020639).

Terms

    a(0) =1a(1) =2a(2) =3a(3) =1a(4) =5a(5) =0a(6) =7a(7) =2a(8) =1a(9) =1a(10) =11a(11) =0a(12) =13a(13) =2a(14) =3a(15) =1a(16) =17a(17) =0a(18) =19a(19) =2a(20) =1a(21) =1a(22) =23a(23) =0a(24) =1a(25) =2a(26) =3a(27) =1a(28) =29a(29) =0

External references