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.
%I A250480 #17 Apr 14 2023 12:06:38 %S A250480 0,2,3,1,5,1,7,1,2,1,11,1,13,1,2,1,17,1,19,1,2,1,23,1,4,1,2,1,29,1,31, %T A250480 1,2,1,4,1,37,1,2,1,41,1,43,1,2,1,47,1,6,1,2,1,53,1,4,1,2,1,59,1,61,1, %U A250480 2,1,4,1,67,1,2,1,71,1,73,1,2,1,6,1,79,1,2,1,83,1,4,1,2,1,89 %N A250480 a(1) = 0, and for n > 1: if n is a prime, a(n) = n, otherwise a(n) = A020639(n) - 1, where A020639(n) gives the least prime dividing n. %H A250480 Antti Karttunen, <a href="/A250480/b250480.txt">Table of n, a(n) for n = 1..10000</a> %F A250480 a(n) = n for all prime n, and a(n) = A020639(n) - 1 for all composite n. %F A250480 a(n) = A020639(n) - A005171(n). %t A250480 Join[{0},Table[If[PrimeQ[n],n,FactorInteger[n][[1,1]]-1],{n,2,100}]] (* _Harvey P. Dale_, Apr 14 2023 *) %o A250480 (Scheme) (define (A250480 n) (if (prime? n) n (- (A020639 n) 1))) %Y A250480 Cf. also A005171 (characteristic function for nonprimes), A020639 (the smallest prime divisor of n). %Y A250480 Differs from A251758 for the first time at n = 2431 = 11*13*17, where a(2431) = 10, while A251758(2431) = 9. %K A250480 nonn %O A250480 1,2 %A A250480 _Antti Karttunen_ & _Michel Lagneau_, Dec 09 2014