login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A109687 Smallest number ending with the digits of n that has exactly n prime factors (counted with multiplicity). 1
11, 22, 63, 24, 405, 96, 2187, 1408, 124659, 65610, 4271211, 38912, 37614213, 40507614, 326836215, 802816, 10010754117, 2496709818, 23202182619, 14417920, 886805499321, 76709256822, 1474909801623, 25165824, 3922632451125 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

LINKS

Table of n, a(n) for n=1..25.

EXAMPLE

a(5)=405 since 405=3*3*3*3*5 (5 factors) and ends with 5 and is the smallest such number

PROG

Program from David Wasserman, Sep 19 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;

{

a(n) =

local(r, num2, num5, d, M, pLeft, mainP, searchP, fixed, x, rNeeded, y, nextP);

r = n;

d = digitcount(n);

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 - num2 - num5;

mainP = if (num2 == d, 2, 3);

searchP = min(4, pLeft);

fixed = 2^num2*5^num5;

x = mainP^(pLeft - searchP);

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

while (bigomega(rNeeded) != searchP,

rNeeded += M

);

y = fixed*x*rNeeded;

if (mainP == 2,

nextP = 3,

nextP = if (num5 == d, 5, 7)

);

while (searchP < pLeft && fixed*x*nextP^(1 + searchP)/mainP < y,

searchP++;

x /= mainP

);

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

while (bigomega(rNeeded) != searchP,

rNeeded += M

);

return(fixed*x*rNeeded);

} (End)

CROSSREFS

Cf. A109665 [From David Wasserman, Sep 30 2008]

Sequence in context: A070069 A178664 A292926 * A225361 A111696 A047902

Adjacent sequences:  A109684 A109685 A109686 * A109688 A109689 A109690

KEYWORD

base,nonn

AUTHOR

Erich Friedman, Aug 07 2005

EXTENSIONS

More terms from David Wasserman, Sep 18 2008

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 26 22:49 EDT 2021. Contains 346300 sequences. (Running on oeis4.)