OFFSET
1,6
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
FORMULA
If n is of form 2^i*5^j then a(n)=0, otherwise a(n)=10^(n-1)+n-A053041(n)
From Robert Israel, Nov 25 2024: (Start)
If n is prime other than 2 or 5, then a(n) = 1.
If n = 2^i * 5^j * p where p is a prime > 10^(2^i * 5^j), then a(n) = 10^(2^i * 5^j).
If n = 2^i * 5^j * p where p is a prime and
2^(2^i * 5^j - 1 - i) * 5^(2^i * 5^j -1 - j) > p > 2^(2^i * 5^j-2 - u) * 5^(2^i * 5^j-1-j),
then a(n) = 10^(2^i * 5^j - 1) - 2^i * 5^j * p.
For example, with i = 0 and j = 1 we get a(5*p) = 10^4 - 5*p if p is a prime between 1000 and 2000.
(End)
EXAMPLE
a(6)=4 since 100000=6*16666+4
MAPLE
0, seq(10&^(n-1) mod n, n=2..100); # Robert Israel, Nov 25 2024
MATHEMATICA
Table[PowerMod[10, n-1, n], {n, 100}] (* Harvey P. Dale, Jul 17 2021 *)
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Henry Bottomley, Jul 20 2000
STATUS
approved