A161664 a(n) = Sum_{i=1..n} (i - d(i)), where d(n) is the number of divisors of n (A000005).
0, 0, 1, 2, 5, 7, 12, 16, 22, 28, 37, 43, 54, 64, 75, 86, 101, 113, 130, 144, 161, 179, 200, 216, 238, 260, 283, 305, 332, 354, 383, 409, 438, 468, 499, 526, 561, 595, 630, 662, 701, 735, 776, 814, 853, 895, 940, 978, 1024, 1068, 1115, 1161, 1212, 1258, 1309
Offset: 1
Examples
a(8) in A000217 minus a(8) in A006218 = a(7) above (28-16=12). Referring to the chart referenced, when n-th year = 7 there are 16 x-markers. These represent unsafe periods for cicada emergence: 28-16=12 safe periods. The percent of safe periods for the entire 7 years is 12/28=~42.86%; for year 7 alone the calculation is 5/7 = 71.43%, a relatively good time to emerge.
References
- Enoch Haga, Eratosthenes goes bugs! Exploring Prime Numbers, 2007, pp 71-80; first publication 1994.
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..10000
- A. Baker, Are there Genuine Mathematical Explanations of Physical Phenomena?, Mind 114 (454) (2005) 223-238.
- Enoch Haga, Prime Safe Periods
- G. F. Webb, The prime number periodical Cicada problem, Discr. Cont. Dyn. Syst. 1 (3) (2001) 387.
- Wildforests, Cicada, visited Dec. 2012. - From _N. J. A. Sloane_, Dec 25 2012
Crossrefs
Programs
-
Maple
with(numtheory): A161664:=n->add(i-tau(i), i=1..n): seq(A161664(n), n=1..100); # Wesley Ivan Hurt, Jul 15 2014 # second Maple program: a:= proc(n) option remember; `if`(n<1, 0, a(n-1)+n-numtheory[tau](n)) end: seq(a(n), n=1..55); # Alois P. Heinz, Jun 24 2022
-
Mathematica
a[n_] := n*(n+1)/2 - Sum[ DivisorSigma[0, k], {k, n}]; Table[a[n], {n, 55}] (* Jean-François Alcover, Nov 07 2011 *)
-
Python
from math import isqrt def A161664(n): return (lambda m: n*(n+1)//2+m*m-2*sum(n//k for k in range(1, m+1)))(isqrt(n)) # Chai Wah Wu, Oct 08 2021
Formula
For n>1: a(n) = Sum_{h=1..n} Sum_{m=1..1 + 2*floor(n/2 - 1/2)} Sum_{k=1 + floor(h/(m + 1))..floor(h/m - 1/m)} 1 (from Granvik at A368592). - Bill McEachen, Apr 01 2025
Extensions
Simplified definition, offset corrected and partially edited by Omar E. Pol, Jun 18 2009
New name from Wesley Ivan Hurt, Jul 15 2014
Comments