OFFSET
0,2
COMMENTS
Conjecture: The difference a(n)-a(n-1) is 6 if and only if n is a prime number. This has been checked up to about n=300 and may be easy to prove.
Preceding conjecture is a corollary of Jovovic's formula below. - Eric M. Schmidt, Aug 19 2012
LINKS
Eric M. Schmidt, Table of n, a(n) for n = 0..10000
Eric Weisstein's World of Mathematics, Quadratic Equation
FORMULA
a(n) = a(n-1)+2*(tau(n)+1)+A010052(n), n>1, a(1) = 4. - Vladeta Jovovic, Mar 05 2002, edited by Eric M. Schmidt, Aug 19 2012
MATHEMATICA
a[n_] := If[n >= 1, 2 Sum[Length[Divisors[k]], {k, n}] + Floor[Sqrt[n]] + 2 n - 1]; Join[{1}, Table[a[n], {n, 50}]] (* Lorenz H. Menke, Jr., Apr 13 2016 *)
PROG
(Sage)
def A067274(max) :
res = [1]
term = 4
for ii in range(1, max+1) :
res += [term]
term += 2 * (number_of_divisors(ii+1) + 1) + is_square(ii+1)
return res
# Eric M. Schmidt, Aug 19 2012
CROSSREFS
KEYWORD
nonn
AUTHOR
John W. Layman, Feb 21 2002
STATUS
approved