OFFSET
0,5
COMMENTS
From Antti Karttunen, Dec 06 2014: (Start)
For n >= 2, a(n) tells in which column of the sieve of Eratosthenes (see A083140, A083221) n occurs in. A055396 gives the corresponding row index.
(End)
LINKS
Harvey P. Dale (terms 1 - 1000) & Antti Karttunen, Table of n, a(n) for n = 0..10000
FORMULA
Ordinal transform of A020639 (Lpf). - Franklin T. Adams-Watters, Aug 28 2006
From Antti Karttunen, Dec 05-08 2014: (Start)
a(0) = 0, a(1) = 1, a(n) = 1 + a(A249744(n)).
[Instead of Moebius mu (A008683) one could use Liouville's lambda (A008836) in the above formulas, because all primorials (A002110) are squarefree. A020639(n) gives the smallest prime dividing n, and A055396 gives its index].
a(0) = 0, a(1) = 1, a(2n) = n, a(2n+1) = a(A250470(2n+1)). [After a similar recursive formula for A246277. However, this cannot be used for computing the sequence, unless a definition for A250470(n) is found which doesn't require computing the value of A078898(n).]
(End)
Other identities:
a(2*n) = n.
For n > 1: a(n)=1 if and only if n is prime.
From Antti Karttunen, Jan 04 2015: (Start)
a(n) = 2 if and only if n is a square of a prime.
For all n >= 1: a(A251728(n)) = A243055(A251728(n)) + 2. That is, if n is a semiprime of the form prime(i)*prime(j), prime(i) <= prime(j) < prime(i)^2, then a(n) = (j-i)+2.
(End)
Sum_{k=1..n} a(k) ~ c * n^2 / 2, where c = Sum_{k>=1} (A038110(k)/A038111(k))^2 = 0.2847976823663... . - Amiram Eldar, Oct 26 2024
MAPLE
N:= 1000: # to get a(0) to a(N)
Primes:= select(isprime, [2, seq(2*i+1, i=1..floor((N-1)/2))]):
A:= Vector(N):
for p in Primes do
t:= 1:
A[p]:= 1:
for n from p^2 to N by p do
if A[n] = 0 then
t:= t+1:
A[n]:= t
fi
od
od:
0, 1, seq(A[i], i=2..N); # Robert Israel, Jan 04 2015
MATHEMATICA
Module[{nn=90, spfs}, spfs=Table[FactorInteger[n][[1, 1]], {n, nn}]; Table[ Count[ Take[spfs, i], spfs[[i]]], {i, nn}]] (* Harvey P. Dale, Sep 01 2014 *)
PROG
(PARI)
\\ Not practical for computing, but demonstrates the sum moebius formula:
A020639(n) = { if(1==n, n, vecmin(factor(n)[, 1])); };
A002110(n) = prod(i=1, n, prime(i));
A078898(n) = { my(k, p); if(1==n, n, k = A002110(A055396(n)-1); p = A020639(n); sumdiv(k, d, moebius(d)*(n\(p*d)))); };
\\ Antti Karttunen, Dec 05 2014
(Scheme, with memoizing definec-macro)
;; Much better for computing. Needs also code from A249738 and A249744. - Antti Karttunen, Dec 06 2014
(Haskell)
import Data.IntMap (empty, findWithDefault, insert)
a078898 n = a078898_list !! n
a078898_list = 0 : 1 : f empty 2 where
f m x = y : f (insert p y m) (x + 1) where
y = findWithDefault 0 p m + 1
p = a020639 x
-- Reinhard Zumkeller, Apr 06 2015
CROSSREFS
KEYWORD
nonn,changed
AUTHOR
Reinhard Zumkeller, Dec 12 2002
EXTENSIONS
a(0) = 0 prepended for recurrence's sake by Antti Karttunen, Dec 06 2014
STATUS
approved