OFFSET
1,2
COMMENTS
The number of geometric-progression subsequences of [1,...,n] with integral successive-term ratio r and length k is floor(n/r^(k-1))(n > 0, r > 1, k > 0).
LINKS
Paolo Xausa, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = n + Sum_{r > 1, j > 0} floor(n/r^j).
EXAMPLE
a(1): [1]; a(2): [1],[2],[1,2]; a(3): [1],[2],[3],[1,2],[1,3].
MAPLE
g := (n, b) -> local i; add(iquo(n, b^i), i = 1..floor(log(n, b))):
a := n -> local b; n + add(g(n, b), b = 2..n):
seq(a(n), n = 1..58); # Peter Luschny, Apr 03 2025
MATHEMATICA
Accumulate[1 + Table[Total[IntegerExponent[n, Rest[Divisors[n]]]], {n, 100}]] (* Paolo Xausa, Aug 27 2025 *)
PROG
(PARI) A078651(n) = {my(s=0, k=2); while(k<=n, s+=(n - sumdigits(n, k))/(k-1); k=k+1); n + s} \\ Zhuorui He, Aug 28 2025
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Robert E. Sawyer (rs.1(AT)mindspring.com), Jan 08 2003
STATUS
approved
