OFFSET
1,1
COMMENTS
Differences of A051201.
It appears that a(n)=1 if and only if n>1 and n+1 is a prime. For example, the indices where 1 occurs in {a(n)} are {2,4,6,10,12,16,...}. Adding 1 to each of these gives {3,5,7,11,13,17,...} each of which is a prime.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000
MAPLE
b:= proc(n) option remember; add(i, i={seq(floor(n/k), k=1..n)}) end:
a:= n-> b(n+1)-b(n):
seq(a(n), n=1..150); # Alois P. Heinz, Mar 19 2012
MATHEMATICA
b[n_] := b[n] = Total@ Union@ Table[Floor[n/k], {k, 1, n}];
a[n_] := b[n+1] - b[n];
Array[a, 150] (* Jean-François Alcover, Nov 20 2020, after Alois P. Heinz *)
PROG
(Python)
from math import isqrt
def A210256(n): return ((m:=isqrt((n+1<<2)+1)+1>>1)*(m-1)>>1)+sum((n+1)//k for k in range(1, (n+1)//m+1))-((r:=isqrt((n<<2)+1)+1>>1)*(r-1)>>1)-sum(n//k for k in range(1, n//r+1)) # Chai Wah Wu, Oct 31 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
John W. Layman, Mar 19 2012
STATUS
approved