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.

A210256 Differences of the sum of distinct values of {floor(n/k), k=1,...,n}.

This page as a plain text file.
%I A210256 #24 Oct 31 2023 12:30:05
%S A210256 2,1,3,1,4,1,2,4,2,1,6,1,2,2,6,1,3,1,7,2,2,1,4,6,2,2,3,1,9,1,3,2,2,2,
%T A210256 10,1,2,2,4,1,10,1,3,3,2,1,5,8,3,2,3,1,4,2,11,2,2,1,6,1,2,3,11,2,4,1,
%U A210256 3,2,4,1,14,1,2,3,3,2,4,1,5,11,2,1,6,2,2
%N A210256 Differences of the sum of distinct values of {floor(n/k), k=1,...,n}.
%C A210256 Differences of A051201.
%C A210256 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.
%H A210256 Alois P. Heinz, <a href="/A210256/b210256.txt">Table of n, a(n) for n = 1..10000</a>
%p A210256 b:= proc(n) option remember; add(i, i={seq(floor(n/k), k=1..n)}) end:
%p A210256 a:= n-> b(n+1)-b(n):
%p A210256 seq(a(n), n=1..150); # _Alois P. Heinz_, Mar 19 2012
%t A210256 b[n_] := b[n] = Total@ Union@ Table[Floor[n/k], {k, 1, n}];
%t A210256 a[n_] := b[n+1] - b[n];
%t A210256 Array[a, 150] (* _Jean-François Alcover_, Nov 20 2020, after _Alois P. Heinz_ *)
%o A210256 (Python)
%o A210256 from math import isqrt
%o A210256 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
%Y A210256 Cf. A006218, A051201, A055086.
%K A210256 nonn
%O A210256 1,1
%A A210256 _John W. Layman_, Mar 19 2012