login
Reverse concatenation of first n positive integers modulo forward concatenation of first n positive integers.
1

%I #16 Nov 19 2018 11:14:29

%S 0,9,75,619,4941,37041,246919,1234575,9,10987654321,1110987654321,

%T 121110987654321,775432077543108,178553219976533007,

%U 27956332009875522906,3805734210999774512805,481583522109989673502704,58259362312008979572492603,6836037241301907969471482502

%N Reverse concatenation of first n positive integers modulo forward concatenation of first n positive integers.

%H Vincenzo Librandi, <a href="/A095249/b095249.txt">Table of n, a(n) for n = 1..375</a>

%F a(n) = A000422(n) mod A007908(n). - _Michel Marcus_, Nov 19 2018

%e a(4) = 619 = 4321 mod 1234.

%p a:= n-> irem(parse(cat(n-i$i=0..n-1)), parse(cat(i$i=1..n))):

%p seq(a(n), n=1..20); # _Alois P. Heinz_, Nov 19 2018

%t r = f = ""; Do[r = ToString[n] <> r; f = f <> ToString[n]; Print[Mod[ToExpression[r], ToExpression[f]]], {n, 1, 30}] (* _Ryan Propper_, Aug 26 2005 *)

%t nn=30;Module[{r,f},Table[f=Flatten[IntegerDigits/@Range[n]]; r=Flatten[ IntegerDigits/@Range[n,1,-1]];Mod[FromDigits[r],FromDigits[f]],{n,nn}]] (* _Harvey P. Dale_, Mar 04 2013 *)

%Y Cf. A000422, A007908.

%K base,nonn

%O 1,2

%A _Amarnath Murthy_, Jun 17 2004

%E Corrected and extended by _Ryan Propper_, Aug 26 2005