login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A178139
Distance between n and the next number with the same number of prime factors (counted with multiplicity).
3
1, 2, 2, 2, 3, 4, 4, 1, 4, 2, 6, 4, 1, 6, 8, 2, 2, 4, 7, 1, 3, 6, 12, 1, 7, 1, 2, 2, 12, 6, 16, 1, 1, 3, 4, 4, 1, 7, 14, 2, 2, 4, 1, 5, 3, 6, 24, 2, 2, 4, 11, 6, 2, 2, 4, 1, 4, 2, 21, 6, 3, 3, 32, 4, 2, 4, 2, 5, 5, 2, 8, 6, 3, 1, 2, 5, 14, 4, 28
OFFSET
2,2
COMMENTS
a(n) <= n/2, with equality when n is a power of 2. - Robert Israel, Nov 21 2024
LINKS
FORMULA
{min d >0: A001222(n+d)= A001222(n)}. [R. J. Mathar, May 31 2010]
EXAMPLE
2 is prime. The next prime is 3, and 3-2= 1 = a(2).
For n=3, the next prime is 5, 5-3 = 2 = a(3).
For n=4, the next number with 2 prime factors is 6, 6-4 =2 = a(4).
MAPLE
W:= map(numtheory:-bigomega, [$2..150]):
f:= t -> ListTools:-Search(W[t], W[t+1..-1]):
map(f, [$1..100]); # Robert Israel, Nov 21 2024
MATHEMATICA
a1=Array[Plus @@ Last /@ FactorInteger[ # ] &, 400]; a2=Flatten[Position[a1, k]; In a2 putting 1, 2, 3, ...for k gives table of positions of numbers with k factors, repetitions included.
CROSSREFS
Cf. A176884.
Sequence in context: A275444 A243322 A071454 * A039642 A027300 A085313
KEYWORD
nonn
AUTHOR
Daniel Tisdale, May 20 2010
EXTENSIONS
Offset set to 2, and more terms added by R. J. Mathar, May 31 2010
STATUS
approved