Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A109687
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A109687 Smallest number ending with the digits of n that has exactly n prime factors (counted with multiplicity). +0
2
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; listen)
OFFSET

1,1

EXAMPLE

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

PROGRAM

Program from David Wasserman (dwasserm(AT)earthlink.net), 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 (dwasserm(AT)earthlink.net), Sep 30 2008]

Sequence in context: A115768 A005015 A070069 this_sequence A111696 A047902 A081930

Adjacent sequences: A109684 A109685 A109686 this_sequence A109688 A109689 A109690

KEYWORD

base,nonn

AUTHOR

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

EXTENSIONS

More terms from David Wasserman (dwasserm(AT)earthlink.net), Sep 18 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