A078267 Smallest k such that k*N is an integer where N is obtained by placing the string "n" after a decimal point.
10, 5, 10, 5, 2, 5, 10, 5, 10, 10, 100, 25, 100, 50, 20, 25, 100, 50, 100, 5, 100, 50, 100, 25, 4, 50, 100, 25, 100, 10, 100, 25, 100, 50, 20, 25, 100, 50, 100, 5, 100, 50, 100, 25, 20, 50, 100, 25, 100, 2, 100, 25, 100, 50, 20, 25, 100, 50, 100, 5, 100, 50, 100, 25, 20
Offset: 1
Examples
a(40) = 5 since 5*0.40 = 2 is an integer. a(1) = a(10) = 10.
Links
- Michael De Vlieger, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
Array[#2/GCD[#1, #2] & @@ {#, 10^IntegerLength[#]} &, 65] (* Michael De Vlieger, Oct 05 2021 *)
-
PARI
a(n) = denominator(n/10^(#Str(n))); \\ Michel Marcus, Mar 31 2019
-
Python
from math import gcd def a(n): b = 10**len(str(n)); return b//gcd(n, b) print([a(n) for n in range(1, 103)]) # Michael S. Branicky, Oct 05 2021
Formula
a(10^m) = 10, a(r*10^m) = a(r).
Extensions
Edited and extended by Henry Bottomley, Dec 08 2002
Comments