Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A058376
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A058376 When the race of the count of final nonzero digit of n! changes. +0
1
2, 16, 50, 80, 88, 108, 110, 264, 273, 291, 326, 336, 669, 671, 678, 685, 718, 721, 738, 764, 773, 791, 826, 836, 1433, 1435, 1558, 1560, 1616, 1629, 1636, 1694, 1696, 1764, 1773, 1791, 1826, 1836, 1928, 1935, 1968, 1971, 1988, 2014, 2023, 2041, 2076, 2086 (list; graph; listen)
OFFSET

2,1

LINKS

Index entries for sequences related to final digits of numbers

EXAMPLE

a(1) = 2 to start the race. At 15! the number of final twos is 5 and so is the number of eights. But at 16, eights now leads twos, so a(2) = 16 to reflect this fact.

At 1000!, the number of twos is 2509, fours is 2486, sixes is 2494, and finally eights is 2510; for a total of 9999.

MATHEMATICA

f[ n_Integer, m_Integer ] := (c = 0; p = 1; While[ d = Floor[ n/5^p ]; d > 0, c = c + d; p++ ]; Mod[ n!/10^c, m ]); a = Table[ 0, {4} ]; r = 4; Do[ b = f[ n, 10 ]; Switch[ b, 2, a[ [ 1 ] ]++, 4, a[ [ 2 ] ]++, 6, a[ [ 3 ] ]++, 8, a[ [ 4 ] ]++ ]; If[ a[ [ b/2 ] ] > a[ [ r/2 ] ], r = b; Print[ n ] ], {n, 2, 10^4} ]

CROSSREFS

Cf. A045547, A045548, A045549, A045550.

Sequence in context: A139267 A063721 A012180 this_sequence A120948 A090453 A006885

Adjacent sequences: A058373 A058374 A058375 this_sequence A058377 A058378 A058379

KEYWORD

nonn

AUTHOR

Robert G. Wilson v (rgwv(AT)rgwv.com), Dec 19 2000

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 September 5 01:44 EDT 2008. Contains 143476 sequences.


AT&T Labs Research