cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A156230 Sum of the products of the digits of n and the positions of the digits m in n starting from the last digit.

This page as a plain text file.
%I A156230 #7 Dec 02 2018 15:04:11
%S A156230 1,2,3,4,5,6,7,8,9,2,3,4,5,6,7,8,9,10,11,4,5,6,7,8,9,10,11,12,13,6,7,
%T A156230 8,9,10,11,12,13,14,15,8,9,10,11,12,13,14,15,16,17,10,11,12,13,14,15,
%U A156230 16,17,18,19,12,13,14,15,16,17,18,19,20,21,14,15,16,17,18,19,20,21,22,23,16,17,18,19,20,21,22,23,24,25,18,19,20,21,22,23,24,25,26,27,3
%N A156230 Sum of the products of the digits of n and the positions of the digits m in n starting from the last digit.
%C A156230 Starts to differ from A081594 when n>=100. [From _R. J. Mathar_, Feb 19 2009]
%F A156230 Let n = d(1)d(2)...d(m) where d(1),d(2),...,d(m) are the digits of n. Then a(n) = m*d1+(m-1)*d2+...+d(m).
%e A156230 a(19) = 9*1 + 1*2 = 11.
%p A156230 A156230 := proc(n)
%p A156230     local dgs;
%p A156230     dgs := convert(n,base,10) ;
%p A156230     add(i*op(i,dgs),i=1..nops(dgs)) ;
%p A156230 end proc:
%p A156230 seq(A156230(n),n=1..100) ; # _R. J. Mathar_, Dec 02 2018
%t A156230 pdn[n_]:=Module[{idn=IntegerDigits[n]},Total[idn Range[Length[idn],1,-1]]]; Array[pdn,80] (* _Harvey P. Dale_, Aug 22 2012 *)
%o A156230 (PARI) gr(n) = v=Vec((rev(n)));sum(x=1,length(v),x*eval(v[x]))
%o A156230 gr1(n) = for(j=1,n,print1(gr(j)","))
%o A156230 rev(str) = /* Get the reverse of the input string
%o A156230 */ {
%o A156230 local(tmp,s,j);
%o A156230 tmp = Vec(Str(str));
%o A156230 s="";
%o A156230 forstep(j=length(tmp),1,-1,
%o A156230 s=concat(s,tmp[j]));
%o A156230 return(s)
%o A156230 }
%K A156230 base,nonn
%O A156230 1,2
%A A156230 _Cino Hilliard_, Feb 06 2009
%E A156230 Changed the description, formula and Pari code _Cino Hilliard_, Feb 08 2009
%E A156230 More terms to separate from A322001. - _R. J. Mathar_, Dec 02 2018