cp's OEIS Frontend

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.

A165712 a(n) = the smallest integer > n that is divisible by exactly the same number of primes (counted with multiplicity) as n is.

This page as a plain text file.
%I A165712 #18 Jul 21 2017 08:17:09
%S A165712 3,5,6,7,9,11,12,10,14,13,18,17,15,21,24,19,20,23,27,22,25,29,36,26,
%T A165712 33,28,30,31,42,37,48,34,35,38,40,41,39,46,54,43,44,47,45,50,49,53,72,
%U A165712 51,52,55,63,59,56,57,60,58,62,61,81,67,65,66,96,69,68,71,70,74,75,73,80
%N A165712 a(n) = the smallest integer > n that is divisible by exactly the same number of primes (counted with multiplicity) as n is.
%H A165712 Reinhard Zumkeller, <a href="/A165712/b165712.txt">Table of n, a(n) for n = 2..10000</a>
%e A165712 8 = 2^3, and so is divisible by exactly 3 primes counted with multiplicity. The next larger number divisible by exactly 3 primes counted with multiplicity is 12, which is 2^2 *3. So a(8) = 12.
%t A165712 a[n_] := For[Om = PrimeOmega[n]; k = n+1, True, k++, If[PrimeOmega[k] == Om, Return[k]]]; Table[a[n], {n, 2, 100}] (* _Jean-François Alcover_, Jul 21 2017 *)
%t A165712 Module[{nn = 10^2, s, t}, s = PositionIndex@ Array[PrimeOmega, {nn}]; t = ConstantArray[0, nn]; TakeWhile[#, # > 0 &] &@ Rest@ ReplacePart[t, Flatten@ Map[#1 -> #2 & @@ # &, Map[Partition[Lookup[s, #], 2, 1] &, Keys@ s], {2}]]] (* _Michael De Vlieger_, Jul 21 2017 *)
%o A165712 (Haskell)
%o A165712 a165712 n = head [x | x <- [n + 1 ..], a001222 x == a001222 n]
%o A165712 -- _Reinhard Zumkeller_, Aug 29 2013
%o A165712 (PARI) a(n) = {my(bon = bigomega(n)); my(k = n+1); while (bigomega(k) != bon, k++); k;} \\ _Michel Marcus_, Jul 21 2017
%Y A165712 Cf. A165713.
%Y A165712 Cf. A001222, A079890.
%K A165712 nonn
%O A165712 2,1
%A A165712 _Leroy Quet_, Sep 24 2009
%E A165712 Extended by _Ray Chandler_, Mar 12 2010