OFFSET
1,7
COMMENTS
Starting from the base-7 representation of prime(n) = d_m*7^m + ... + d_3*7^3 + d_2*7^2 + d_1*7 + d_0, the least-significant digit is recursively removed (a shift-right operation in base 7), and the intermediate numbers are all added up:
a(n) = (d_m*7^(m-1) + ... + d_3*7^2 + d_2*7 + d_1)
+ (d_m*7^(m-2) + ... + d_4*7^2 + d_3*7 + d_2)
+ (d_m*7^(m-3) + ... + d_4*7 + d_3)
+ ... + d_m
= Sum_{j=1..m} d_j*(7^j - 1)/6.
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..5000
MAPLE
shiftadd := proc(n, b) dgs := convert(n, base, b) ; add( op(i, dgs)*(b^(i-1)-1), i=2..nops(dgs))/(b-1) ; end:
A163464 := proc(n) shiftadd(ithprime(n), 7) ; end:
seq(A163464(n), n=1..40) ; # R. J. Mathar, Aug 02 2009
MATHEMATICA
lst={}; Do[p=Prime[n]; s=0; While[p>1, p=IntegerPart[p/7]; s+=p; ]; AppendTo[lst, s], {n, 6!}]; lst
CROSSREFS
KEYWORD
nonn,easy,base
AUTHOR
Vladimir Joseph Stephan Orlovsky, Jul 28 2009
EXTENSIONS
Definition rewritten by R. J. Mathar, Aug 02 2009
STATUS
approved