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 A297113 #33 Feb 02 2025 14:16:55 %S A297113 0,1,2,2,3,2,4,3,3,3,5,3,6,4,3,4,7,3,8,4,4,5,9,4,4,6,4,5,10,3,11,5,5, %T A297113 7,4,4,12,8,6,5,13,4,14,6,4,9,15,5,5,4,7,7,16,4,5,6,8,10,17,4,18,11,5, %U A297113 6,6,5,19,8,9,4,20,5,21,12,4,9,5,6,22,6,5,13,23,5,7,14,10,7,24,4,6,10,11,15,8,6,25 %N A297113 a(1) = 0, a(2) = 1, after which, a(n) = a(n/2) if n is of the form 4k+2, and otherwise a(n) = 1+a(A252463(n)). %C A297113 From _Gus Wiseman_, Apr 06 2019: (Start) %C A297113 Also the number of squares in the Young diagram of the integer partition with Heinz number n that are graph-distance 1 from the lower-right boundary, where the Heinz number of an integer partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k). For example, the partition (6,5,5,3) with Heinz number 7865 has diagram %C A297113 o o o o o o %C A297113 o o o o o %C A297113 o o o o o %C A297113 o o o %C A297113 with inner rim %C A297113 o %C A297113 o %C A297113 o o %C A297113 o o o %C A297113 of size 7, so a(7867) = 7. %C A297113 (End) %H A297113 Antti Karttunen, <a href="/A297113/b297113.txt">Table of n, a(n) for n = 1..12721</a> %H A297113 <a href="/index/Pri#prime_indices">Index entries for sequences computed from indices in prime factorization</a> %F A297113 a(1) = 0, a(2) = 1, after which, a(n) = a(n/2) if n is of the form 4k+2, and otherwise a(n) = 1+a(A252463(n)) . %F A297113 For n > 1, a(n) = A001511(A297112(n)), where A297112(n) = Sum_{d|n} moebius(n/d)*A156552(d). %F A297113 a(n) = A252464(n) - A297155(n). %F A297113 For n > 1, a(n) = 1+A033265(A156552(n)) = 1+A297167(n) = A046660(n) + A061395(n). - Last two sums added by _Antti Karttunen_, Sep 02 2018 %F A297113 Other identities. For all n >= 1: %F A297113 a(A000040(n)) = n. [Each n occurs for the first time at the n-th prime.] %t A297113 Table[If[n==1,0,PrimePi[FactorInteger[n][[-1,1]]]+PrimeOmega[n]-PrimeNu[n]],{n,100}] (* _Gus Wiseman_, Apr 06 2019 *) %o A297113 (PARI) %o A297113 A064989(n) = {my(f); f = factor(n); if((n>1 && f[1,1]==2), f[1,2] = 0); for (i=1, #f~, f[i,1] = precprime(f[i,1]-1)); factorback(f)}; %o A297113 A297113(n) = if(n<=2,n-1,if(n%2,1+A297113(A064989(n)), !(n%4)+A297113(n/2))); %o A297113 (PARI) %o A297113 \\ More complex way, after Moebius transform: %o A297113 A156552(n) = if(1==n, 0, if(!(n%2), 1+(2*A156552(n/2)), 2*A156552(A064989(n)))); %o A297113 A297112(n) = sumdiv(n,d,moebius(n/d)*A156552(d)); %o A297113 A297113(n) = if(1==n,0,1+valuation(A297112(n),2)); %o A297113 (Scheme) %o A297113 ;; With memoization-macro definec. %o A297113 (definec (A297113 n) (cond ((<= n 2) (- n 1)) ((= 2 (modulo n 4)) (A297113 (/ n 2))) (else (+ 1 (A297113 (A252463 n)))))) %Y A297113 One more than A297167 (after the initial term). %Y A297113 Cf. A001511, A008683, A033265, A064989, A156552, A252463, A252464, A297112, A297155. %Y A297113 Cf. also A297157, A297161, A297162. %Y A297113 Cf. A052126, A065770, A112798, A115994, A174090, A325166, A325167, A325169. %K A297113 nonn %O A297113 1,3 %A A297113 _Antti Karttunen_, Dec 26 2017