Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A109665
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A109665 Smallest number that has exactly n distinct prime factors and ends with the digits of n. +0
2
11, 12, 273, 714, 15015, 149226, 22309287, 60138078, 25588752189, 8720021310, 55093966638711, 197238101872812, 92887605454857213, 174457101106502214, 25517925977422393515, 951603427533949306116, 832747507651789493981217 (list; graph; listen)
OFFSET

1,1

EXAMPLE

a(2)=12 since 12 has 2 prime factors (2 and 3) and ends with 2 and is the smallest such number

MATHEMATICA

f[n_] := Block[{k = n, inc = 10^Floor[ Log[10, n] + 1]}, While[ Length[ FactorInteger[ k]] != n, k += inc]; k]; (* Robert G. Wilson v *), Aug 08 2005)

PROGRAM

Contribution from David Wasserman (dwasserm(AT)earthlink.net), Sep 30 2008: (Start)

(PARI) digitcount(n, base = 10) = local(d); if (n == 0, return(1)); d = 1 + floor(log(n)/log(base)); while (n >= base^d, d++); while (n < base^(d - 1), d--); d;

leastCombo(numPrimes, firstPrime, limit, M, r) = lcHelper(numPrimes, firstPrime, limit, prod(i = firstPrime, firstPrime + numPrimes - 1, prime(i)), 1, firstPrime + numPrimes, M, r);

lcHelper(left, i, limit, minimum, found, nextP, M, r) = local(p); if (left == 0, return(if (found%M == r, found, limit))); p = prime(i); limit = lcHelper(left - 1, i + 1, limit, minimum, found*p, nextP, M, r); if (minimum*prime(nextP)/p <= limit, limit = lcHelper(left, i + 1, limit, minimum*prime(nextP)/p, found, nextP + 1, M, r)); limit;

{

\This function returns 0 if its assumptions fail; otherwise it returns the correct answer. With the defaults 3 and 40, no failures occur in the first 1000 terms.

a(n, searchP = 3, searchSize = 40) =

local(r, num2, num5, d, M, pLeft, assumedP, fixed, x, rNeeded, y, best, z, zz, j, z3, pLimit);

r = n;

d = digitcount(n);

if (n < 7,

while (omega(r) != n, r += 10);

return(r)

);

while (num2 < d && !(r%2),

num2++;

r = r/2

);

while (num5 < d && !(r%5),

num5++;

r = r/5

);

M = 10^d/2^num2/5^num5;

pLeft = n - if (num2, 1, 0) - if (num5, 1, 0);

searchP = 3;

searchSize = 40;

fixed = 2^num2*5^num5;

assumedP = pLeft - searchP;

x = 3*prod(i = 4, assumedP + 2, prime(i));

rNeeded = lift(Mod(r, M)/Mod(x, M));

best = prime(n + 40)^searchP;

forvec (v = vector(searchP, i, [assumedP + 3, assumedP + searchSize + 2]), y = prod(i = 1, searchP, prime(v[i])); if (y%M == rNeeded, best = min(best, y)), 2);

if (best == searchP ^prime(n + 40), return(0));

y = fixed*x*best;

z = fixed*x*prod(i = assumedP + 3, pLeft + 2, prime(i));

if (z >= 2*y, return(0));

rNeeded = lift(Mod(r, M)/3);

return(fixed*3*leastCombo(pLeft - 1, 4, y/fixed/3, M, rNeeded));

} (End)

CROSSREFS

A109687 [From David Wasserman (dwasserm(AT)earthlink.net), Sep 30 2008]

Sequence in context: A038326 A041059 A041260 this_sequence A041261 A041262 A041607

Adjacent sequences: A109662 A109663 A109664 this_sequence A109666 A109667 A109668

KEYWORD

base,nonn

AUTHOR

Erich Friedman (efriedma(AT)stetson.edu), Aug 06 2005

EXTENSIONS

a(11) - a(17) from Robert G. Wilson v (rgwv(at)rgwv.com), Aug 08 2005

Corrected terms. Deleted second program, which appeared to be incorrect. - David Wasserman (dwasserm(AT)earthlink.net), Sep 30 2008

page 1

Search completed in 0.002 seconds

Lookup | Welcome | Find friends | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
More pages | Superseeker | Maintained by N. J. A. Sloane (njas@research.att.com)

Last modified November 25 20:09 EST 2009. Contains 167514 sequences.


AT&T Labs Research