A114795 {concatenation n, n-1, n-2, ...3,2,1} mod n.
0, 1, 0, 1, 1, 3, 3, 1, 0, 1, 6, 9, 2, 1, 6, 1, 4, 9, 0, 1, 12, 17, 4, 9, 21, 21, 0, 13, 11, 21, 20, 17, 6, 29, 1, 9, 8, 25, 36, 1, 0, 33, 41, 17, 36, 23, 26, 33, 34, 21, 30, 41, 38, 27, 6, 1, 36, 39, 7, 21, 31, 59, 54, 49, 21, 39, 57, 45, 60, 41, 31, 9, 37, 41, 21
Offset: 1
Examples
a(7) = 7654321 mod 7 = 3.
Links
- Indranil Ghosh, Table of n, a(n) for n = 1..10000
Crossrefs
Cf. A000422.
Programs
-
Mathematica
f[n_] := Mod[FromDigits@ Flatten@ IntegerDigits@ Reverse@ Range@ n, n]; Array[f, 75] (* or *) f[n_] := Fold[Mod[#1*10^Floor[1 + Log10@#2] + #2, n] &, 0, Reverse@Range@n]; Array[f, 75] (* Robert G. Wilson v, Jan 10 2017 *)
-
Python
def A114795(n): s="" for i in range(n,0,-1): s+=str(i) return int(s)%n # Indranil Ghosh, Jan 10 2017
Formula
a(n) = A000422(n) mod n. - Michel Marcus, Jan 10 2017
Extensions
More terms from Ryan Murphy (murphy(AT)minegoboom.com) and Evonne Haines (avissean(AT)adelphia.net), Jan 21 2006